bugGnash - The GNU Flash player - Bugs: bug #22915, Assertion `_loader.isSelfThread()'...

 
 

bug #22915: Assertion `_loader.isSelfThread()' failed.

Submitted by:  Ivan Kalvachev <iive>
Submitted on:  Mon 14 Apr 2008 04:37:58 PM UTC  
 
Category: release 0.8.2Severity: 5 - Blocker
Release: trunkStatus: Fixed
Privacy: PublicAssigned to: Sandro Santilli <strk>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Mon 06 Oct 2008 06:53:28 PM UTC, comment #23:

I just realized this item is marked for release 0.8.2.
I guess we fixed it, since original reporter doesn't followup
let's assume it is.

Sandro Santilli <strk>
Project MemberIn charge of this item.
Wed 01 Oct 2008 05:11:48 PM UTC, comment #22:

Can't reproduce this. I've been running 1.36 only today, but the report suggests it happened every time.

Benjamin Wolsey <bwy>
Project Member
Wed 01 Oct 2008 09:01:41 AM UTC, comment #21:

Damn... 1.36 changed things again ?!
See how you can tweak the test in file #15481 ?

Sandro Santilli <strk>
Project MemberIn charge of this item.
Wed 01 Oct 2008 08:58:44 AM UTC, comment #20:

I am getting error mentioned by Ivan (_loader.isSelfThread() assertion failed).

I am using boost 1.36.

I applied the patch mentioned in this discussion. After applying the patch, the compiler throws error (this_thread is not a member of boost::thread)

Are there any patches available when using with boost 1.36.

Kans.

Kannappan <kans>
Wed 23 Apr 2008 02:24:34 PM UTC, comment #19:

CVS compiles are runs ok.

Confirmed.

Ivan Kalvachev <iive>
Sat 19 Apr 2008 07:23:17 PM UTC, comment #18:

Committed your version.
Please confirm and I'll close this bug.
Thanks.

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sat 19 Apr 2008 04:36:55 PM UTC, comment #17:

If you replace
- return boost::thread::this_thread.get_id() == _thread->get_id();
+ return boost::this_thread::get_id() == _thread->get_id();

it will pass the assertion.

Ivan Kalvachev <iive>
Sat 19 Apr 2008 04:11:47 PM UTC, comment #16:

Attached patch for gnash

(file #15482)

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sat 19 Apr 2008 03:43:34 PM UTC, comment #15:

Attached is a new version of the thread_equality test.
This time it will attempt to get current thread
in a different way for boost 1.35 and 1.34.

I don't have 1.35 installed so can't test.
Can you test Ivan ?

(file #15481)

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sat 19 Apr 2008 01:13:16 PM UTC, comment #14:

Interesting comment by dli (#gnash on freenode)

dli said:

> strk, Thread IDs are separated from boost::thread,
> so a thread can obtain it's own ID (using
> boost::this_thread::get_id()), and IDs can be
> used as keys in associative containers, as they
> have the full set of comparison operators.

Sandro Santilli <strk>
Project MemberIn charge of this item.
Thu 17 Apr 2008 04:32:28 PM UTC, comment #13:

Filed: http://svn.boost.org/trac/boost/ticket/1835

Sandro Santilli <strk>
Project MemberIn charge of this item.
Thu 17 Apr 2008 03:37:42 PM UTC, comment #12:

I don't think it is bug in boost.

If you think this is boost bug, then you have to fill it.
The sample triggering program is yours too.

Ivan Kalvachev <iive>
Thu 17 Apr 2008 01:51:55 PM UTC, comment #11:

Sounds pretty much like a bug in boost-1.35.0
I suggest you file a bug on the boost tracker.

Sandro Santilli <strk>
Project MemberIn charge of this item.
Thu 17 Apr 2008 12:19:19 PM UTC, comment #10:

Read my first post.

Ivan Kalvachev <iive>
Thu 17 Apr 2008 11:25:26 AM UTC, comment #9:

Sure, the code relies on that equality operator indeed.
What boost thread version are you using ?

Sandro Santilli <strk>
Project MemberIn charge of this item.
Thu 17 Apr 2008 11:11:39 AM UTC, comment #8:

Barrier waiting in func
Barrier waiting in main
Barrier waiting in func done
a.out: thread_equality.cpp:22: void func(): Assertion `*myThread == selfThread' failed.
Aborted

BTW, you know that boost:thread overloads the operator== . don't you?

Ivan Kalvachev <iive>
Thu 17 Apr 2008 10:58:57 AM UTC, comment #7:

I committed a boost::barrier mechanism
to ensure that _thread member is initialized
before it's checked by code executed in the spawned thread.
Tests highly welcome.

Sandro Santilli <strk>
Project MemberIn charge of this item.
Thu 17 Apr 2008 10:46:12 AM UTC, comment #6:

Ok, forget my previous patch, is known to be bogus.
Try the attached thread_equality.cpp testcase instead.
It will use boost::barrier for the job, and looks
effective here.

(file #15468)

Sandro Santilli <strk>
Project MemberIn charge of this item.
Thu 17 Apr 2008 09:52:25 AM UTC, comment #5:

Ivan, could you try the attached patch and see if it fixes your problem ? It adds a conditional variable to ensure the spawned
thread code won't execute before it's value is assigned to
the member used to check for isSelfThread (which is the same
also used for proper shutdown, btw)

(file #15467)

Sandro Santilli <strk>
Project MemberIn charge of this item.
Thu 17 Apr 2008 09:46:17 AM UTC, comment #4:

The email is cut in half. Take a look of the full comment in the bug tracker. It contains a little bit more of the debug session. Including the part that show that "return this_thread == *_thread;" is the one that returns False.

Ivan Kalvachev <iive>
Thu 17 Apr 2008 08:28:54 AM UTC, comment #3:

Ivan, could you check if isSelfThread returns false
due to !_thread.get() OR to this_thread != *_thread ?

Sandro Santilli <strk>
Project MemberIn charge of this item.
Thu 17 Apr 2008 01:16:17 AM UTC, comment #2:

Sorry for the delay. I found out that I had sytax error in the build script and I didn't had maximum debug info.
Here is new backtrace and some debug session as requested.

I hope this helps.

(gdb) bt
#0 0xb7212c66 in raise () from /lib/libc.so.6
#1 0xb7214571 in abort () from /lib/libc.so.6
#2 0xb720be60 in __assert_fail () from /lib/libc.so.6
#3 0xb7db9e2f in gnash::movie_def_impl::read_all_swf (this=0x82809c0) at movie_def_impl.cpp:701
#4 0xb7dba3f0 in gnash::MovieLoader::execute (md=0x82809c0) at movie_def_impl.cpp:119
#5 0xb7dc2085 in boost::_bi::list1<boost::_bi::value<gnash::movie_def_impl> >::operator()<void ()(gnash::movie_def_impl*), boost::_bi::list0> (this=0x82ab0a0, f=@0x82ab09c, a=@0xb5ede367)
at /usr/X11R6/include/boost-1_35/boost/bind.hpp:232
#6 0xb7dc20bd in boost::_bi::bind_t<void, void ()(gnash::movie_def_impl), boost::_bi::list1<boost::_bi::value<gnash::movie_def_impl*> > >::operator() (this=0x82ab09c)
at /usr/X11R6/include/boost-1_35/boost/bind/bind_template.hpp:20
#7 0xb7dc20d9 in boost::thread::thread_data<boost::_bi::bind_t<void, void ()(gnash::movie_def_impl), boost::_bi::list1<boost::_bi::value<gnash::movie_def_impl*> > > >::run (this=0x82aafe0)
at /usr/X11R6/include/boost-1_35/boost/thread/pthread/thread.hpp:130
#8 0xb717eb1e in thread_proxy () from /usr/lib/libboost_thread-gcc42-mt-1_35.so.1.35.0
#9 0xb7a65383 in start_thread () from /lib/libpthread.so.0
#10 0xb72be05e in clone () from /lib/libc.so.6

(gdb) break movie_def_impl.cpp:105
Breakpoint 3 at 0xb7db9a3c: file movie_def_impl.cpp, line 105.

(gdb) r
[New Thread 0xb62446d0 (LWP 22919)]
[New Thread 0xb5ec7b90 (LWP 22920)]
[Switching to Thread 0xb5ec7b90 (LWP 22920)]

Breakpoint 3, gnash::MovieLoader::isSelfThread (this=0x8280ba4) at movie_def_impl.cpp:105
105 MovieLoader::isSelfThread() const
(gdb) print _thread
$1 = {_M_ptr = 0x82aafb8}
(gdb) print *_thread
$2 = (boost::thread &) @0x82aafb8: {
thread_info_mutex = {<boost::noncopyable_::noncopyable> = {<No data fields>}, m = {__data = {__lock = 0, _count = 0, __owner = 0, __kind = 0, __nusers = 0, {__spins = 0, __list = {__next = 0x0}}}, __size = '\0' <repeats 23 times>, __align = 0}}, thread_info = {px = 0x82aafe0, pn = {pi = 0x82ab0a8}}}

(gdb) n
107 boost::mutex::scoped_lock lock(_mutex);
109 if (!_thread.get()) {
112 boost::thread this_thread;
113 return this_thread == *_thread;

(gdb) print this_thread
$3 = {thread_info_mutex = {<boost::noncopyable_::noncopyable> = {<No data fields>}, m = {__data = {__lock = 0, _count = 0, __owner = 0, __kind = 0, __nusers = 0, {__spins = 0, __list = {__next = 0x0}}}, __size = '\0' <repeats 23 times>, __align = 0}}, thread_info = {px = 0x0, pn = {pi = 0x0}}}

(gdb) print *_thread
$4 = (boost::thread &) @0x82aafb8: { thread_info_mutex = {<boost::noncopyable_::noncopyable> = {<No data fields>}, m = {__data = {__lock = 0, _count = 0, __owner = 0, __kind = 0, __nusers = 0, {__spins = 0, __list = {__next = 0x0}}}, __size = '\0' <repeats 23 times>, __align = 0}}, thread_info = {px = 0x82aafe0, pn = {pi = 0x82ab0a8}}}
(gdb) print &this_thread
$5 = (boost::thread *) 0xb5ec7198

Program received signal SIGTRAP, Trace/breakpoint trap.
0xb7c98c39 in std::auto_ptr<boost::thread>::get (this=0x8280bc0)
at /usr/lib/gcc/i486-slackware-linux/4.2.3/../../../../include/c++/4.2.3/memory:300
300 get() const throw() { return _M_ptr; }
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function (std::auto_ptr<boost::thread>::get() const) will be abandoned.
(gdb) print this->_M_ptr
$6 = (boost::thread *) 0x82aafb8

Ivan Kalvachev <iive>
Tue 15 Apr 2008 07:56:32 AM UTC, comment #1:

mmm, this is weird.
isSelfThread() checks MovieLoader::_thread to be the same
as the current thread (default constructed boost::thread).

The assertion is there to ensure read_all_swf is called
by the spawned thread.

Maybe this construct is unsafe:

_thread.reset(
new boost::thread(boost::bind(execute, &_movie_def))
);

IFF MovieLoader::execute gets executed before _thread.reset
(which actually makes sense), then isSelfThread would see
_thread as NULL still, and thus return false..

Could you research on that ? print value of _loader._thread.get()
from gdb ?

Sandro Santilli <strk>
Project MemberIn charge of this item.
Mon 14 Apr 2008 04:37:58 PM UTC, original submission:

gtk-gnash: movie_def_impl.cpp:701: void gnash::movie_def_impl::read_all_swf(): Assertion `_loader.isSelfThread()' failed.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb60a6b90 (LWP 25195)]
0xb73bfc66 in raise () from /lib/libc.so.6

(gdb) bt
#0 0xb73bfc66 in raise () from /lib/libc.so.6
#1 0xb73c1571 in abort () from /lib/libc.so.6
#2 0xb73b8e60 in __assert_fail () from /lib/libc.so.6
#3 0xb7e51b64 in gnash::movie_def_impl::read_all_swf () from /usr/lib/gnash/libgnashserver-0.8.2.so
#4 0xb7e51e1d in gnash::MovieLoader::execute () from /usr/lib/gnash/libgnashserver-0.8.2.so
#5 0xb7e52528 in boost::thread::thread_data<boost::_bi::bind_t<void, void ()(gnash::movie_def_impl), boost::_bi::list1<boost::_bi::value<gnash::movie_def_impl*> > > >::run () from /usr/lib/gnash/libgnashserver-0.8.2.so
#6 0xb732bb1e in thread_proxy () from /usr/lib/libboost_thread-gcc42-mt-1_35.so.1.35.0
#7 0xb7c12383 in start_thread () from /lib/libpthread.so.0
#8 0xb746b05e in clone () from /lib/libc.so.6

This happens with any file (including the ones from gnash/testsuite/samples/).

My system is Slackware current - glibc-2.7, gcc-4.2.3, gtk+2-2.12.9
I've compiled boost-1.35.0 and agg-2.5 myself.
I have used the gnash-0.8.2 release for debugging, but the release is quite recent and I don't see any relevant to this bug changes in the CVS. I will try the CVS too if requested.

Ivan Kalvachev <iive>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #15482:  gnash-boost1.35.patch added by strk (820B - text/x-patch)
file #15481:  thread_equality_ver.cpp added by strk (890B - text/x-c++src)
file #15468:  thread_equality.cpp added by strk (766B - text/x-c++src)
file #15467:  waitForThreadAssignment.patch added by strk (3KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bwy (Posted a comment)
  • -unavailable- added by kans (Posted a comment)
  • -unavailable- added by strk (Posted a comment)
  • -unavailable- added by iive (Submitted the item)
  • -unavailable- added by iive ([gnash-bug])
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 15 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 06 Oct 2008 06:53:28 PM UTCstrkStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Wed 01 Oct 2008 05:11:47 PM UTCbwyReleaseNone=>trunk
    Wed 01 Oct 2008 09:01:41 AM UTCstrkStatusFixed=>None
      Open/ClosedClosed=>Open
    Wed 23 Apr 2008 02:29:58 PM UTCstrkStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Sat 19 Apr 2008 04:11:47 PM UTCstrkAttached File-=>Added gnash-boost1.35.patch, #15482
    Sat 19 Apr 2008 03:43:34 PM UTCstrkAttached File-=>Added thread_equality_ver.cpp, #15481
    Thu 17 Apr 2008 10:58:57 AM UTCstrkStatusNone=>Ready For Test
      Assigned toNone=>strk
    Thu 17 Apr 2008 10:46:12 AM UTCstrkAttached File-=>Added thread_equality.cpp, #15468
    Thu 17 Apr 2008 09:52:25 AM UTCstrkAttached File-=>Added waitForThreadAssignment.patch, #15467
    Tue 15 Apr 2008 07:56:32 AM UTCstrkSeverity3 - Normal=>5 - Blocker
    Mon 14 Apr 2008 04:37:58 PM UTCiiveCarbon-Copy-=>Added iive

    Back to the top


    Powered by Savane 3.1-cleanup1