when GQ is compilied with openldap 2.2.14 libs the application will start, bind but soon as you try and traverse the tree is segfaults Reproducible: Always Steps to Reproduce: 1.emerge openldap 2.2.14 2.emerge gq-1.0-beta1 3./usr/bin/gq Actual Results: Everyhting runn fine untill you go to past the top node Expected Results: should show users,hosts,alias...etc....etc.. write(3, "\f\30\7\0k\1 \1\17\0\0\0\0\0\0\0\0\0\0\0\327\1\0\0\224"..., 2044) = 2044 open("/usr/share/themes/Industrial/gtk-2.0/stock_apply.png", O_RDONLY|O_LARGEFILE) = 5 fstat64(5, {st_mode=S_IFREG|0644, st_size=812, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40d0c000 read(5, "\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\0\30\0\0\0\30\10\6\0\0"..., 4096) = 812 _llseek(5, 0, [0], SEEK_SET) = 0 read(5, "\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\0\30\0\0\0\30\10\6\0\0"..., 4096) = 812 close(5) = 0 munmap(0x40d0c000, 4096) = 0 open("/usr/share/themes/Industrial/gtk-2.0/stock_refresh.png", O_RDONLY|O_LARGEFILE) = 5 fstat64(5, {st_mode=S_IFREG|0644, st_size=1061, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40d0c000 read(5, "\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\0\30\0\0\0\30\10\6\0\0"..., 4096) = 1061 _llseek(5, 0, [0], SEEK_SET) = 0 brk(0) = 0x82f4000 brk(0x8319000) = 0x8319000 read(5, "\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\0\30\0\0\0\30\10\6\0\0"..., 4096) = 1061 brk(0) = 0x8319000 brk(0) = 0x8319000 brk(0x8311000) = 0x8311000 brk(0) = 0x8311000 close(5) = 0 munmap(0x40d0c000, 4096) = 0 write(3, "\f\30\7\0\316\1 \1\17\0\0\0\2\0\0\0\2\0\0\0\353\0\0\0\25"..., 2044) = 2044 write(3, "\f\30\7\0Y\1 \1\17\0\0\0\5\0\0\0\5\0\0\0\36\0\0\0\31\0"..., 2040) = 2040 write(3, "\2\30\4\0\202\1 \1\2\0\0\0\366\366\366\0\2\0\4\0}\1 \1"..., 2024) = 2024 write(3, "\f\30\7\0\257\1 \1\17\0\0\0\300\0\0\0003\1\0\0\242\1\0"..., 2040) = 2040 write(3, "\f\30\5\0l\1 \1\3\0\0\0\5\0\0\0`\1\0\0\f\1\5\0m\1 \1\3"..., 2032) = 2032 write(3, "\f\30\7\0\316\1 \1\17\0\0\0\2\0\0\0\2\0\0\0\260\1\0\0\25"..., 2044) = 2044 write(3, "\f\30\7\0\177\1 \1\17\0\0\0\2\0\0\0\2\0\0\0\227\1\0\0\25"..., 2044) = 2044 write(3, "8\30\4\0M\0 \1\0\0\10\0\0\0\0\0006\0\2\0+\2 \0015\30\4"..., 2048) = 2048 write(3, ">\30\7\0009\2 \1\205\1 \1M\0 \1\0\0\0\0\0\0\0\0\260\1\25"..., 2040) = 2040 write(3, "5\30\4\0G\2 \1\220\1 \0018\0\31\0;\3\5\0M\0 \1\0\0\0\0"..., 2044) = 2044 writev(3, [{"F\30\5\0R\2 \1M\0 \1\0\0\0\0\260\1\25\0008\0\4\0M\0 \1"..., 2048}, {"GF QHPLVXV\17GF LG\17GF DX", 22}, {"\0\0", 2}], 3) = 2072 write(3, "8\30\4\0\t\0 \1\0\0\10\0\0\0\0\0;\3\5\0M\0 \1\0\0\0\0\0"..., 2040) = 2040 write(3, "B\30\7\0e\2 \1n\0 \1\204\2F\1\220\2F\1\221\0029\1\221\2"..., 2044) = 2044 write(3, ";\3\5\0q\0 \1\0\0\0\0~\2\1\1\31\0\31\0B\2\7\0e\2 \1q\0"..., 2048) = 2048 write(3, "@\0\5\0e\2 \1n\0 \1\200\2\345\0\224\2\321\0008\2\4\0n\0"..., 2032) = 2032 writev(3, [{"B\0\7\0e\2 \1q\0 \1\203\2\261\0\221\2\261\0\222\2\242\0"..., 2048}, {"~\2\204\0\31\0\31\0", 8}], 2) = 2056 writev(3, [{"B\0\7\0e\2 \1r\0 \1\202\2\231\0\222\2\231\0\223\2\210\0"..., 2048}, {"[\2\36\0\31\0\31\0", 8}], 2) = 2056 writev(3, [{"B\0\7\0e\2 \1O\0 \1^\0024\0p\0024\0q\2!\0q\0023\0@\0\4"..., 2048}, {"^\2U\0\23\0\23\0", 8}], 2) = 2056 write(3, "B\0\21\0e\2 \1\10\0 \1a\2[\0m\2[\0b\2\\\0l\2\\\0c\2]\0"..., 2048) = 2048 write(3, "@\0\6\0h\2 \1p\0 \1,\0\31\0B\0\10\0A\0\t\0008\2\4\0p\0"..., 2040) = 2040 writev(3, [{"@\0\4\0h\2 \1q\0 \1\245\2\30\0008\0\4\0q\0 \1\0\0\10\0"..., 2048}, {"\241\2\\\1\17\0\17\0", 8}], 2) = 2056 write(3, "B\0\5\0h\2 \1\n\0 \1\242\2h\1\242\2^\0018\0\4\0\n\0 \1"..., 2036) = 2036 writev(3, [{"B\0\7\0h\2 \1r\0 \1\f\0\217\1X\0\217\1Y\0y\1Y\0\216\1@"..., 2048}, {"O\2r\1[\0$\0", 8}], 2) = 2056 write(3, "B\0\7\0h\2 \1o\0 \1W\2\215\1\241\2\215\1\241\2z\1\241\2"..., 2048) = 2048 writev(3, [{"8\0\4\0i\0 \1\0\0\10\0\0\0\0\0;\3\5\0j\0 \1\0\0\0\0\4\0"..., 2048}, {"@\0%\0000\0\23\0", 8}], 2) = 2056 write(3, "\234\27\n\0\3\0 \1R\0 \1v\2 \0013\0\0\0\4\0 \1\0\0\0\0"..., 1076) = 1076 ioctl(3, FIONREAD, [2848]) = 0 read(3, "\23\2\274\23\26\2 \1\26\2 \1\0S\f\10xc\213\10\26\2 \1\1"..., 2048) = 2048 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 ioctl(3, FIONREAD, [800]) = 0 read(3, "\26p>\24\352\1 \1\352\1 \1\351\1 \1\300\0_\2\357\0\31\0"..., 800) = 800 ioctl(3, FIONREAD, [4192]) = 0 read(3, "\26\0W\24\316\1 \1\316\1 \1\0\0\0\0\2\0\2\0\353\0\25\0"..., 2048) = 2048 ioctl(3, FIONREAD, [2144]) = 0 read(3, "\26\0\227\24{\1 \1{\1 \1\0\0\0\0\2\0\2\0\322\0\25\0\0\0"..., 2048) = 2048 ioctl(3, FIONREAD, [96]) = 0 read(3, "\f2\371\24\252\1 \1\0\0\0\0\357\0\2\0\2\0\0\0\0\0\0\000"..., 96) = 96 ioctl(3, FIONREAD, [4128]) = 0 read(3, "\fw\371\24\254\1 \1\0\0\0\0\353\0\4\0\0\0\177\10 w\201"..., 2048) = 2048 ioctl(3, FIONREAD, [2080]) = 0 read(3, "\fm\371\24p\1 \1G\0\0\0\250\0\2\0\2\0\0\0\0\0\0\0008\357"..., 2048) = 2048 ioctl(3, FIONREAD, [32]) = 0 read(3, "\26\0\\\25\311\1 \1\311\1 \1\0\0\0\0\2\0\2\0\205\1\25\0"..., 32) = 32 ioctl(3, FIONREAD, [4128]) = 0 read(3, "\26\0]\25\305\1 \1\305\1 \1\302\1 \1l\2\227\1\31\0\31\0"..., 2048) = 2048 ioctl(3, FIONREAD, [2080]) = 0 read(3, "\26\0\253\25x\1 \1x\1 \1u\1 \1I\2\36\0\31\0\31\0\0\0\0"..., 2048) = 2048 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 ioctl(3, FIONREAD, [32]) = 0 read(3, "\26\0\373\25\33\2 \1\33\2 \1\0\0\0\0\2\0\2\0\225\1\25\0"..., 32) = 32 ioctl(3, FIONREAD, [4128]) = 0 read(3, "\26\0\374\25\34\2 \1\34\2 \1\31\2 \1^\2B\3\26\0\33\0\0"..., 2048) = 2048 ioctl(3, FIONREAD, [2080]) = 0 read(3, "\26\0>\26\261\1 \1\261\1 \1\0\0\0\0\2\0\2\0\260\1\25\0"..., 2048) = 2048 ioctl(3, FIONREAD, [32]) = 0 read(3, "\26\0\223\26r\1 \1r\1 \1\0\0\0\0\2\0\2\0\260\1\25\0\0\0"..., 32) = 32 ioctl(3, FIONREAD, [160]) = 0 read(3, "\fS\223\26r\1 \1\236\1\0\0\22\0\25\0\0\0\177\0100S\203"..., 160) = 160 ioctl(3, FIONREAD, [0]) = 0 ioctl(3, FIONREAD, [0]) = 0 poll([{fd=3, events=POLLIN}], 1, 0) = 0 ioctl(3, FIONREAD, [0]) = 0 poll([{fd=3, events=POLLIN}], 1, 0) = 0 ioctl(3, FIONREAD, [0]) = 0 poll([{fd=3, events=POLLIN}], 1, 0) = 0 writev(3, [{"5\30\4\0w\2 \1\261\1 \1\260\1\17\0;\3\5\0M\0 \1\0\0\0\0"..., 2048}, {"\0\0\0\0\227\1\25\0", 8}], 2) = 2056 write(3, ">\30\7\0\204\2 \1\177\1 \1M\0 \1\0\0\0\0\0\0\0\0\227\1"..., 896) = 896 ioctl(3, FIONREAD, [0]) = 0 poll([{fd=3, events=POLLIN}], 1, 0) = 0 ioctl(3, FIONREAD, [0]) = 0 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, -1) = 1 ioctl(3, FIONREAD, [64]) = 0 read(3, "\4\1I\36#\7\10\0G\0\0\0\221\0 \1\0\0\0\0+\0\247\0\34\0"..., 64) = 64 poll([{fd=3, events=POLLIN}], 1, 0) = 0 poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 0) = 1 write(3, "\22\0\7\0\5\0 \0013\1\0\0\6\0\0\0 \0\0\0\1\0\0\0#\7\10"..., 36) = 36 read(3, "\5\1I\36[\7\10\0G\0\0\0\221\0 \1\0\0\0\0+\0\247\0\34\0"..., 32) = 32 read(3, "o\2I\36\\\7\10\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 32) = 32 read(3, 0xbfffe2d0, 32) = -1 EAGAIN (Resource temporarily unavailable) select(4, [3], NULL, NULL, NULL) = 1 (in [3]) read(3, "\34\361J\36\5\0 \0013\1\0\0\267\7\10\0\0\0 \1xc\213\10"..., 32) = 32 read(3, "\1\1K\36\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 32) = 32 poll([{fd=3, events=POLLIN}], 1, 0) = 0 poll([{fd=3, events=POLLIN}], 1, 0) = 0 poll([{fd=3, events=POLLIN}], 1, 0) = 0 poll([{fd=3, events=POLLIN}], 1, 0) = 0 write(3, "\227\4\2\0\0\1 \1", 8) = 8 read(3, 0xbfffe2d0, 32) = -1 EAGAIN (Resource temporarily unavailable) select(4, [3], NULL, NULL, NULL) = 1 (in [3]) read(3, "\1\1L\36\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 32) = 32 poll([{fd=3, events=POLLIN}], 1, 0) = 0 poll([{fd=3, events=POLLIN}], 1, 0) = 0 ioctl(3, FIONREAD, [0]) = 0 ioctl(3, FIONREAD, [0]) = 0 poll([{fd=3, events=POLLIN}], 1, 0) = 0 ioctl(3, FIONREAD, [0]) = 0 poll([{fd=3, events=POLLIN}], 1, 0) = 0 write(3, "5\30\4\0\214\2 \1\5\0 \1\361\3\21\0;\3\5\0M\0 \1\0\0\0"..., 1024) = 1024 ioctl(3, FIONREAD, [0]) = 0 poll([{fd=3, events=POLLIN}], 1, 0) = 0 time(NULL) = 1093940207 write(4, "0l\2\1\vcG\4\26dc=nemisus,dc=id,dc=au\n"..., 110) = 110 select(1024, [4], [], NULL, NULL) = 1 (in [4]) read(4, "0\f\2\1\ve\7\n", 8) = 8 read(4, "\1\0\4\0\4\0", 6) = 6 time(NULL) = 1093940207 time(NULL) = 1093940207 write(4, "0b\2\1\fc=\4\26dc=nemisus,dc=id,dc=au\n"..., 100) = 100 select(1024, [4], [], NULL, NULL) = 1 (in [4]) read(4, "0(\2\1\fd#\4", 8) = 8 read(4, "\37ou=Hosts,dc=nemisus,dc=id,dc=au"..., 34) = 34 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++ emerge info Portage 2.0.50-r9 (default-x86-2004.0, gcc-3.3.2, glibc-2.3.2-r9, 2.6.7) ================================================================= System uname: 2.6.7 i686 Intel(R) Celeron(TM) CPU 1000MHz Gentoo Base System version 1.4.9 distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.3 [enabled] Autoconf: sys-devel/autoconf-2.59-r3 Automake: sys-devel/automake-1.8.5-r1 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-O2 -mcpu=pentium3 -fomit-frame-pointer -funroll-loops -pipe" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/bind /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -mcpu=pentium3 -fomit-frame-pointer -funroll-loops -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="ftp://mirror.optusnet.com.au/gentoo/ ftp://mirror.aarnet.edu.au/pub/gentoo ftp://planetmirror.com/pub/gentoo ftp://mirror.pacific.net.au/linux/Gentoo http://gentoo.ccccom.com ftp://gentoo.ccccom.com ftp://gentoo.netnitco.net/pub/mirrors/gentoo/source/" MAKEOPTS="-j5" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp/portage" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/bmg-main" SYNC="rsync://rsync.au.gentoo.org/gentoo-portage" USE="X acpi alsa apache2 apm avi berkdb cdr crypt cups dvd encode esd foomaticdb gdbm gif gnome gpm gtk gtk2 imap imlib ipv6 java jpeg kerberos ldap libg++ libwww mad mikmod mmx mono motif mpeg msn ncurses oggvorbis opengl oss pam pdflib perl php png python quicktime readline samba4 sasl sdl slang spell ssl svga tcpd truetype usb x86 xft xft2 xml2 xmms xv zlib"
does gq-1.0-beta2 suffer the same problem? If so compile the program with CFLAGS=-g, FEATURES=nostrip, look for a core file. Then gdb {program} {core} and "where" should show you the code where it failed. Sorry if this isn't that clear - in a rush...
Look through http://sourceforge.net/tracker/?group_id=3805&atid=103805 for a fix too.
I've recompiled GQ with nostip and "-g" appended tomy gcc line and the ran the core dumped through gdb and got the problem. #0 0x401df970 in ldap_bv2rdn_x () from /usr/lib/libldap-2.2.so.7 Unforunately I'm not a programer so i have no idea what to do with it form here thanks
Peter sorry for throwing this hard one on you. To get the stack of function calls enter 'where' on the gdb prompt. This will show hopefully some .c files that contributed towards the seg fault. There are a number of approaches to take here: 1. gq seems to be unmaintained upstream and consider looking for alternatives. I'll consider removing it from the distibution if it just doesn't work. 2. Describe how to quickly set up a testing environment and I'll give it a look when I can. 3. continue debugging with some help from #gentoo-bugs (if your interested in learning a bit)
This is the rest of the debug from gdb as asked for (gdb) where #0 0x401df970 in ldap_bv2rdn_x () from /usr/lib/libldap-2.2.so.7 #1 0x401c77c0 in ?? () from /usr/lib/libldap-2.2.so.7 #2 0x40015b78 in _dl_out_of_memory () from /lib/ld-linux.so.2 #3 0x40014860 in _dl_out_of_memory () from /lib/ld-linux.so.2 #4 0xbfffe8e8 in ?? () #5 0x00000110 in ?? () #6 0x08263d08 in ?? () #7 0x401e01c3 in ldap_rdn2bv_x () from /usr/lib/libldap-2.2.so.7 #8 0x00000000 in ?? () #9 0xbfffe8b8 in ?? () #10 0x00000000 in ?? () #11 0x401f96b0 in ?? () from /usr/lib/libldap-2.2.so.7 #12 0x0827f320 in ?? () #13 0x0827f320 in ?? () #14 0x00000000 in ?? () #15 0x401e00a3 in ldap_rdn2str () from /usr/lib/libldap-2.2.so.7 #16 0x08263d08 in ?? () #17 0xbfffe8e8 in ?? () #18 0x00000110 in ?? () #19 0x00000000 in ?? () #20 0x00000000 in ?? () #21 0x4000b2b0 in _dl_rtld_di_serinfo () from /lib/ld-linux.so.2 Previous frame inner to this frame (corrupt stack?) cheers
I'm guessing from #2 and #3 you are out of memory. Although the strace doesn't seem to indicate this (brk = 0). Sure the program should handle this gracefully however it doesn't. It looks like the .o files where removed or didn't have permission to read them as a normal user. Try recompiling with # env FEATURES="noclean nostrip" ACCEPT_KEYWORDS=~x86 CFLAGS="-march=athlon-xp -g -pipe" emerge gq # cd /usr/portage/net-nds/openldap # env FEATURES="noclean nostrip" ACCEPT_KEYWORDS=~x86 CFLAGS="-march=athlon-xp -g -pipe" USE="berkdb gdbm" ebuild openldap-2.2.14.ebuild merge (tip - remove -O flags when debugging) # chmod -R ugo+rX /var/tmp/portage/gq-1.0_beta1/ (to set the permissions - this could be what failed) as a normal user: $ gdb /usr/bin/gq (gdb) run when the SEGV occurs (gdb) where (gdb) list On the line where the error occurs try "print" followed by a variable or expression to show the current state of the program e.g. if line 160 failed (gdb) list 158 gtk_main (); 159 160 free_config(config); 161 config = NULL; 162 163 save_state(); 164 165 gtk_exit(0); 166 167 #ifdef DEBUG (gdb) print config $2 = (struct gq_config *) 0x80ce3b8 (gdb) print free_config $3 = {void (struct gq_config *)} 0x8073fc2 <free_config> gq works fine on openldap 2.1.30-r1 for me. Compiling 2.2.14 now for a test. (also noted 2.2.15 is out without an ebuild)
Peter can you attach your openldap config file(s) so I can test in the same environment. Any other customised setup appreciated. Also what USE flags did you use with openldap? (emerge -pv openldap)
can't debug it without info. Upstream doesn't seem interested in maintaining it either.
I've fixed this bug in gq-1.0_beta1-r1.