session_dictionary.slap randomly failing

Bug #690532 reported by Andrew Hutchings on 2010-12-15
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Brian Aker
Brian Aker

Bug Description

This test has failed 33 times since 2010-11-17 (build 1937)

Latest failure:

Changed in drizzle:
assignee: nobody → Andrew Hutchings (linuxjedi)
Andrew Hutchings (linuxjedi) wrote :
Download full text (4.7 KiB)

#0 0x0000003b9e20c94c in pthread_kill () from /lib64/
#1 0x00000000008dd1f1 in write_core (sig=11) at drizzled/
#2 0x00000000008dd3d5 in drizzled_handle_segfault (sig=11) at drizzled/
#3 <signal handler called>
#4 0x0000000000000000 in ?? ()
#5 0x000000000072296c in boost::detail::sp_counted_base::release (this=0x36aafd0) at /usr/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:145
#6 0x00000000007229fb in boost::detail::shared_count::~shared_count (this=0x7f4f2fffe1a8, __in_chrg=<value optimized out>) at /usr/include/boost/smart_ptr/detail/shared_count.hpp:217
#7 0x000000000078327a in boost::shared_ptr<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const>::~shared_ptr (this=0x7f4f2fffe1a0, __in_chrg=<value optimized out>) at /usr/include/boost/smart_ptr/shared_ptr.hpp:169
#8 0x0000000000b8106d in ProcesslistTool::Generator::populate (this=0x7f4f0802a550) at plugin/session_dictionary/
#9 0x00000000008baa48 in drizzled::plugin::TableFunction::Generator::sub_populate (this=0x7f4f0802a550, field_size=9) at drizzled/plugin/
#10 0x00000000009c151d in FunctionCursor::rnd_next (this=0x7f4f1c00c9e0) at plugin/function_engine/
#11 0x00000000008c3a2c in drizzled::rr_sequential (info=0x7f4f08007a48) at drizzled/
#12 0x0000000000904dba in drizzled::sub_select (join=0x7f4f08005460, join_tab=0x7f4f080079c0, end_of_records=false) at drizzled/
#13 0x00000000009049a2 in drizzled::do_select (join=0x7f4f08005460, fields=0x0, table=0x7f4f08029270) at drizzled/
#14 0x000000000083fee7 in drizzled::Join::exec (this=0x7f4f08005460) at drizzled/
#15 0x00000000008fe72a in drizzled::mysql_select (session=0x36ab350, rref_pointer_array=0x36ac138, tables=0x7f4f08004fc0, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x7f4f08005360, group=0x0, having=0x0, select_options=2147500032, result=0x7f4f08005440, unit=0x36abd80, select_lex=0x36abf80) at drizzled/
#16 0x00000000008fe03d in drizzled::handle_select (session=0x36ab350, lex=0x36abd60, result=0x7f4f08005440, setup_tables_done_option=0) at drizzled/
#17 0x00000000008fa7c7 in drizzled::execute_sqlcom_select (session=0x36ab350, all_tables=0x7f4f08004fc0) at drizzled/
#18 0x0000000000952637 in drizzled::statement::Select::execute (this=0x7f4f08006ff0) at drizzled/statement/
#19 0x00000000008fa465 in drizzled::mysql_execute_command (session=0x36ab350) at drizzled/
#20 0x00000000008fb0ad in drizzled::mysql_parse (session=0x36ab350, inBuf=0x7f4f08006df8 "SELECT a.ID FROM data_dictionary.processlist as a, data_dictionary.processlist as b ORDER BY ID", length=95) at drizzled/
#21 0x00000000008f9d54 in drizzled::dispatch_command (command=drizzled::COM_QUERY, session=0x36ab350, packet=0x36b2c11 "SELECT a.ID FROM data_dictionary.processlist as a, data_dictionary.processlist as b ORDER BY ID", packet_length=95) at drizzled/
#22 0x00000000008ca54e in drizzled::Session::executeStatement (this=0x36ab350) at dri...


Andrew Hutchings (linuxjedi) wrote :

I believe boost::weak_ptr needs to be used in our implementation, but I need to find out more about it.

Andrew Hutchings (linuxjedi) wrote :

To reproduce "./dtr --suite=session_dictionary slap --repeat-test=1000 --fast"

Attached thread apply all bt full output. My guess is thread 13 and thread 1 race or something similar.

Andrew Hutchings (linuxjedi) wrote :

ok, so copying a shared_ptr from another thread is not always a good idea. The internal accounting is thread-safe but if you reset() or delete whilst reading, this isn't thread safe.

This is causing lots of issues for the processlist table if sessions are in constant flux (created/deleted rapidly). Hence session_dictionay.slap test was failing randomly.

The fix I have committed fixes some of this and is crashes less-often, but it still can crash in other harder to fix places.

Andrew Hutchings (linuxjedi) wrote :

scrapping my work, have been working with krow on this in the background and he has a better solution

Andrew Hutchings (linuxjedi) wrote :

Re-assigning to Brian as he is working on a fix for this.

Andrew Hutchings (linuxjedi) wrote :

Setting as fixed released, this failure no longer happens

Lee Bieber (kalebral) wrote :

Brian is still seeing this when you run with --repeat=30

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.