netris crashes on startup (amd64)

Bug #82125 reported by zch
4
Affects Status Importance Assigned to Milestone
netris (Debian)
Fix Released
Unknown
netris (Ubuntu)
Fix Released
Undecided
ville palo

Bug Description

Binary package hint: netris

Netris 0.52-5 crashes immediately on startup. Stack trace follows.

Program received signal SIGSEGV, Segmentation fault.
0x00002b6c20d83e4b in strftime_l () from /lib/libc.so.6
(gdb) bt
#0 0x00002b6c20d83e4b in strftime_l () from /lib/libc.so.6
#1 0x0000000000403307 in RefreshScreen () at curses.c:347
#2 0x0000000000402207 in OneGame (scr=0, scr2=-1) at game.c:150
#3 0x00000000004030f2 in main (argc=1, argv=0x7fff8a13d8c8) at game.c:546

Revision history for this message
In , Rhonda D'Vine (rhonda) wrote : Re: Bug#345305: netris: segfault on amd64 in curses.c:RefreshWindow (patch)

* Brian Brazil <email address hidden> [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.

> 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? It might take me a while
to be able to approach it on an amd64 machine myself.

 So long,
Alfie
--
Achtung: Wenn Sie ein Skeptiker und für neue innovative Möglichkeiten nicht
aufgeschlossen sind, dann sollten Sie diese Webseite verlassen!
                -- empfangene SPAM-Mail

Revision history for this message
In , Brian Brazil (bbrazil) wrote :

On Fri, Dec 30, 2005 at 12:32:54PM +0100, Gerfried Fuchs wrote:
> * Brian Brazil <email address hidden> [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:

bbrazil@spoon:~/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

Revision history for this message
In , Rhonda D'Vine (rhonda) wrote :

* Brian Brazil <email address hidden> [2005-12-30 11:53]:
> On Fri, Dec 30, 2005 at 12:32:54PM +0100, Gerfried Fuchs wrote:
>> 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.

 So no need to switch to localtime_r? Just what I thought. Will add the
include in the next upload, and thanks for your help.

 So long,
Alfie
--
-!- mode/#debian.de [-o wease|] by wease|
 * wease| traut BX nicht
                                  -- #debian.de

Revision history for this message
In , Rhonda D'Vine (rhonda) wrote : Bug#345305: fixed in netris 0.52-6

Source: netris
Source-Version: 0.52-6

We believe that the bug you reported is fixed in the latest version of
netris, which is due to be installed in the Debian FTP archive:

netris_0.52-6.diff.gz
  to pool/main/n/netris/netris_0.52-6.diff.gz
netris_0.52-6.dsc
  to pool/main/n/netris/netris_0.52-6.dsc
netris_0.52-6_i386.deb
  to pool/main/n/netris/netris_0.52-6_i386.deb

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Gerfried Fuchs <email address hidden> (supplier of updated netris package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Fri, 08 Sep 2006 14:08:42 -0500
Source: netris
Binary: netris
Architecture: source i386
Version: 0.52-6
Distribution: unstable
Urgency: low
Maintainer: Gerfried Fuchs <email address hidden>
Changed-By: Gerfried Fuchs <email address hidden>
Description:
 netris - free, networked version of T*tris
Closes: 304224 345305
Changes:
 netris (0.52-6) unstable; urgency=low
 .
   * #include <time.h> in curses.c (closes: #345305)
   * Add patch to display line count, contributed by Piotr Krukowiecki
     (closes: #304224)
   * Bumped Standards-Version to 3.7.2, no changes needed.
   * Updated FSF address in copyright file.
Files:
 fb38f45fc6256a9d58e936116f91c87d 549 games optional netris_0.52-6.dsc
 42baa6eb832567bab5bf83cd2fc7a681 10130 games optional netris_0.52-6.diff.gz
 52c72e8734a77200893863c035ed9fd1 36200 games optional netris_0.52-6_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFAcE1ELuA/Ba9d8YRAuQHAKCIqVyr3J9zu/LJlQ5rZ0BUdwEJigCfU0VI
BZaLHjcA9cUkgSnQjviShEU=
=UtM7
-----END PGP SIGNATURE-----

Revision history for this message
zch (mail-zbigniew) wrote :

Binary package hint: netris

Netris 0.52-5 crashes immediately on startup. Stack trace follows.

Program received signal SIGSEGV, Segmentation fault.
0x00002b6c20d83e4b in strftime_l () from /lib/libc.so.6
(gdb) bt
#0 0x00002b6c20d83e4b in strftime_l () from /lib/libc.so.6
#1 0x0000000000403307 in RefreshScreen () at curses.c:347
#2 0x0000000000402207 in OneGame (scr=0, scr2=-1) at game.c:150
#3 0x00000000004030f2 in main (argc=1, argv=0x7fff8a13d8c8) at game.c:546

Revision history for this message
zch (mail-zbigniew) wrote :

The program crashes because of missing declaration for strftime function. Implicit declaration is incompatible with the actual one, but the problem doesn't show up on 32-bit architectures, where ints and pointers have the same size.

Revision history for this message
ville palo (vi64pa) wrote :

Thanks for the bug, this is already reported to debian BTS and seems to be fixed in 0.52-6 which is now in feisty.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=345305

Changed in netris:
status: Unknown → Fix Released
ville palo (vi64pa)
Changed in netris:
assignee: nobody → vi64pa
status: Unconfirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.