From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,8098a2a367de5753,start X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2001-08-09 06:32:46 PST Path: archiver1.google.com!newsfeed.google.com!postnews1.google.com!not-for-mail From: mayzen@acxiom.co.uk (Mark Ayzenshteyn) Newsgroups: comp.unix.tru64 Subject: drop in replacement of malloc for tru64 issues Date: 9 Aug 2001 06:32:46 -0700 Organization: http://groups.google.com/ Message-ID: <844d60bd.0108090532.23844f03@posting.google.com> NNTP-Posting-Host: 195.153.113.200 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 997363966 7285 127.0.0.1 (9 Aug 2001 13:32:46 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 9 Aug 2001 13:32:46 GMT Xref: archiver1.google.com comp.unix.tru64:4135 Hi all, I am trying to use a drop in replacement for malloc on a Digital Unix 4.0F system. Its a 4 CPU box and the performance of the libc malloc in a multi-threaded enviorment is too slow. So far I have tried libhoard and ptmalloc and both produce the same result. The program crashes trying to initialise a mutex. From the stack trace(see below) it seems the program never gets into my code. Instead when libc is being initialised it tries to allocate some memory using the drop in malloc(ptmalloc in this case). The ptmalloc tries to initialise a mutex and the pthread_mutex_init called crashes. This would imply the DECthreads are not fully initialised at this point. Does anyone have any pointers on how to solve this problem? I am going through the comments in pthread.h and I have a few other ideas, but I thought perhaps someone in this newsgroup has done something similar before and can quickly point me in the right direction. Cheers, Mark Thread terminated at PC 0x3ff8059f704 by signal SEGV (ladebug) tstack Stack trace for thread 3 >0 0x3ff8059f704 in __muGetBlock(0x0, 0x140000ae8, 0x0, 0x11ffff450, 0x0, 0x44) in /usr/shlib/libpthread.so #1 0x3ff8059e190 in __pthread_mutex_init(0x0, 0x140000ae8, 0x0, 0x11ffff450, 0x0, 0x44) in /usr/shlib/libpthread.so #2 0x120002c98 in ptmalloc_init(0x0, 0x140000ae8, 0x0, 0x11ffff450, 0x0, 0x44) in ./threadtest #3 0x120002ef8 in UnknownProcedure3FromFile3(0x0, 0x140000ae8, 0x0, 0x11ffff450, 0x0, 0x44) in ./threadtest #4 0x120003a3c in malloc(0x0, 0x140000ae8, 0x0, 0x11ffff450, 0x0, 0x44) in ./threadtest #5 0x3ff800dbed0 in __exc_add_gp_range(0x0, 0x140000ae8, 0x0, 0x11ffff450, 0x0, 0x44) in /usr/shlib/libc.so #6 0x3ff8010186c in _call_add_gp_range(0x0, 0x140000ae8, 0x0, 0x11ffff450, 0x0, 0x44) in /usr/shlib/libc.so #7 0x3ff801a5be8 in /usr/shlib/libc.so #8 0x3ff80017fc0