The Samba-Bugzilla – Attachment 407 Details for
Bug 1096
AIX malloc broken with 64 bit and -D_LINUX_SOURCE_COMPAT
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Detailed description of malloc failure
samba1.txt (text/plain), 1.12 KB, created by
Heinrich Mislik
on 2004-02-18 03:25:39 UTC
(
hide
)
Description:
Detailed description of malloc failure
Filename:
MIME Type:
Creator:
Heinrich Mislik
Created:
2004-02-18 03:25:39 UTC
Size:
1.12 KB
patch
obsolete
>cc is IBMs "vac.C 5.0.2.6 C for AIX Compiler" on AIX 5.2. > >This is from /usr/include/stdlib.h (_ALL_SOURCE is defined): > >#if defined(_ALL_SOURCE) && defined(_LINUX_SOURCE_COMPAT) >#ifdef _NO_PROTO >extern void *__linux_malloc(); >extern void *__linux_realloc(); >extern void *__linux_calloc(); >extern void *__linux_valloc(); >#else >extern void *__linux_malloc(size_t); >extern void *__linux_realloc(void *, size_t); >extern void *__linux_calloc(size_t, size_t); >extern void *__linux_valloc(size_t); >#endif >#define malloc __linux_malloc >#define calloc __linux_calloc >#define realloc __linux_realloc >#define valloc __linux_valloc >#endif /* _LINUX_SOURCE_COMPAT */ > >I couldn't find anything about __linux_malloc() but the following >documents that it is not suitable for 64 Bit: > ># cat malloc_broken.c >#include <stdlib.h> >main() >{ > char *p = malloc(10); > printf("%p\n",p); > p[0] =0; >} > ># cc -q32 -D_LINUX_SOURCE_COMPAT malloc_broken.c ># ./a.out >200004f8 ># cc -q64 -D_LINUX_SOURCE_COMPAT malloc_broken.c ># ./a.out >100005f0 >Segmentation fault (core dumped) ># cc -q64 malloc_broken.c ># ./a.out >1100005f0 > >The 64-bit Pointer is truncated to 32 bit! >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1096
: 407