today i noticed that sercmd is crashing right at start. gdb does not tell much:
Program terminated with signal 11, Segmentation fault. [New process 15687] #0 0x00000001 in __do_global_dtors_aux () (gdb) where #0 0x00000001 in __do_global_dtors_aux ()
it had worked fine before.
-- juha
On Oct 08, 2009 at 14:11, Juha Heinanen jh@tutpro.com wrote:
today i noticed that sercmd is crashing right at start. gdb does not tell much:
Program terminated with signal 11, Segmentation fault. [New process 15687] #0 0x00000001 in __do_global_dtors_aux () (gdb) where #0 0x00000001 in __do_global_dtors_aux ()
it had worked fine before.
It looks like a linker or a compiler problem (__do_global_dtors_aux is called on exit and should call all the global/libraries destructors).
Did you change the compiler or linker recently?
Coul you try: cd utils/sercmd; make proper ; make and see if it still crashes?
If it crashes, try editing config.mak (in the main dir) and remove -m32 from everywhere it appears (or -m64 if you don't have -m32) and then try again (this is the only change, -m32 is now added automatically on 32 bits).
Could you also send me your compiler version, the output of ldd sercmd and the output of d utils/sercmd; make proper ; make (the gcc command lines)?
Andrei
Andrei Pelinescu-Onciul writes:
It looks like a linker or a compiler problem (__do_global_dtors_aux is called on exit and should call all the global/libraries destructors).
Did you change the compiler or linker recently?
no, same old debian lenny.
Coul you try: cd utils/sercmd; make proper ; make and see if it still crashes?
no, if i build like that, it doesn't crash:
make proper ; make config.mak included config.mak included readline detected (/usr/include/readline/readline.h) command completion enabled config.mak included readline detected (/usr/include/readline/readline.h) command completion enabled gcc -g -O9 -funroll-loops -Wcast-align -m32 -minline-all-stringops -falign-loops -ftree-vectorize -fno-strict-overflow -mtune=athlon64 -Wall -DNAME='"sip-proxy_ctl"' -DVERSION='"0.2"' -DUSE_READLINE -c parse_listen_id.c -o parse_listen_id.o gcc -g -O9 -funroll-loops -Wcast-align -m32 -minline-all-stringops -falign-loops -ftree-vectorize -fno-strict-overflow -mtune=athlon64 -Wall -DNAME='"sip-proxy_ctl"' -DVERSION='"0.2"' -DUSE_READLINE -c sercmd.c -o sercmd.o gcc -m32 -Wl,-O2 -Wl,-E parse_listen_id.o sercmd.o -lresolv -lsctp -lreadline -lncurses -o sip-proxy_ctl jh@taimen:/usr/src/trunk-src/sip-proxy/utils/sercmd$ ls EXAMPLES makecfg.lst parse_listen_id.d README sercmd.o librpath.lst Makefile parse_listen_id.h sercmd.c sip-proxy_ctl* license.h parse_listen_id.c parse_listen_id.o sercmd.d TODO jh@taimen:/usr/src/trunk-src/sip-proxy/utils/sercmd$ root root@taimen:/usr/src/trunk-src/sip-proxy/utils/sercmd# ./sip-proxy_ctl sip-proxy_ctl 0.2 Copyright 2006 iptelorg GmbH This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. sip-proxy_ctl> quit
If it crashes, try editing config.mak (in the main dir) and remove -m32 from everywhere it appears (or -m64 if you don't have -m32) and then try again (this is the only change, -m32 is now added automatically on 32 bits).
Could you also send me your compiler version, the output of ldd sercmd and the output of d utils/sercmd; make proper ; make (the gcc command lines)?
but it still crashes when i build debian package that includes sercmd (renamed to sip-proxy_ctl). compilation then goes like this:
make[3]: Entering directory `/usr/trunk-src/src/sip-proxy/utils/sercmd' gcc -fPIC -DPIC -g -O2 -DNAME='"sip-proxy_ctl"' -DVERSION='"0.2"' -DUSE_READLINE -c parse_listen_id.c -o parse_listen_id.o gcc -fPIC -DPIC -g -O2 -DNAME='"sip-proxy_ctl"' -DVERSION='"0.2"' -DUSE_READLINE -c sercmd.c -o sercmd.o gcc -shared -m32 -Wl,-O2 -Wl,-E parse_listen_id.o sercmd.o -lreadline -lncurses -o sip-proxy_ctl
as you see, there is quite a lot of differences in gcc params. why is that? in my debian/rules i have this kind of compilation command:
$(MAKE) cfg CC=$(CC) CFLAGS="$(CFLAGS)" MAIN_NAME=$(MAIN_NAME) basedir=$(BASEDIR) prefix=/usr cfg_prefix=$(BASEDIR) cfg_target=/etc/sip-proxy/ modules="$(MODULES)" modules_s="$(MODULES_S)" modules_k="$(MODULES_K)"
and each time when i build debian package, sip-router source is copied fresh from git source.
-- juha
andrei,
i made some more tests.
sercmd linked during debian package build crashes:
gcc -shared -m32 -Wl,-O2 -Wl,-E parse_listen_id.o sercmd.o -lreadline -lncurses -o sip-proxy_ctl ./sip-proxy_ctl Segmentation fault
if i link it again in the same dir without any gcc params, it works fine:
gcc parse_listen_id.o sercmd.o -lreadline -lncurses -o sip-proxy_ctl ./sip-proxy_ctl sip-proxy_ctl 0.2 Copyright 2006 iptelorg GmbH This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. sip-proxy_ctl> quit
obviously something is wrong with the linkage params used by debian build. i don't know where it gets them. the commands i have in debian/rules are
$(MAKE) cfg CC=$(CC) CFLAGS="$(CFLAGS)" KMSTATS=$(KMSTATS) MAIN_NAME=$(MAIN_NAME) basedir=$(BASEDIR) prefix=/usr cfg_prefix=$(BASEDIR) cfg_target=/etc/sip-proxy/ modules="$(MODULES)" modules_s="$(MODULES_S)" modules_k="$(MODULES_K)" $(MAKE) all
and i haven't defined $(CFLAGS) in rules file.
-- juha
On Oct 08, 2009 at 17:04, Juha Heinanen jh@tutpro.com wrote:
andrei,
i made some more tests.
sercmd linked during debian package build crashes:
gcc -shared -m32 -Wl,-O2 -Wl,-E parse_listen_id.o sercmd.o -lreadline -lncurses -o sip-proxy_ctl ./sip-proxy_ctl Segmentation fault
if i link it again in the same dir without any gcc params, it works fine:
gcc parse_listen_id.o sercmd.o -lreadline -lncurses -o sip-proxy_ctl ./sip-proxy_ctl sip-proxy_ctl 0.2 Copyright 2006 iptelorg GmbH This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. sip-proxy_ctl> quit
obviously something is wrong with the linkage params used by debian build. i don't know where it gets them. the commands i have in debian/rules are
No, it's not the debian build, it's from the install tools by the module that need it change I introduced last week. When doing make install for the ctl modules, sercmd will be compiled and installed (if not already compiled). The problem is the compile and link flags are inherited from the module and so sercmd is built as a module instead of a normal executable. It happens during the debian build, because make proper is used (it will happen for any make proper; make install).
I'll try to come up with a fix.
Andrei
On Oct 08, 2009 at 16:28, Andrei Pelinescu-Onciul andrei@iptel.org wrote:
On Oct 08, 2009 at 17:04, Juha Heinanen jh@tutpro.com wrote:
andrei,
i made some more tests.
sercmd linked during debian package build crashes:
gcc -shared -m32 -Wl,-O2 -Wl,-E parse_listen_id.o sercmd.o -lreadline -lncurses -o sip-proxy_ctl ./sip-proxy_ctl Segmentation fault
if i link it again in the same dir without any gcc params, it works fine:
gcc parse_listen_id.o sercmd.o -lreadline -lncurses -o sip-proxy_ctl ./sip-proxy_ctl sip-proxy_ctl 0.2 Copyright 2006 iptelorg GmbH This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. sip-proxy_ctl> quit
obviously something is wrong with the linkage params used by debian build. i don't know where it gets them. the commands i have in debian/rules are
No, it's not the debian build, it's from the install tools by the module that need it change I introduced last week. When doing make install for the ctl modules, sercmd will be compiled and installed (if not already compiled). The problem is the compile and link flags are inherited from the module and so sercmd is built as a module instead of a normal executable. It happens during the debian build, because make proper is used (it will happen for any make proper; make install).
I'll try to come up with a fix.
Should be fixed now.
Andrei