Re: Help with some pkgsrc stuff

From:

Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>

Date:

Wed, 29 Apr 2009 10:05:27 -0700 (PDT)

:* Mono applications build mostly now after some bugfixes for both mono and
: DragonFly itself. Applications even run, but die after some seconds of
: work with following backtrace:
:
: Core was generated by `mono'.
: Program terminated with signal 4, Illegal instruction.
: #0 0x28265a8c in symlook_list (name=0x804f74b "waitpid",
: hash=226539140, objlist=0x28286408, defobj_out=0xbf9fe1d0,
: in_plt=1 '\001', dlp=0xbf9fe1d4)
: at /home/hasso/dragonfly-src/libexec/rtld-elf/rtld.c:2412
Upload the core file to leaf, I'll take a look at it to
try to figure out what the illegal instruction is.
:* After applying the attached patch it's possible to compile www/firefox3
: with jemalloc support (would be a good test to compare it with our
: malloc). The problem is that it goes into infinite loop, seems:
:
: Core was generated by `firefox-bin'.
: Program terminated with signal 11, Segmentation fault.
: #0 0x2809af80 in malloc_init_hard () at jemalloc.c:5194
:
: 5194 {
: (gdb) bt
: #0 0x2809af80 in malloc_init_hard () at jemalloc.c:5194
: #1 0x2809c6c1 in malloc (size=224) at jemalloc.c:5183
: #2 0x2809379e in _thr_alloc (curthread=0x0)
: at /home/hasso/dragonfly-src/lib/libthread_xu/thread/thr_list.c:171
: #3 0x2809201c in _libpthread_init (curthread=0x0)
: at /home/hasso/dragonfly-src/lib/libthread_xu/thread/thr_init.c:215
: #4 0x2809167a in __pthread_mutex_lock (m=0x2809ef74)
: at /home/hasso/dragonfly-src/lib/libthread_xu/thread/thr_private.h:791
: #5 0x2809af9e in malloc_init_hard () at jemalloc.c:1254
: #6 0x2809c6c1 in malloc (size=224) at jemalloc.c:5183
: #7 0x2809379e in _thr_alloc (curthread=0x0)
:...
:Any help to track these problems down is welcome.
:
:--
:Hasso Tepper
A pthread/malloc init loop.
There is some additional fragility here, since the mutex itself
probably has to be allocated as well.
Our malloc's use the _SPINLOCK API which allows libthread_xu
to allocate the initial spinlocks needed for bootstrapping malloc
out of a static array. It looks like jemalloc is trying to use
core POSIX mutexes right off the bat.
Someone else will have to dig into the jemalloc code, though, I just
don't have time.
-Matt