bugGnash - The GNU Flash player - Bugs: bug #20016, log_debug() segfaults on exit

 
 

bug #20016: log_debug() segfaults on exit

Submitted by:  Tomas Groth <tgc>
Submitted on:  Thu 31 May 2007 10:31:56 AM UTC  
 
Category: coreSeverity: 4 - Important
Release: NoneStatus: Fixed
Privacy: PublicAssigned to: None
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)

Sat 15 Dec 2007 10:18:26 PM UTC, comment #6:

I guess this was fixed..

Sandro Santilli <strk>
Project Member
Sun 01 Jul 2007 03:36:26 PM UTC, comment #5:

Tom, can you try at reproducing this ?
Current head doesn't call exit() anymore.
The still running threads should either be detached or joined (if a join call is raised in one of the destructors).

Still, the dbglogfile is a static so might be destroied too early.
I guess we might turn the dbglogfile into an explicitly initialized
and explicitly destroyed type to make sure only the main thread - after waiting for all threads to complete - deallocates it.

Sandro Santilli <strk>
Project Member
Fri 01 Jun 2007 11:10:26 AM UTC, comment #4:

Let's not have segfaults on exit block the release.
We'll need to design proper thread exit strategies for this to be fixed.

Sandro Santilli <strk>
Project Member
Thu 31 May 2007 12:22:30 PM UTC, comment #3:

I guess the segfault depends on the wrong use of exit().
I hope actually ... Filed a dependency on this on the new task I opened for it.

Sandro Santilli <strk>
Project Member
Thu 31 May 2007 12:13:16 PM UTC, comment #2:

Mmm.. actually it seems that exit() doesn't call any destructor.
See this test:

#include <iostream>

using namespace std;

struct A {
A() { cout << "A[" << this << "] ctor" << endl; }
~A() { cout << "A[" << this << "] dtor" << endl; }
};

int main()
{
A a;

// comment the exit() out and you'll see the dtor is called
// while with exit() the dtor is NOT called
exit(0);
}

Sandro Santilli <strk>
Project Member
Thu 31 May 2007 12:08:59 PM UTC, comment #1:

Please try the attached patch, locking the mutex in the LogFile destructor (indirectly, actually locking in closeLog).

(file #12911)

Sandro Santilli <strk>
Project Member
Thu 31 May 2007 10:31:56 AM UTC, original submission:

I'm working on NetStream, and in the decoding thread i have a very active log_debug() call, and when i try to quit gnash while the thread is running i get a segfault.

Backtrace:

#0 0x00002b2cbc997665 in raise () from /lib/libc.so.6
#1 0x00002b2cbc99891e in abort () from /lib/libc.so.6
#2 0x00002b2cbc9ccf96 in __libc_message () from /lib/libc.so.6
#3 0x00002b2cbc9d1f3d in malloc_printerr () from /lib/libc.so.6
#4 0x00002b2cbc9d3576 in free () from /lib/libc.so.6
#5 0x00002b2cbc6f7afc in std::string::assign () from /usr/lib/libstdc++.so.6
#6 0x00002b2cbc3cdc9c in gnash::LogFile::operator<< (this=0x2b2cbc529360,
str=0x2b2cbc40a35d "DEBUG") at /home/tomas/gnash/gnash/libbase/log.cpp:598
#7 0x00002b2cbc3cdefb in gnash::LogFile::log (this=0x2b2cbc529360,
label=0x2b2cbc40a35d "DEBUG", msg=0x41886600 "sleeping")
at /home/tomas/gnash/gnash/libbase/log.cpp:336
#8 0x00002b2cbc3ce6d5 in gnash::log_debug (fmt=0x2b2cbc1d0c8b "sleeping")
at /home/tomas/gnash/gnash/libbase/log.cpp:203
#9 0x00002b2cbc148c5f in gnash::NetStreamFfmpeg::av_streamer (ns=0xba0620)
at /home/tomas/gnash/gnash/server/asobj/NetStreamFfmpeg.cpp:654
#10 0x00002b2cbc14b23f in boost::_bi::list1<boost::_bi::value<gnash::NetStreamFfmpeg> >::operator()<void ()(gnash::NetStreamFfmpeg*), boost::_bi::list0> (
this=0x418870b0, f=@0x418870a8, a=@0x41887007)
at /usr/include/boost/bind.hpp:231
#11 0x00002b2cbc14b29f in boost::_bi::bind_t<void, void ()(gnash::NetStreamFfmpeg), boost::_bi::list1<boost::_bi::value<gnash::NetStreamFfmpeg*> > >::operator() (this=0x418870a8) at /usr/include/boost/bind/bind_template.hpp:20
#12 0x00002b2cbc14b2e2 in boost::detail::function::void_function_obj_invoker0<bo---Type <return> to continue, or q <return> to quit---
ost::_bi::bind_t<void, void ()(gnash::NetStreamFfmpeg), boost::_bi::list1<boost::_bi::value<gnash::NetStreamFfmpeg*> > >, void>::invoke (
function_obj_ptr=@0x418870a8)
at /usr/include/boost/function/function_template.hpp:155
#13 0x00002b2cbed225ee in boost::function0<void, std::allocator<boost::function_base> >::operator() () from /usr/lib/libboost_thread-mt.so
#14 0x00002b2cbed222a2 in ?? () from /usr/lib/libboost_thread-mt.so
#15 0x00002b2cbee2c0e5 in start_thread () from /lib/libpthread.so.0
#16 0x00002b2cbca238cd in clone () from /lib/libc.so.6
#17 0x0000000000000000 in ?? ()

Tomas Groth <tgc>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #12911:  log.patch added by strk (926B - text/x-patch)

 

Digest:
   task dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by strk (Updated the item)
  • -unavailable- added by tgc (Submitted the item)
  •  

    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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 15 Dec 2007 10:18:26 PM UTCstrkStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Tue 03 Jul 2007 01:22:15 AM UTCstrkStatusNone=>Ready For Test
    Fri 01 Jun 2007 11:10:26 AM UTCstrkSeverity5 - Blocker=>4 - Important
    Thu 31 May 2007 12:22:30 PM UTCstrkDependencies-=>Depends on task #6959
    Thu 31 May 2007 12:08:59 PM UTCstrkAttached File-=>Added log.patch, #12911

    Back to the top


    Powered by Savane 3.1-cleanup1