On Fri, Dec 30, 2005 at 12:32:54PM +0100, Gerfried Fuchs wrote: > * Brian Brazil <[EMAIL PROTECTED]> [2005-12-30 10:58]: > > Netris segfaults immediately when invoked as 'netris'. Segfaults once a > > connection is made for -c and -w. Debugging shows the problem is in > > curses.c:RefreshWindow. This happens on amd64, but not i386. > > Can you maybe get me some debug output? The build process of netris > supports DEB_BUILD_OPTIONS='noopt nostrip' so you should be able to > build it for debugging.
With -3:
[EMAIL PROTECTED]:~/tmp/netris-0.52$ gdb ./netris
(gdb) r
Starting program: /home/bbrazil/tmp/netris-0.52/netris
Program received signal SIGSEGV, Segmentation fault.
0x00002aaaaaecefd7 in strftime () from /lib/libc.so.6
(gdb) bt full
#0 0x00002aaaaaecefd7 in strftime () from /lib/libc.so.6
No symbol table info available.
#1 0x00000000004040de in RefreshScreen () at curses.c:346
timeStr = {'\0' <repeats 31 times>, '\0' <repeats 31 times>}
theTime = 1135942664
#2 0x0000000000402612 in OneGame (scr=0, scr2=-1) at game.c:150
event = {type = 5292896, u = {key = 0 '\0', net = {type = 2864443392,
size = 10922, data = 0x7fffffa5e640}, robot = {size = -1430523904,
data = 0x7fffffa5e640 "Pæ¥ÿÿ\177"}}}
linesCleared = 10922
changed = 1
spied = 0
spying = 0
dropMode = 0
oldPaused = 0
paused = 0
pausedByMe = 0
pausedByThem = 0
pauseTimeLeft = 140737482450496
pieceCount = 0
key = -1430523904
p = 0x0
cmd = 0x700000001 <Address 0x700000001 out of bounds>
#3 0x00000000004034e4 in main (argc=1, argv=0x7fffffa5e808) at game.c:546
initConn = 0
waitConn = 0
ch = -1
done = 0
hostStr = 0x0
portStr = 0x0
event = {type = E_none, u = {key = 18 '\022', net = {type = 2863356178,
size = 10922, data = 0x2aaaaabc0b48}, robot = {size = -1431611118,
data = 0x2aaaaabc0b48 ""}}}
(gdb)
> > There's a patch below - I've got only a vague notion as to why it works.
> > Basic testing done on the vanilla source, -3 and -5 packages on amd64
> > and the -3 on i386.
>
> Strange. I wonder why the thread-safe version might be needed... Or
> might it even be related to only the missing #include? According to the
> manpage of localtime(3) it would be needed anyway...
>
> Do you might want to try it with only the added include but no changed
> call, and DEB_BUILD_OPTIONS set appropriately?
I added the #include for the 'struct tm'. Adding just a #include <time.h> to
curses.c fixes the problem.
Brian
--
Website: http://www.netsoc.tcd.ie/~bbrazil
signature.asc
Description: Digital signature

