Adrian Smarzewski wrote:
Marcin Król wrote:
A z innej strony: jesteś w stanie mi, albo alecowi podesłać zrzut Twojej bazy? Albo takiego jej wycinka żeby almsd się wywalał? Chyba że sypie się przy pustej...
albo przynajmniej backtrace z wywrotki z symbolami debuggera wkompilowanymi bo chyba wciąż tego nie ma, chyba, że przegapiłem... będę wiedział gdzie się wywala to obejrzę ten fragment i może na to wpadnę... zawsze można wtedy to miejsce obudować też różnymi assert-ami i kombinować dalej.
jest tak
Makefile LIBS = -lmysqlclient -ldl LDFLAGS = -L/usr/local/mysql/lib/mysql/ CFLAGS = -I/usr/local/mysql/include/ -DUSE_MYSQL -DDEBUG0 -DDEBUG1 INSTALLDIR = /usr/local/lms
SOURCES = almsd.c db.c util.c SOURCES += iniparser/iniparser.c iniparser/dictionary.c iniparser/strlib.c OBJECTS = ${SOURCES:.c=.o} OUT = almsd
all: $(OUT) xmodules
xmodules: make -C modules
$(OUT): ${OBJECTS} gcc $(OBJECTS) -o $(OUT) $(LDFLAGS) $(LIBS) -g -ggdb
install: mkdir -p -m 755 $(INSTALLDIR) install -c -m 700 almsd $(INSTALLDIR)/
remove: rm -f $(INSTALLDIR)/almsd
clean: rm -f $(OBJECTS) make -C modules clean
./configure --with-mysql --incdir=/usr/local/mysql/include/ --libdir=/usr/local/mysql/lib/mysql/ --prefix=/usr/local/lms --enable-debug1 --enable-debug0 make make install
./almsd& [1]+ Naruszenie ochrony pamięci ./almsd
tail /var/log/messages Apr 29 10:48:16 dns almsd: A.L.E.C's LMS Daemon started. Apr 29 10:48:16 dns almsd: DEBUG: [lmsd] Connected with params: db='lms' host='localhost' user='lms' port='0' passwd='*' Apr 29 10:48:16 dns almsd: DEBUG: [SQL] SELECT time FROM timestamps WHERE tablename = '_force' Apr 29 10:48:38 dns almsd: A.L.E.C's LMS Daemon started. Apr 29 10:48:38 dns almsd: DEBUG: [lmsd] Connected with params: db='lms' host='localhost' user='lms' port='0' passwd='*' Apr 29 10:48:38 dns almsd: DEBUG: [SQL] SELECT time FROM timestamps WHERE tablename = '_force'
gdb -d=/usr/local/apache/htdocs/lms/daemon/ ./almsd GNU gdb Red Hat Linux (5.3post-0.20021129.18rh) Copyright 2003 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu"... (no debugging symbols found)... (gdb) run Starting program: /usr/local/lms/almsd
Program received signal SIGSEGV, Segmentation fault. 0x4202b0fa in __strtol_internal () from /lib/tls/libc.so.6 (gdb) bt #0 0x4202b0fa in __strtol_internal () from /lib/tls/libc.so.6 #1 0x42028839 in atoi () from /lib/tls/libc.so.6 #2 0x0804944b in strcpy () #3 0x42015574 in __libc_start_main () from /lib/tls/libc.so.6 (gdb) quit
to all baza byla pusta - tylko struktura