| View previous topic :: View next topic |
| Author |
Message |
spiralvoice Sage
Joined: 06 Jan 2003 Posts: 3982 Location: Germany
|
|
| Back to top |
|
 |
ygrek professional

Joined: 20 Mar 2010 Posts: 521
|
Posted: Sun Aug 15, 2010 4:47 pm Post subject: |
|
|
Another attempt: ./configure --enable-debug, set OCAMLOPT flags to -g -inline 0 and CFLAGS to -ggdb -O0, make.
If this doesn't work - one more arcane option suggested by bsd user - recompiling ocaml itself with -ggdb -O0 (after configure edit config/Makefile and append this options to NATIVECC), then use that ocaml to compile mldonkey. Not sure whether this will help, but without getting meaningful backtrace it is hard to continue. |
|
| Back to top |
|
 |
somedamnthing neophyte
Joined: 31 Jul 2010 Posts: 22
|
Posted: Mon Aug 16, 2010 8:38 am Post subject: |
|
|
| ygrek wrote: | Another attempt: ./configure --enable-debug, set OCAMLOPT flags to -g -inline 0 and CFLAGS to -ggdb -O0, make.
If this doesn't work - one more arcane option suggested by bsd user - recompiling ocaml itself with -ggdb -O0 (after configure edit config/Makefile and append this options to NATIVECC), then use that ocaml to compile mldonkey. Not sure whether this will help, but without getting meaningful backtrace it is hard to continue. |
Check the link again. If that's not what you're looking for, I'll recompile ocaml. |
|
| Back to top |
|
 |
ygrek professional

Joined: 20 Mar 2010 Posts: 521
|
Posted: Mon Aug 16, 2010 9:50 am Post subject: |
|
|
Nope :(
Before recompiling try the following on the gdb prompt :
| Code: |
thread apply all x/100a $esp
|
sometimes it shows more info then bt.
Also show the full output of gdb (don't omit messages during attach, about reading symbols and so on).
Also show the configs used for build (config/Makefile.config for mldonkey). |
|
| Back to top |
|
 |
somedamnthing neophyte
Joined: 31 Jul 2010 Posts: 22
|
Posted: Mon Aug 16, 2010 4:26 pm Post subject: |
|
|
Makefile:
| Code: | less Makefile.config
LIBS=-lcharset -lz /usr/local/lib/libiconv.so -Wl,-rpath -Wl,/usr/local/lib
CFLAGS=-ggdb -O0
CPPFLAGS= -I/usr/local/include -I/usr/local/include -I/usr/local/include
CXXFLAGS=-O2 -fno-strict-aliasing -pipe
LDFLAGS= -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib
CC=cc
CPP=cc -E
CXX=c++
FIX_BROKEN_CPP=
CONFIG_INCLUDES=
OCAMLC=/usr/local/bin/ocamlc.opt -g
OCAMLLIB=/usr/local/lib/ocaml
OCAMLOPT=ocamlopt.opt -g -inline 0 -inline 10
OCAMLLEX=ocamllex.opt
OCAMLDEP=ocamldep
OCAMLDEP_OPTIONS=
OCAMLYACC=ocamlyacc
CAMLP4=/usr/local/bin/camlp4
OCAMLDOC=ocamldoc
OCAMLMKTOP=ocamlmktop
LABLGL_CMA=
LABLGL_CMXA=
MORE_TARGETS=
MORE_SUBDIRS=
MD4ARCH=i386
MD4COMP=as
OPENNAP=no
DIRECT_CONNECT=yes
GNUTELLA=no
GNUTELLA2=no
BITTORRENT=no
DONKEY=no
DONKEY_SUI=no
CRYPTOPPFLAGS=
DONKEY_SERVER=
SOULSEEK=no
OPENFT=no
FASTTRACK=no
FILETP=no
GUI=no
ARCH=i386
SYSTEM=freebsd
REQUIRED_OCAML=3
REQUIRED_LABLGTK=1.2.7
GLIBC_VERSION=
ICONV=yes
BZIP2=yes
MAGIC=yes
GD=yes
GD_JPG=yes
GD_PNG=yes
GD_LIBS=-lgd
GD_STATIC_LIBS=
GD_CFLAGS=-I/usr/local/include
GD_LDFLAGS=-L/usr/local/lib -L/usr/local/lib
COMPRESS=bzip2
COMPRESS_EXT=bz2
PTHREAD_LIBS=-pthread
PTHREAD_CFLAGS=-D_REENTRANT
CURRENT_VERSION=3.0.3
OS_FILES=unix
OS_FILES2=unix
TARGET_TYPE=opt
RPMBUILD=
CONFIGURE_ARGUMENTS= '--enable-ocamlver=3' '--with-libiconv-prefix=/usr/local' '--enable-debug' '--disable-donkey' '--disable-opennap' '--disable-donkeysui' '--disable-soulseek' '--disable-openft' '--disable-bittorrent' '--disable-filetp' '--disable-gnutella' '--disable-gnutella2' '--disable-fasttrack' '--disable-gui' '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' '--build=i386-portbld-freebsd7.3' 'build_alias=i386-portbld-freebsd7.3' 'CC=cc' 'CFLAGS=-O2 -fno-strict-aliasing -pipe' 'LDFLAGS= -L/usr/local/lib -L/usr/local/lib' 'CPPFLAGS= -I/usr/local/include -I/usr/local/include' 'CXX=c++' 'CXXFLAGS=-O2 -fno-strict-aliasing -pipe'
CONFIGURE_RUN=yes
prefix=/usr/local
GTKCFLAGS=
GTKLLIBS=
GTKLFLAGS= |
gdb (whole thing)
| Code: | GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 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-marcel-freebsd"...(no debugging symbols found)...
Attaching to program: /usr/local/bin/mlnet-real, process 7733
Reading symbols from /usr/local/lib/libcharset.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libcharset.so.1
Reading symbols from /lib/libz.so.4...(no debugging symbols found)...done.
Loaded symbols for /lib/libz.so.4
Reading symbols from /usr/local/lib/libiconv.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libiconv.so.3
Reading symbols from /usr/lib/libbz2.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libbz2.so.3
Reading symbols from /usr/local/lib/libgd.so.4...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libgd.so.4
Reading symbols from /usr/lib/libmagic.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libmagic.so.3
Reading symbols from /lib/libm.so.5...(no debugging symbols found)...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /lib/libthr.so.3...(no debugging symbols found)...done.
[New Thread 0x28601150 (LWP 100176)]
[New Thread 0x28601040 (LWP 100053)]
Loaded symbols for /lib/libthr.so.3
Reading symbols from /lib/libc.so.7...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /usr/local/lib/libpng.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libpng.so.6
Reading symbols from /usr/local/lib/libjpeg.so.11...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libjpeg.so.11
Reading symbols from /usr/local/lib/libfreetype.so.9...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libfreetype.so.9
Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols found)...done.
Loaded symbols for /libexec/ld-elf.so.1
[Switching to Thread 0x28601150 (LWP 100176)]
0x28406217 in __error () from /lib/libthr.so.3
(gdb) thread apply all x/100a $esp
Thread 2 (Thread 0x28601040 (LWP 100053)):
0xbfbfea40: 0x823a97c <tan> 0x28dea5a4 0x28dea5a4 0x10
0xbfbfea50: 0x0 0x1 0xbfbfeb74 0x29600ff0
0xbfbfea60: 0x297c4000 0x286a3b5c 0x0 0x28e437dc
0xbfbfea70: 0x0 0x822e8c0 <tan> 0x29600ff0 0x29600ff0
0xbfbfea80: 0x28d7fff0 0x297c4000 0x297c4000 0x11204
0xbfbfea90: 0x302bc 0x1 0x302bc 0xbfbfeafc
0xbfbfeaa0: 0x822e895 <tan> 0x2 0x823dbfb <_fini> 0x0
0xbfbfeab0: 0x822c656 <tan> 0x0 0x412e8480 0x0
0xbfbfeac0: 0x0 0xbd 0x0 0x50705bee
0xbfbfead0: 0x3fa51662 0xa0e2 0x0 0x302bc
0xbfbfeae0: 0x127f0c7f 0x2 0x823e267 <_fini> 0x0
0xbfbfeaf0: 0x8903 0x1 0x11200 0xbfbfeb0c
0xbfbfeb00: 0x822ece2 <tan> 0x0 0x0 0xbfbfeb3c
0xbfbfeb10: 0x822ed3a <tan> 0x4481 0x0 0x1
0xbfbfeb20: 0x1 0xbfbfeb44 0xbfbfeb68 0x821c409 <tan>
0xbfbfeb30: 0x4481 0x1 0x4481 0xbfbfeb5c
0xbfbfeb40: 0x822f9ad <tan> 0x28e325d8 0xfc 0xbfbfeaa0
0xbfbfeb50: 0x3 0x1 0x1 0xbfbfeaa0
0xbfbfeb60: 0x81e77f2 <tan> 0x11200 0x223ff 0x28e437e0
0xbfbfeb70: 0x3 0x28e325d0 0x81b0049 <tan> 0xbfbfeba8
0xbfbfeb80: 0x81affa2 <tan> 0x223ff 0xf5611 0x28679c74
---Type <return> to continue, or q <return> to quit---
0xbfbfeb90: 0x28e80004 0x28e325bc 0x837f4c4 <__progname> 0x28626fec
0xbfbfeba0: 0x28e325b4 0x80ab9a2 <tan> 0xbfbfebcc 0x80ab930 <tan>
0xbfbfebb0: 0x28e32584 0x29b0b4f4 0x29746ffc 0x80abeac <tan>
0xbfbfebc0: 0x28f316e0 0x80c41c1 <tan> 0x81b92b7 <tan>0xbfbfebe4
Thread 1 (Thread 0x28601150 (LWP 100176)):
0xbf9feeac: 0x28405df8 <__error> 0x286da320 0x8 0x1
0xbf9feebc: 0x286da300 0xbf9fef3c 0x83df684 <__stderrp> 0x0
0xbf9feecc: 0x2840474f <pthread_setcancelstate> 0x286da300 0x28601150
0xbf9fef58
0xbf9feedc: 0x28403fed <pthread_cond_signal> 0x286da320 0x286da300
0xbf9fef3c
0xbf9feeec: 0x1 0x28269134 <_rtld_thread_init> 0xbf9fef34 0x28243508 <dladdr>
0xbf9feefc: 0x2826dc44 <_rtld_thread_init> 0x1 0xbf9fef24 0xbf9fef84
0xbf9fef0c: 0x83df688 <__stderrp> 0x83df684 <__stderrp> 0xbf9fef3c 0x0
---Type <return> to continue, or q <return> to quit---
0xbf9fef1c: 0x28275200 0x0 0x28403d70 <pthread_cond_init> 0xbf9fef30
0xbf9fef2c: 0x0 0x83df688 <__stderrp> 0x83df684 <__stderrp> 0x0
0xbf9fef3c: 0x9 0x3b9ab7aa 0x4c696599 0x28861c3e
0xbf9fef4c: 0x83bc2c0 <caml_ba_element_size> 0x28601150 0x28601154
0xbf9fef98
0xbf9fef5c: 0x8222e79 <tan> 0x1 0x83df688 <__stderrp> 0xbf9fef84
0xbf9fef6c: 0x0 0x0 0xffffffff 0xffffffff
0xbf9fef7c: 0xffffffff 0xffffffff 0x4c6965a3 0x288609e8
0xbf9fef8c: 0x4c696599 0xa5fc1 0x28407bcc <_thread_list> 0xbf9fefe8
0xbf9fef9c: 0x283fb73f <pthread_getprio> 0x0 0x0 0x0
0xbf9fefac: 0x0 0x0 0x0 0x0
0xbf9fefbc: 0x0 0x0 0x0 0x0
0xbf9fefcc: 0x0 0x0 0x0 0x0
0xbf9fefdc: 0x28407bcc <_thread_list> 0x83df680 <__stderrp> 0x0 0x0
0xbf9fefec: 0x0 0x28601150 0x0 0x0
0xbf9feffc: 0x0 Error accessing memory address 0xbf9ff000: Bad address.
(gdb) |
|
|
| Back to top |
|
 |
ygrek professional

Joined: 20 Mar 2010 Posts: 521
|
Posted: Tue Aug 17, 2010 7:30 am Post subject: |
|
|
The saga continues :)
| Quote: |
This GDB was configured as "i386-marcel-freebsd"...(no debugging symbols found)...
Attaching to program: /usr/local/bin/mlnet-real, process 7733
|
GDB still can't find the debugging info.. By any chance, did you strip the binary? If so - don't.
config looks correct except that OCAMLOPT should be ocamlopt.opt -g -inline 0
Also, if possible - install the debugging symbols for libc and libthr (don't know how to achieve this on bsd).
PS At least by results of this thread I will fill the wiki page on how to properly debug mldonkey :) |
|
| Back to top |
|
 |
somedamnthing neophyte
Joined: 31 Jul 2010 Posts: 22
|
Posted: Tue Aug 17, 2010 9:41 pm Post subject: |
|
|
Turns out the SOP on FreeBSD binaries is "strip the hell out of them", so I remade, found the non-stripped binary, and boy oh boy:
gdb preamble:
| Code: |
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 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-marcel-freebsd"...
Attaching to program: /usr/local/bin/mlnet-real, process 67124
Reading symbols from /usr/local/lib/libcharset.so.1...done.
Loaded symbols for /usr/local/lib/libcharset.so.1
Reading symbols from /lib/libz.so.4...done.
Loaded symbols for /lib/libz.so.4
Reading symbols from /usr/local/lib/libiconv.so.3...done.
Loaded symbols for /usr/local/lib/libiconv.so.3
Reading symbols from /usr/lib/libbz2.so.3...done.
Loaded symbols for /usr/lib/libbz2.so.3
Reading symbols from /usr/local/lib/libgd.so.4...done.
Loaded symbols for /usr/local/lib/libgd.so.4
Reading symbols from /usr/lib/libmagic.so.3...done.
Loaded symbols for /usr/lib/libmagic.so.3
Reading symbols from /lib/libm.so.5...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /lib/libthr.so.3...done.
[New Thread 0x28601150 (LWP 100157)]
[New Thread 0x28601040 (LWP 100210)]
Loaded symbols for /lib/libthr.so.3
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /usr/local/lib/libpng.so.6...done.
Loaded symbols for /usr/local/lib/libpng.so.6
Reading symbols from /usr/local/lib/libjpeg.so.11...done.
Loaded symbols for /usr/local/lib/libjpeg.so.11
Reading symbols from /usr/local/lib/libfreetype.so.9...done.
Loaded symbols for /usr/local/lib/libfreetype.so.9
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
[Switching to Thread 0x28601150 (LWP 100157)]
0x283b3217 in __error () from /lib/libthr.so.3
(gdb) |
YAY!
thread apply all x/100a $esp
| Code: | (gdb) thread apply all x/100a $esp
Thread 2 (Thread 0x28601040 (LWP 100210)):
0xbfbfea64: 0x40 0x81eb2cf <posix_signals> 0xa 0x28605728
0xbfbfea74: 0x7d5b 0x2 0xbfbfea9c 0x81d9e5e <caml_iterate_global_roots>
0xbfbfea84: 0x28630664 0x286b60a0 0x290814d8 0x25c52
0xbfbfea94: 0x0 0x25c52 0xbfbfeafc 0x81dbf2a <caml_major_collection_slice>
0xbfbfeaa4: 0x40 0x81eb35e <posix_signals> 0x25c52 0x81d9de6 <caml_oldify_local_roots>
0xbfbfeab4: 0x0 0x412e8480 0x0 0x0
0xbfbfeac4: 0xbd 0x0 0x1920fb4a 0x3f994f50
0xbfbfead4: 0x608c 0x0 0x25c52 0x127f0c7f
0xbfbfeae4: 0x2 0x81eb9e7 <posix_signals> 0x0 0x80ea
0xbfbfeaf4: 0x1 0x101ce 0xbfbfeb0c 0x81dc472 <caml_minor_collection>
0xbfbfeb04: 0x0 0x0 0xbfbfeb3c 0x81dc4ca <caml_check_urgent_gc>
0xbfbfeb14: 0x4074 0x0 0x1 0x1
0xbfbfeb24: 0xbfbfeb44 0xbfbfeb68 0x81c9b99 <ml_convert_string> 0x4074
0xbfbfeb34: 0x1 0x4074 0xbfbfeb5c 0x81dd13d <caml_alloc_string>
0xbfbfeb44: 0x294f0330 0xfc 0x81dc943 <caml_modify> 0x3
0xbfbfeb54: 0x1 0x1 0xbfbfeaa0 0x8194f82 <camlPervasives__>
0xbfbfeb64: 0x101ce 0x2039b 0x29500504 0x3
0xbfbfeb74: 0x294f0328 0x8166c99 <camlCharset__slow_encode_from_utf8_898> 0xbfbfeba8 0x8166c08 <camlCharset__slow_encode_from_utf8_898>
0xbfbfeb84: 0x2039b 0xf5679 0x2867f1f0 0x2923c138
0xbfbfeb94: 0x2923c124 0x830d5b8 <camlCharset__498> 0x28626fec 0x2923c11c
0xbfbfeba4: 0x8097ee1 <camlDcShared__string_to_che3_to_file_1340> 0xbfbfebcc 0x8097e8c <camlDcShared__string_to_che3_to_file_1340> 0x2923c0ec
0xbfbfebb4: 0x1 0x2944913c 0x80981c7 <camlDcShared__create_filelist_1372> 0x295417dc
---Type <return> to continue, or q <return> to quit---
0xbfbfebc4: 0x80ab201 <camlDcMain__do_once_after_start_983> 0x816eab7 <camlBasicSocket__exec_timers_567> 0xbfbfebe4 0x816ea90 <camlBasicSocket__exec_timers_567>
0xbfbfebd4: 0x29030b04 0x816e786 <camlBasicSocket__exec_hooks_559> 0x1 0x816eba9 <camlBasicSocket__loop_570>
0xbfbfebe4: 0xbfbfec08 0x816eaf7 <camlBasicSocket__loop_570> 0x2860984c 0x8199d5d <camlList__iter_102>
Thread 1 (Thread 0x28601150 (LWP 100157)):
0xbf9feeac: 0x283b2df8 <__error> 0x286da320 0x8 0x1
0xbf9feebc: 0x286da300 0xbf9fef3c 0x836a5c4 <cond> 0x0
0xbf9feecc: 0x283b174f <pthread_setcancelstate> 0x286da300 0x28601150 0xbf9fef58
0xbf9feedc: 0x283b0fed <pthread_cond_signal> 0x286da320 0x286da300 0xbf9fef3c
0xbf9feeec: 0x1 0x28216134 <_rtld_thread_init> 0xbf9fef34 0x281f0508 <dladdr>
0xbf9feefc: 0x2821ac44 <_rtld_thread_init> 0x1 0xbf9fef24 0xbf9fef84
0xbf9fef0c: 0x836a5c8 <mutex> 0x836a5c4 <cond> 0xbf9fef3c 0x0
0xbf9fef1c: 0x28222200 0x0 0x283b0d70 <pthread_cond_init> 0xbf9fef30
0xbf9fef2c: 0x0 0x836a5c8 <mutex> 0x836a5c4 <cond> 0x0
0xbf9fef3c: 0x9 0x3b9ab62c 0x4c6aff29 0x32a2ad9c
0xbf9fef4c: 0x8347200 <__JCR_LIST__> 0x28601150 0x28601154 0xbf9fef98
0xbf9fef5c: 0x81d0609 <hasher_thread> 0x1 0x836a5c8 <mutex> 0xbf9fef84
0xbf9fef6c: 0x0 0x0 0xffffffff 0xffffffff
0xbf9fef7c: 0xffffffff 0xffffffff 0x4c6aff33 0x32a299c8
0xbf9fef8c: 0x4c6aff29 0xcf66d 0x283b4bcc <_thread_list> 0xbf9fefe8
0xbf9fef9c: 0x283a873f <pthread_getprio> 0x0 0x0 0x0
0xbf9fefac: 0x0 0x0 0x0 0x0
0xbf9fefbc: 0x0 0x0 0x0 0x0
0xbf9fefcc: 0x0 0x0 0x0 0x0
---Type <return> to continue, or q <return> to quit---
0xbf9fefdc: 0x283b4bcc <_thread_list> 0x836a5c0 <pthread> 0x0 0x0
0xbf9fefec: 0x0 0x28601150 0x0 0x0
0xbf9feffc: 0x0 Error accessing memory address 0xbf9ff000: Bad address.
(gdb) |
thread apply all bt
| Code: | (gdb) thread apply all bt
Thread 2 (Thread 0x28601040 (LWP 100210)):
#0 0x081db745 in mark_slice ()
#1 0x081dbf2a in caml_major_collection_slice ()
#2 0x081dc472 in caml_minor_collection ()
#3 0x081dc4ca in caml_check_urgent_gc ()
#4 0x081dd13d in caml_alloc_string ()
#5 0x08194f82 in camlPervasives__$5e_136 ()
#6 0x000101ce in ?? ()
#7 0x0002039b in ?? ()
#8 0x29500504 in ?? ()
#9 0x00000003 in ?? ()
#10 0x294f0328 in ?? ()
#11 0x08166c99 in camlCharset__slow_encode_from_utf8_898 ()
#12 0xbfbfeba8 in ?? ()
#13 0x08166c08 in camlCharset__slow_encode_from_utf8_898 ()
#14 0x0002039b in ?? ()
#15 0x000f5679 in ?? ()
#16 0x2867f1f0 in ?? ()
#17 0x2923c138 in ?? ()
#18 0x2923c124 in ?? ()
#19 0x0830d5b8 in camlCharset__497 ()
#20 0x28626fec in ?? ()
#21 0x2923c11c in ?? ()
#22 0x08097ee1 in camlDcShared__string_to_che3_to_file_1340 ()
#23 0xbfbfebcc in ?? ()
#24 0x08097e8c in camlDcShared__string_to_che3_to_file_1340 ()
#25 0x2923c0ec in ?? ()
---Type <return> to continue, or q <return> to quit---
#26 0x00000001 in ?? ()
#27 0x2944913c in ?? ()
#28 0x080981c7 in camlDcShared__create_filelist_1372 ()
#29 0x295417dc in ?? ()
#30 0x080ab201 in camlDcMain__do_once_after_start_983 ()
#31 0x0816eab7 in camlBasicSocket__exec_timers_567 ()
#32 0xbfbfebe4 in ?? ()
#33 0x0816ea90 in camlBasicSocket__exec_timers_567 ()
#34 0x29030b04 in ?? ()
#35 0x0816e786 in camlBasicSocket__exec_hooks_559 ()
#36 0x00000001 in ?? ()
#37 0x0816eba9 in camlBasicSocket__loop_570 ()
#38 0xbfbfec08 in ?? ()
#39 0x0816eaf7 in camlBasicSocket__loop_570 ()
#40 0x2860984c in ?? ()
#41 0x08199d5d in camlList__iter_102 ()
#42 0x081f0a0c in camlCommonMain ()
#43 0x00000001 in ?? ()
#44 0x0804f73b in camlCommonMain__entry ()
#45 0x0804ce95 in caml_startup__code_begin ()
#46 0x081e93d6 in caml_start_program ()
#47 0x00000000 in ?? ()
#48 0xbfbfec68 in ?? ()
#49 0xbfbfecc0 in ?? ()
#50 0x00000003 in ?? ()
#51 0x0804c5c0 in frame_dummy ()
Previous frame inner to this frame (corrupt stack?)
Thread 1 (Thread 0x28601150 (LWP 100157)):
---Type <return> to continue, or q <return> to quit---
#0 0x283b3217 in __error () from /lib/libthr.so.3
#1 0x283b2df8 in __error () from /lib/libthr.so.3
#2 0x286da320 in ?? ()
#3 0x00000008 in ?? ()
#4 0x00000001 in ?? ()
#5 0x286da300 in ?? ()
#6 0xbf9fef3c in ?? ()
#7 0x0836a5c4 in pthread ()
#8 0x283b174f in pthread_setcancelstate () from /lib/libthr.so.3
#9 0x283b0fed in pthread_cond_signal () from /lib/libthr.so.3
#10 0x081d0609 in hasher_thread (arg=0x0) at src/utils/lib/stubs_c.c:867
#11 0x283a873f in pthread_getprio () from /lib/libthr.so.3
#12 0x00000000 in ?? ()
|
Let me know if there's more you want me to do. After this, there are a couple of (hopefully) smaller issues I have, such as username parsing and magnet link parsing and behavior.
You guys rock! |
|
| Back to top |
|
 |
ygrek professional

Joined: 20 Mar 2010 Posts: 521
|
Posted: Wed Aug 18, 2010 9:55 pm Post subject: |
|
|
Yes, that's it!
Looks like creating filelist takes lots of time at startup and blocks the main thread. Probably moving to separate thread should help.
If you have some time, consider describing what you did (BSD-specific) to get this gdb backtrace on the wiki so that other users can simply follow that instruction in the future :) |
|
| Back to top |
|
 |
somedamnthing neophyte
Joined: 31 Jul 2010 Posts: 22
|
Posted: Wed Aug 18, 2010 10:28 pm Post subject: |
|
|
| ygrek wrote: | Looks like creating filelist takes lots of time at startup and blocks the main thread. Probably moving to separate thread should help.
|
Even with the file already created? Yikes. Will there be a move to sqlite3 in the distant future, or is that not the problem here?
Regardless, please let me know when there's a patch and I'll test it out for you.
| ygrek wrote: |
If you have some time, consider describing what you did (BSD-specific) to get this gdb backtrace on the wiki so that other users can simply follow that instruction in the future  |
Love to! I'll hop on this when I get home.
Finally, is now a good time to further address the other issues I've mentioned, or should I wait for resolution on this one first? |
|
| Back to top |
|
 |
somedamnthing neophyte
Joined: 31 Jul 2010 Posts: 22
|
Posted: Thu Aug 19, 2010 6:14 am Post subject: |
|
|
I looked at the debugging patches for 3.0.4 and compared them to my modified 3.0.3, and there are a couple things missing for debug:
config/configure.in
| Code: |
#lines 700 and 701
OCAMLOPT="$OCAMLOPT -g -inline 0"
CFLAGS="-ggdb -O0"
|
That was your last suggestion, and is vital as the rest for making debug work.
Also, you talked of stripping the binary, so I'd dug through the Makefiles, and found a bunch of 'strip' commands in config/Makefile.in. I commented out the one on line 1550, which gave me a perfectly debugable pre-installation binary. Sorry I didn't mention this one.
edit: once this gets pushed to 3.0.4, I'll poke the FreeBSD maintainer, then update the wiki. |
|
| Back to top |
|
 |
ygrek professional

Joined: 20 Mar 2010 Posts: 521
|
Posted: Thu Aug 19, 2010 9:20 pm Post subject: |
|
|
| somedamnthing wrote: |
Even with the file already created? Yikes. Will there be a move to sqlite3 in the distant future, or is that not the problem here?
|
Probably it would be enough to detect whether startup scan is needed at all, this is the problem for other networks as well.
| Quote: | | Finally, is now a good time to further address the other issues I've mentioned, or should I wait for resolution on this one first? |
Throw them in! Better have all the issues exposed at once, so that long fixes will not hold back the short ones. |
|
| Back to top |
|
 |
somedamnthing neophyte
Joined: 31 Jul 2010 Posts: 22
|
Posted: Thu Aug 19, 2010 10:19 pm Post subject: |
|
|
| ygrek wrote: |
Probably it would be enough to detect whether startup scan is needed at all, this is the problem for other networks as well. |
Do further update scans force a "check" on the file to ensure integrity? I ask because this delay frequently. Basically, I have access for 30 minutes, then none for 30, up and down all the time.
| ygrek wrote: |
Throw them in! Better have all the issues exposed at once, so that long fixes will not hold back the short ones. |
Sweet. The two issues that exist can be seen in this line:
| Code: | | 11:37:17 Tue USER'S NAME1> USERNAME2 added File [ File Name (is) (here).ext magnet:?xt=urn:tree:tiger:FULLHASHISHEREBDMZ3OQWQLLPENOFUP6WMENXY ] to Section [ FILES ]. |
(note: all this entirely discusses the HTTP interface. I know the telnet interface has dodgy support at best, plus the scripting I want to do can be effectively accomplished through curl)
This output is seen from a primary server, bot related chat. Note that the user's name has a space in it, and is therefore split between the User field and the Message field. There needs to be a smarter delimiter to take spaced names into account. (I include the apostrophe because that's in the name in question, and is working fine).
The second is the TTH magnet string. This is a pared down version of what MLDonkey understands to be a TTH string, containing only the bare minimum of information. The string parser needs to be a bit smarter here, to accept all, some, or minimal information.
As a corollary feature request, the handling of TTH magnet links in main or user chat should be used to initiate an internal DC search & auto-download, not the current function, which is a straight browser function. This seems a bit off, since it wants to find an application to handle a magnet link, which is the entire point of MLDonkey sans GUI.
Lemme know if you have any questions, etc. |
|
| Back to top |
|
 |
ygrek professional

Joined: 20 Mar 2010 Posts: 521
|
Posted: Fri Aug 27, 2010 8:41 pm Post subject: |
|
|
| somedamnthing wrote: | I looked at the debugging patches for 3.0.4 and compared them to my modified 3.0.3, and there are a couple things missing for debug:
<b>config/configure.in</b>
| Code: |
#lines 700 and 701
OCAMLOPT="$OCAMLOPT -g -inline 0"
CFLAGS="-ggdb -O0"
|
That was your last suggestion, and is vital as the rest for making debug work.
|
This is strange. Are you sure? I believe that having -g in OCAMLOPT and not stripping binaries is enough to get meaningful backtraces. This is the case on linux here, at least. I am asking because the above options influence performance, but -g does not. So if it is really enough (on bsd too), we could simply always use -g (thus getting meaningful backtraces by default) and get rid of --enable-debug altogether or change its meaning to turn off compiler optimizations.
spiralvoice, what do you think?
| Quote: |
Also, you talked of stripping the binary, so I'd dug through the Makefiles, and found a bunch of '<i>strip</i>' commands in <b>config/Makefile.in</b>. I commented out the one on line 1550, which gave me a perfectly debugable pre-installation binary. Sorry I didn't mention this one.
|
So it appears that freebsd ports build release.shared target which explicitely strips binary. Building default target leaves the binary unstripped. |
|
| Back to top |
|
 |
ygrek professional

Joined: 20 Mar 2010 Posts: 521
|
Posted: Fri Aug 27, 2010 9:41 pm Post subject: |
|
|
| somedamnthing wrote: |
Do further update scans force a "check" on the file to ensure integrity? I ask because this delay frequently. Basically, I have access for 30 minutes, then none for 30, up and down all the time. |
Please apply the following patch and run with it for two hours, so that it performs two cycles (it recreates filelist each hour), then show the logs. BTW it doesn't recheck the files hash - I was mistaken - so it shouldn't take long.. If you could send me your shared_files_dc.ini it could be helpful.
| Code: |
diff --git src/networks/direct_connect/dcShared.ml src/networks/direct_connect/dcShared.ml
index 0307bfe..073eb40 100644
--- src/networks/direct_connect/dcShared.ml
+++ src/networks/direct_connect/dcShared.ml
@@ -212,9 +212,21 @@ let buffer_to_bz2_to_file buf filename =
(* Create xml and mylist filelist *)
let create_filelist () =
- buffer_to_bz2_to_file (make_xml_mylist () ) (Filename.concat directconnect_directory mylistxmlbz2);
+ let heap () =
+ let buf = Buffer.create 1024 in
+ Heap.print_memstats 0 buf false;
+ Buffer.contents buf
+ in
+ lprintf_nl "filelist 1. Heap:\n%s" (heap ());
+ let data = make_xml_mylist () in
+ lprintf_nl "filelist 2. size %d Heap:\n%s" (Buffer.length data) (heap ());
+ buffer_to_bz2_to_file data (Filename.concat directconnect_directory mylistxmlbz2);
+ lprintf_nl "filelist 3. Heap:\n%s" (heap ());
if !verbose_upload then lprintf_nl "Created mylist.xml file";
- string_to_che3_to_file (make_mylist () ) (Filename.concat directconnect_directory mylist);
+ let data = make_mylist () in
+ lprintf_nl "filelist 4. size %d Heap:\n%s" (String.length data) (heap ());
+ string_to_che3_to_file data (Filename.concat directconnect_directory mylist);
+ lprintf_nl "filelist 5. Heap:\n%s" (heap ());
if !verbose_upload then lprintf_nl "Created mylist file";
()
|
| Quote: |
The second is the TTH magnet string. This is a pared down version of what MLDonkey understands to be a TTH string, containing only the bare minimum of information. The string parser needs to be a bit smarter here, to accept all, some, or minimal information.
|
It takes only the needed info from the url, extra info is ignored. Or there are some valid urls that it refuses to parse? Any examples?
| Quote: |
As a corollary feature request, the handling of TTH magnet links in main or user chat should be used to initiate an internal DC search & auto-download, not the current function, which is a straight browser function. This seems a bit off, since it wants to find an application to handle a magnet link, which is the entire point of MLDonkey sans GUI. :)
|
Currently magnet urls are only presented as html links in the filelist and some other places - it is intended for easy copying of this url and sharing with others, not downloading (as the file is already downloaded). The magnet urls in chats are not represented as links at all (for now), how can you click them?? |
|
| Back to top |
|
 |
somedamnthing neophyte
Joined: 31 Jul 2010 Posts: 22
|
Posted: Sun Aug 29, 2010 5:08 am Post subject: |
|
|
| ygrek wrote: | | This is strange. Are you sure? |
I thought I was sure! Then I went in and enabled only the -g, which did, indeed, work. I left the commented 'strip' in config/Makefile.in.
As far as the FreeBSD Makefile environment is concerned, I noticed that the Makefile for the port has this line:
which seems to correspond to release.shared. What *is* the default target? I'm not seeing it in config/Makefile.in |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © phpBB Group
|
|
|
|