Debian Codegraph @

contrib/aix_notes

raw
1 From: Martin Krumpolec
2 Sent: Tuesday, June 23, 1998 1:11 PM
3 Subject: RE: dmalloc - bug report ?
4
5 > The problem seems to be that certain libc calls which allocate
6 > memory (strdup for instance) somehow bypass the malloc() call and do
7 > their own allocations. This confuses dmalloc when the free is called.
8
9 Hello,
10
11 I have observed this problem is regarding not only strdup but several
12 other libc (AIX 4.2) routines allocating memory: scandir, strdup,
13 tempnam, ... When I played a bit, I have found neat idea in the man
14 pages - they adviced to add flags:
15
16 -bnso -bI:/lib/syscalls.exp
17
18 to linker options in AIX ... Voila, it suddenly works :)
19
20 Martin
21
22
23 > -----Original Message-----
24 >
25 >
26 > > k> s.p = (char *) strdup("blah");
27 > > k> free((void *) s.p);
28 >
29 > > Huh? No a bug with libdmalloc I don't think. Looks to me
30 > that strdup
31 > > is not calling malloc at all. See the 1: before the free
32 > error in the
33 > > logfile? This indicates that it is the first time that the library
34 > > has been called. This is very strange. Strdup should not be using
35 > > its own allocator but who knows.
36 >
37 > It seems you are right. I have replaced strdup with malloc
38 > and it went ok ... On my Linux box it works with strdup, so
39 > conclusion is the AIX's libc has weird implementation of strdup
40 > (man page says it uses malloc, but it evidently lies)