AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20080724172354.2e70bbe2@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:onstor-exch02.onstor.net
NSV:
SSH:
R:<larry.scheer@onstor.com>,<maxim.kozlovsky@onstor.com>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/andys@onstor.net@onstor-exch02.onstor.net/INBOX	0	BB375AF679D4A34E9CA8DFA650E2B04E056C9755@onstor-exch02.onstor.net
X-Sylpheed-End-Special-Headers: 1
Date: Thu, 24 Jul 2008 17:24:20 -0700
From: Andrew Sharp <andy.sharp@onstor.com>
To: "Larry Scheer" <larry.scheer@onstor.com>
Cc: Maxim Kozlovsky <maxim.kozlovsky@onstor.com>
Subject: Re: wget trace and testing
Message-ID: <20080724172420.068b9ba6@ripper.onstor.net>
In-Reply-To: <BB375AF679D4A34E9CA8DFA650E2B04E056C9755@onstor-exch02.onstor.net>
References: <BB375AF679D4A34E9CA8DFA650E2B04E056C9755@onstor-exch02.onstor.net>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

The problem is that using dlsym like we do in anpssc.c is not the
correct way to do this with glibc.  Might have been OK with BSD libc, I
don't know.

__malloc_hook should be used instead.  Then we don't have to use -ldl
at all, unless we also need it for something else.  And other things
won't segfault when linked with our libraries.

man __malloc_hook for all the information.

Cheers,

a




On Thu, 24 Jul 2008 16:40:12 -0700 "Larry Scheer"
<larry.scheer@onstor.com> wrote:

> Andy, Rendell,
>       I changed the link of wget to use -lc but at the end of the link
> and I get s seg fault.
> Next, I built wget without using -ldl on the link line and I still get
> the segmentation fault
> 
> Here is a stack trace showing the start of the recursive calls:
> 
> Breakpoint 1, calloc (nmemb=1, sz=16) at malloc-override.c:45
> 45      in malloc-override.c
> (gdb) c
> Continuing.
> 
> Breakpoint 2, 0x2ba963c4 in _dlerror_run () from /lib/libdl.so.2
> (gdb) bt
> #0  0x2ba963c4 in _dlerror_run () from /lib/libdl.so.2
> #1  0x2ba9604c in dlsym () from /lib/libdl.so.2
> #2  0x2ac7aba0 in calloc (nmemb=1, sz=16) at malloc-override.c:46
> #3  0x2ba96488 in _dlerror_run () from /lib/libdl.so.2
> #4  0x2ba9604c in dlsym () from /lib/libdl.so.2
> #5  0x2ac7aba0 in calloc (nmemb=1, sz=16) at malloc-override.c:46
> #6  0x2ba96488 in _dlerror_run () from /lib/libdl.so.2
> #7  0x2ba9604c in dlsym () from /lib/libdl.so.2
> #8  0x2ac7aabc in malloc (sz=21) at malloc-override.c:29
> #9  0x2b5248a0 in set_binding_values () from /lib/libc.so.6
> #10 0x2b524b68 in bindtextdomain () from /lib/libc.so.6
> #11 0x0043e184 in i18n_initialize () at main.c:111
> #12 0x0043ea20 in main (argc=1, argv=0x7ffaed34) at main.c:678
