Sat 09 Feb 2008 11:21:58 AM UTC, comment #2:
The bug is due to the SoundHandlerGst::_sound vector
being modified during the for_each() scan.
There are two possible way to modify it:
either the SoundGst::poll() function modifies it (directly or
indirectly), or another thread does.
I don't know the design enough to tell what's the issue here,
but since the bug can only be reproduced occasionally, I bet
it's a threading issue.
|
Sat 09 Feb 2008 11:11:47 AM UTC, original submission:
It takes a debugging STL build for this to reproduce.
It is done by adding -D_GLIBCXX_DEBUG to the CXXFLAGS.
I encourage all developers to use such a flag.
Play the attached movie (rainbow.swf) and move the mouse around,
this is what you get:
/usr/include/c++/4.1.3/debug/safe_iterator.h:210:error:
attempt to increment a singular iterator.
Objects involved in the operation:
iterator "this" @ 0x0xbfd2f690 {
type = N11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPPN5gnash5media8SoundGstEN10__gnu_norm6vectorIS6_SaIS6_EEEEEN15__gnu_debug_def6vectorIS6_SA_EEEE (mutable iterator);
state = singular;
references sequence with type `N15__gnu_debug_def6vectorIPN5gnash5media8SoundGstESaIS4_EEE' @ 0x0xbfd2f690
}
It not 100% reproducible, you must start moving the mouse while still parsing probably.
Here's a backtrace:
(gdb) bt
#0 0xffffe410 in __kernel_vsyscall ()
#1 0xb7129875 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0xb712b201 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0xb72bc9e6 in __gnu_debug::_Error_formatter::_M_error () from /usr/lib/libstdc++.so.6
#4 0xb7f25670 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<gnash::media::SoundGst*, __gnu_norm::vector<gnash::media::SoundGst, std::allocator<gnash::media::SoundGst> > >, __gnu_debug_def::vector<gnash::media::SoundGst, std::allocator<gnash::media::SoundGst*> > >::operator++ (this=0xbfb25470)
at /usr/include/c++/4.1.3/debug/safe_iterator.h:208
#5 0xb7f25a29 in std::for_each<__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<gnash::media::SoundGst*, _gnu_norm::vector<gnash::media::SoundGst, std::allocator<gnash::media::SoundGst> > >, __gnu_debug_def::vector<gnash::media::SoundGst, std::allocator<gnash::media::SoundGst> > >, boost::_mfi::mf0<void, gnash::media::SoundGst> > (__first=@0xbfb25470, __last=@0xbfb2545c, __f={f = (void ( gnash::media::SoundGst::)(void)) -151105726})
at /usr/include/c++/4.1.3/bits/stl_algo.h:158
#6 0xb7f217d9 in gnash::media::SoundHandlerGst::poll_sounds (this=0x8159850) at /home/strk/src/gnash/gnash-head/libmedia/gst/SoundHandlerGst.cpp:62
#7 0xb7f21871 in gnash::media::SoundHandlerGst::poll_cb () at /home/strk/src/gnash/gnash-head/libmedia/gst/SoundHandlerGst.cpp:242
#8 0xb7f233bb in gnash::builtin_function::operator() (this=0xb5a75e60, fn=@0xbfb2551c) at /home/strk/src/gnash/gnash-head/server/builtin_function.h:83
#9 0xb7e0ce93 in gnash::call_method (method=@0xbfb25ef8, env=0xbfb25d00, this_ptr=0xb5a8f500, nargs=0, first_arg_bottom_index=-1)
at /home/strk/src/gnash/gnash-head/server/vm/action.cpp:156
#10 0xb7c89221 in gnash::Timer::execute (this=0xb5a00468) at /home/strk/src/gnash/gnash-head/server/timers.cpp:167
|