[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: SIGSEGV in pthread_mutex_lock?



On Mon, Jun 14, 2004 at 08:43:50PM +0200, Marcin Owsiany wrote:
> On Wed, Jun 09, 2004 at 04:32:08PM +0100, Andrew Suffield wrote:
> > On Wed, Jun 09, 2004 at 01:59:50PM +0200, Marcin Owsiany wrote:
> > > Basically this is a cry for help with bug 252170, filed against
> > > xmms-xf86audio. I think the bug is not in this package, just that
> > > installing this package exposes some bug in X libraries, libpthread, or
> > > maybe xmms?
> > > 
> > > If you have experience with either X, threads or maybe
> > > xmms debugging please read
> > > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=252170
> > 
> > I'd be looking for memory corruption earlier on. You probably want to
> > concentrate on duplicating the problem; it's probably triggered by a
> > specific set of package versions, plugins loaded, and xmms
> > configuration.
> 
> OK, now I am able to reproduce the problem. Please see the bug for more
> info.

(Was wrong, but I managed to reproduce it anyway; you must load
xmms-xf86audio once, then load xmms-osd-plugin, then load
xmms-xf86audio again)

> However the stack trace seems to be garbage anyway, even with -dbg
> versions of libraries loaded. I guess I need to find a moment before
> which the stack is still OK, but I have no idea how to debug
> multithreaded programs.

Damn lot of work, and a good understanding of pthreads.

> Still needing help,

It's not your bug. This bug lies somewhere between libX11, for
providing such a totally stupid interface, and xmms-osd-plugin, for
abusing it.

xmms-osd-plugin calls XInitThreads().

xmms-xf86audio does stuff with libX11.

You may not call XInitThreads() once you've done anything else with
libX11 in a given program image:

DESCRIPTION
       The XInitThreads function initializes Xlib support for concurrent threads.  This func-
       tion must be the first Xlib function a multi-threaded program calls, and it must com-
       plete before any other Xlib call is made.

If you ignore this restriction, then the program will crash hard the
next time libX11 crosses any piece of code with mutexes (most of it) -
which is what you're seeing. libX11 should really return failure to
XInitThreads() in this case, but it doesn't.

-- 
  .''`.  ** Debian GNU/Linux ** | Andrew Suffield
 : :' :  http://www.debian.org/ |
 `. `'                          |
   `-             -><-          |

Attachment: signature.asc
Description: Digital signature


Reply to: