Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dbx SIGSEGV on Solaris 9 w/ libmalloc.so.1

282 views
Skip to first unread message

Mike Morgan

unread,
Jul 30, 2004, 10:57:23 AM7/30/04
to

Could anyone tell me if this happens on their systems?

When I export LD_PRELOAD=libmalloc.so.1 on Solaris 9 and run dbx, it
crashes.

truss reports:
brk(0x1005DC150) = 0
Incurred fault #6, FLTBOUNDS %pc = 0xFFFFFFFF7F200FC8
siginfo: SIGSEGV SEGV_MAPERR addr=0x00014000
Received signal #11, SIGSEGV [default]
siginfo: SIGSEGV SEGV_MAPERR addr=0x00014000

dbx version:
Forte Developer 7 Dbx Debugger 7.0 Patch 115977-02 2004/04/07
(latest patch 115977-03 crashes as well)

This problem does not appear on Solaris 7 with dbx version:
Sun WorkShop 6 update 2 Dbx Debugger 6.2 Patch 115117-01 2003/12/17

However dbx appears to run fine with any other malloc replacement
library (watchmalloc/bsdmalloc/mtmalloc).

Just want to make sure it's not some configuration issue on my end.

thanks,
Mike Morgan

Seongbae Park

unread,
Jul 30, 2004, 11:17:43 AM7/30/04
to

No, it's not your fault.
This is yet another manifestation of the bug 4846556.
libmalloc doesn't have valloc() and memalign(),
so any program that uses those to allocate a memory
will get SEGV when it frees the memory
because valloc() and memalign() are libc's version
but free() is from libmalloc.
The cpu performance counters library libcpc is used by dbx and collector
and calls one of those two, making dbx and collector
fail with libmalloc.

Anyway, unless you want to do something about dbx itself,
you don't want to LD_PRELOAD something for dbx.
If you want to preload the library for your debugged program,
use LD_PRELOAD inside dbx:

$ dbx ...your program...
(dbx) LD_PRELOAD=...whatever library...
(dbx) run

This makes sure dbx itself does not preload the library
but your target program does.
But whenever you preload a library, dbx will see
multiple symbols with the same name
so you'll have to be careful whenever you do something inside dbx
(dbx will ask you when it can not uniquely resolve the name
but sometimes it can be confusing).

Seongbae

Seongbae Park

unread,
Jul 30, 2004, 11:26:25 AM7/30/04
to

A minor correction below - export was missing.

Seongbae

Seongbae Park <Seongb...@Sun.COM> wrote:
...


> If you want to preload the library for your debugged program,
> use LD_PRELOAD inside dbx:
>
> $ dbx ...your program...
> (dbx) LD_PRELOAD=...whatever library...

(dbx) export LD_PRELOAD

> (dbx) run

Mike Morgan

unread,
Jul 30, 2004, 11:39:48 AM7/30/04
to
Thanks Seongbae!

Makes sense as to why my program had the same behavior.

Roland Mainz

unread,
Jul 31, 2004, 12:25:54 PM7/31/04
to
Seongbae Park wrote:
> > Could anyone tell me if this happens on their systems?
> >
> > When I export LD_PRELOAD=libmalloc.so.1 on Solaris 9 and run dbx, it
> > crashes.
> >
> > truss reports:
> > brk(0x1005DC150) = 0
> > Incurred fault #6, FLTBOUNDS %pc = 0xFFFFFFFF7F200FC8
> > siginfo: SIGSEGV SEGV_MAPERR addr=0x00014000
> > Received signal #11, SIGSEGV [default]
> > siginfo: SIGSEGV SEGV_MAPERR addr=0x00014000
> >
> > dbx version:
> > Forte Developer 7 Dbx Debugger 7.0 Patch 115977-02 2004/04/07
> > (latest patch 115977-03 crashes as well)
> >
> > This problem does not appear on Solaris 7 with dbx version:
> > Sun WorkShop 6 update 2 Dbx Debugger 6.2 Patch 115117-01 2003/12/17
> >
> > However dbx appears to run fine with any other malloc replacement
> > library (watchmalloc/bsdmalloc/mtmalloc).
> >
> > Just want to make sure it's not some configuration issue on my end.
> >
>
> No, it's not your fault.
> This is yet another manifestation of the bug 4846556.
> libmalloc doesn't have valloc() and memalign(),

... same applies to libbsdmalloc, libmapmalloc, libmtmalloc, watchmalloc
etc. which prevents their usage in applications like "mozilla" (which
currently suffers from huge memory fragmentation problems) ... ;-(

----

Bye,
Roland

--
__ . . __
(o.\ \/ /.o) roland...@nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 7950090
(;O/ \/ \O;)

0 new messages