Samuel Thibault wrote:
zhengda, le Sat 09 Aug 2008 13:59:19 +0200, a écrit :
if (name)
free (name);
No need for an if here, free(NULL); is void already.
OK
When I build the glibc, I got the error as follow:
CPP='gcc-4.2 -E -x c-header'
/root/storage/glibc-2.7/build-tree/hurd-i386-libc/elf/ld.so.1
--library-path
/root/storage/glibc-2.7/build-tree/hurd-i386-libc:/root/storage/glibc-2.7/build-tree/hurd-i386-libc/math:/root/storage/glibc-2.7/build-tree/hurd-i386-libc/elf:/root/storage/glibc-2.7/build-tree/hurd-i386-libc/dlfcn:/root/storage/glibc-2.7/build-tree/hurd-i386-libc/nss:/root/storage/glibc-2.7/build-tree/hurd-i386-libc/nis:/root/storage/glibc-2.7/build-tree/hurd-i386-libc/rt:/root/storage/glibc-2.7/build-tree/hurd-i386-libc/resolv:/root/storage/glibc-2.7/build-tree/hurd-i386-libc/crypt:/root/storage/glibc-2.7/build-tree/hurd-i386-libc/mach:/root/storage/glibc-2.7/build-tree/hurd-i386-libc/hurd:/X11R6/lib
/root/storage/glibc-2.7/build-tree/hurd-i386-libc/sunrpc/rpcgen -Y
../scripts -c rpcsvc/bootparam_prot.x -o
/root/storage/glibc-2.7/build-tree/hurd-i386-libc/sunrpc/xbootparam_prot.T
rpcgen: hurdmalloc.c:287: _hurd_free: Assertion `((h)->check) ==
0x8a3c743e' failed.
make[2]: ***
[/root/storage/glibc-2.7/build-tree/hurd-i386-libc/sunrpc/xbootparam_prot.stmp]
Aborted
make[2]: Leaving directory
`/root/storage/glibc-2.7/build-tree/glibc-2.7/sunrpc'
make[1]: *** [sunrpc/others] Error 2
make[1]: Leaving directory `/root/storage/glibc-2.7/build-tree/glibc-2.7'
make: *** [all] Error 2
I don't understand what the error means
The problem may not be directly in your code. You should run the test
by hand in gdb, something like:
LD_LIBRARY_PATH=/root/storage/glibc-2.7/build-tree/hurd-i386-libc gdb --args
/root/storage/glibc-2.7/build-tree/hurd-i386-libc/sunrpc/rpcgen -Y ../scripts
-c rpcsvc/bootparam_prot.x -o
/root/storage/glibc-2.7/build-tree/hurd-i386-libc/sunrpc/xbootparam_prot.T
to get a backtrace.
I tried it. but I couldn't even start gdb. I got the same error when I
ran gdb.
gdb: hurdmalloc.c:287: _hurd_free: Assertion `((h)->check) ==
0x8a3c743e' failed.
Aborted
If I run gdb with the default glibc in my system,
gdb --args /root/storage/glibc-2.7/build-tree/hurd-i386-libc/sunrpc/rpcgen -Y
../scripts -c rpcsvc/bootparam_prot.x -o
/root/storage/glibc-2.7/build-tree/hurd-i386-libc/sunrpc/xbootparam_prot.T
(gdb) run
Starting program:
/root/storage/glibc-2.7/build-tree/hurd-i386-libc/sunrpc/rpcgen -Y
../scripts/ -c rpcsvc/bootparam_prot.x -o
/root/storage/glibc-2.7/build-tree/hurd-i386-libc/sunrpc/xbootparam_prot.T
../scripts//cpp: line 6: exec: -C: invalid option
exec: usage: exec [-cl] [-a name] file [redirection ...]
/root/storage/glibc-2.7/build-tree/hurd-i386-libc/sunrpc/rpcgen: C
preprocessor failed with exit code 2
Program exited with code 01.
I don't get anything useful.
Best,
Zheng Da