|
From: | BERTRAND Joel |
Subject: | Re: [MacOS X] ncurses 5.7 and ptmalloc3 |
Date: | Mon, 10 May 2010 18:58:00 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; fr; rv:1.9.1.9) Gecko/20100402 Iceape/2.0.4 |
Thomas Dickey a écrit :
On Sat, 8 May 2010, Joel Bertrand wrote:Hello, I have found a bug in ncurses 5.7 that only occurs on MacOS X (10.5.6 x86) when ncurses is linked with ptmalloc3. For some reasons I have to use ptmalloc3 in a portable program that run fine on several Unix (NetBSD, FreeBSD, Solaris, Linux) and crashes on MacOS X. I have bissected to find a minimal example that reproduces the bug:From the traceback, it seems to be related to the hashed-database option,which normally is not used on the other platforms (though it can be). I'll take a look to see if I can reproduce this (thanks).
I think I have found... On MacOS X strdup is statically linked against malloc(). If you try to use another allocator, you have to use your own strdup(). For example, with ptmalloc3, it could be :
char * strdup(const char *s) { char * res = public_mALLOc(strlen(s)+1); if (res) strcpy(res, s); return res; } and ncurses runs fine with ptmalloc. Regards, JKB
[Prev in Thread] | Current Thread | [Next in Thread] |