Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 61133 - gtkBitchX segfaults on amd64
Summary: gtkBitchX segfaults on amd64
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 All
: High normal (vote)
Assignee: Packages in net-irc
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-21 04:06 UTC by Elie De Brauwer
Modified: 2005-03-22 10:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
An strace (strace,42.62 KB, text/plain)
2004-08-21 04:09 UTC, Elie De Brauwer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elie De Brauwer 2004-08-21 04:06:38 UTC
I emerged bitchx which automatically builds gtkBitchX for me. It builds but on startup it segfaults.

-> net-irc/bitchx-1.1-r1

Emerge info:

Portage 2.0.50-r9 (default-amd64-2004.2, gcc-3.3.4, glibc-2.3.4.20040808-r0, 2.6.8-gentoo-r1)
=================================================================
System uname: 2.6.8-gentoo-r1 x86_64 4
Gentoo Base System version 1.5.3
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/share/config:/usr/kde/3.3/env:/usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache"
GENTOO_MIRRORS="ftp://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://ftp.du.se/pub/os/gentoo http://gentoo.mirror.sdv.fr http://ftp.gentoo.skynet.be/pub/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X amd64 apm arts avi berkdb cdr crypt encode esd foomaticdb gdbm gif gnome gpm gtk gtk2 imlib java jpeg kde libg++ libwww mikmod motif mozilla mpeg ncurses nls nogcj oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl slang snmp spell ssl tcpd tetex truetype xml2 xmms xv zlib"
Comment 1 Elie De Brauwer 2004-08-21 04:09:44 UTC
Created attachment 37853 [details]
An strace

An strace of the failing gtkBitchX 

The error happens at the following point it think:

clone(child_stack=0x6cf3e0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND)
= 13852
write(15, "+\247@\0\0\0\0\0\5\0\0\0\0\0\0\0P\363\377\277\177\0\0\0"..., 168) =
168
rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 8) = 0
write(15, "\240\264h\0\0\0\0\0\0\0\0\0*\0\0\0\0\0\0\0\0\0\0\0\0\207"..., 168) =
168
rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 8) = 0
rt_sigsuspend([] <unfinished ...>
--- SIGRTMIN (Unknown signal 32) @ 0 (0) ---
<... rt_sigsuspend resumed> )		= -1 EINTR (Interrupted system call)
rt_sigreturn(0x20)			= -1 EINTR (Interrupted system call)
brk(0x724000)				= 0x724000
Comment 2 Elie De Brauwer 2004-08-21 04:12:36 UTC
Something i forgot, i saw an awful lot of warnings at compile time, so the cause could also be a non 64bit proof piece of code, but I don't have the time to look into it right now
Comment 3 Sven Wegener gentoo-dev 2004-08-21 19:21:32 UTC
Could someone from our amd64 team have a look. On x86 it's a WORKSFORME.
Comment 4 Elie De Brauwer 2004-08-21 23:19:25 UTC
Changed the title forgot to specify it was on amd64 
Comment 5 Danny van Dyk (RETIRED) gentoo-dev 2005-01-07 14:46:23 UTC
Very strange.

It segfaults if i start it normally, but when i use gdb:

dvandyk@phi ~ $ gdb gtkBitchX
GNU gdb 6.2.1
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 "x86_64-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) run
Starting program: /usr/bin/gtkBitchX
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 19981)]
[New Thread 32769 (LWP 19984)]
[New Thread 16386 (LWP 19985)]
Detaching after fork from child process 19986.

Program exited normally

NO segfault. What's going on ?
Comment 6 Danny van Dyk (RETIRED) gentoo-dev 2005-01-07 14:51:33 UTC
I suspect that BitchX tries some system mumbo-jumbo using a (wrong) hardcoded constant. And that signal just gets sucked up by gdb when run through it.
Comments ?
Comment 7 Danny van Dyk (RETIRED) gentoo-dev 2005-01-07 15:26:52 UTC
Gotta backtrace...

(gdb) run
Starting program: /usr/bin/gtkBitchX
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 20452)]
[New Thread 32769 (LWP 20455)]
[New Thread 16386 (LWP 20456)]
Detaching after fork from child process 20457.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 20452)]
0x00000000004f3b83 in BX_cursor_in_display (w=0x74b8e8) at ./screen.c:1381
1381    ./screen.c: No such file or directory.
        in ./screen.c
(gdb) bt
#0  0x00000000004f3b83 in BX_cursor_in_display (w=0x74b8e8) at ./screen.c:1381
#1  0x00000000004a48db in BX_cursor_to_input () at input.c:143
#2  0x00000000004a4a30 in BX_update_input (update=3) at input.c:205
#3  0x0000000000529cb3 in BX_update_all_windows () at window.c:1042
#4  0x00000000004e6753 in init_screen () at output.c:155
#5  0x00000000004aff4f in main (argc=1, argv=0x7fbffff208, envp=0x7fbffff218) at ./irc.c:1576

screen.c:BX_cursor_in_display

1376 void BX_cursor_in_display (Window *w)
1377 {
1378         if (!w)
1379                 w = current_window;
1380         if (w->screen)
1381                 w->screen->cursor_window = w; // <-- segfaults here
1382 }

(gdb) print *(w->screen)
$6 = {screennum = -443987883, current_window = 0x55c3c9006923e2b8, last_window_refnum = 1223002440,
  window_list = 0x48f8458b48f87d89, window_list_end = 0x830ae8c14858408b, cursor_window = 0x8b480b75c08501e0,
  visible_windows = -2092369851, window_stack = 0x8948fff5d9d0e80b, prev = 0xf045c74808ebf045,
  next = 0xf0458b48006923e2, fpin = 0x8348e5894855c3c9, fdin = -1991765780, fpout = 0x570908bf845,[...]

Well, i think screen is the bad boy here ! Those pointers look scary...
Comment 8 Simon Stelling (RETIRED) gentoo-dev 2005-03-22 10:43:21 UTC
i consider this package beeing endless broken on amd64, so i made it work with a ugly hack that prevents bitchx from beeing built with USE=gtk. it prints out a warning, so it should be ok.. i'll report it upstream later on