Bug#413174: SEGFAULT when running acm

2007-03-07 Thread Steve Langasek
Ah, so I guess our mails crossed mid-flight...

On Wed, Mar 07, 2007 at 10:06:47PM +0100, Andreas Henriksson wrote:
  On Tue, 6 Mar 2007, Steve Langasek wrote:
   Running acm under valgrind points to a couple bits of uninitialized memory
   as the culprits here.  With the attached patch, acm starts up for me and
   seems to work properly (or as properly as I guess I can expect without a
   joystick).

 I've tried the acm with the suggested patch on my amd64 system.
 Unfortunately it doesn't seem to work for me. It no longer segfaults,
 but all I get is a black screen with a couple of controls (see attached
 partial screenshot, bottom of screen included only).
 This is the same behaviour I get when recompiling (unpatched) acm with
 -O0 instead of -O2.

Ah, apparently I had the advantage of not having any preconceived notions of
how the game was supposed to work, so I pushed buttons until something did
work. :)  FYI, hitting 'r' seems to do the trick; according to the manpage
this is supposed to be 'radar', I don't know why that would be relevant here
but it does do the trick.

Following the manpage directions on how to get started, I manage to crash it
again after trying to set the trim; so here's an updated patch with another
memory initialization fix which didn't seem to matter earlier, but
definitely seems to now... :)

Anyway, there seem to still be some porting issues here, but nothing that
appears to make the package 'unusable' (just 'awkward'), so I'm going to go
ahead and NMU with this patch.  Andreas, if you find any other bugs making
the package unusable, please let me know.

-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
[EMAIL PROTECTED]   http://www.debian.org/
diff -u acm-5.0/src/dis_if.c acm-5.0/src/dis_if.c
--- acm-5.0/src/dis_if.c
+++ acm-5.0/src/dis_if.c
@@ -21,6 +21,8 @@
 
 #include stdio.h
 #include math.h
+#include stdlib.h
+#include string.h
 #ifndef WIN32
 #include sys/time.h
 #endif
@@ -381,7 +383,7 @@
  *  Allocate storage for the entity table and initialize it.
  */
 
-	entities = (Entity_t *) malloc(sizeof(Entity_t) * MAX_ENTITIES);
+	entities = (Entity_t *) calloc(MAX_ENTITIES, sizeof(Entity_t));
 	for (i = 0; i  MAX_ENTITIES; i++) {
 		entities[i].local = -1;
 	}
@@ -943,6 +945,7 @@
 	dis_pdu   pdu;
 	int   i;
 
+	memset(pdu,0,sizeof(dis_pdu));
 	if (network_enabled == 0) {
 		return 0;
 	}
diff -u acm-5.0/dis/lib/io.c acm-5.0/dis/lib/io.c
--- acm-5.0/dis/lib/io.c
+++ acm-5.0/dis/lib/io.c
@@ -169,6 +169,8 @@
 	msg.msg_control = (caddr_t) NULL;
 	msg.msg_controllen = 0;
 #endif
+	msg.msg_flags = 0;
+
 	vec.iov_base = (caddr_t)  buffer;
 	vec.iov_len = len;
 	
diff -u acm-5.0/debian/changelog acm-5.0/debian/changelog
--- acm-5.0/debian/changelog
+++ acm-5.0/debian/changelog
@@ -1,3 +1,12 @@
+acm (5.0-23.1) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * High-urgency upload for RC bugfix.
+  * Fix several initialization bugs that can trigger crashes on some
+architectures.  Closes: #413174.
+
+ -- Steve Langasek [EMAIL PROTECTED]  Tue,  6 Mar 2007 18:05:34 -0800
+
 acm (5.0-23) unstable; urgency=low
 
   * Applied patch from Petr Salinger to fix FTBFS on GNU/kFreeBSD


Bug#413174: SEGFAULT when running acm

2007-03-07 Thread Andreas Henriksson
On ons, 2007-03-07 at 19:35 -0800, Steve Langasek wrote:
 Ah, apparently I had the advantage of not having any preconceived notions of
 how the game was supposed to work, so I pushed buttons until something did
 work. :)  FYI, hitting 'r' seems to do the trick; according to the manpage
 this is supposed to be 'radar', I don't know why that would be relevant here
 but it does do the trick.

Ah, heh... I pressed and clicked around but apparently managed to miss
R. When I do that it look like it works. I see a runway, but don't
know what to do anymore. :)

-- 
Regards,
Andreas Henriksson



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#413174: SEGFAULT when running acm

2007-03-06 Thread Steve Langasek
tags 413174 patch
thanks

Hi Phil,

Running acm under valgrind points to a couple bits of uninitialized memory
as the culprits here.  With the attached patch, acm starts up for me and
seems to work properly (or as properly as I guess I can expect without a
joystick).

Let me know if you want me to NMU.

Cheers,
-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
[EMAIL PROTECTED]   http://www.debian.org/
diff -u acm-5.0/src/dis_if.c acm-5.0/src/dis_if.c
--- acm-5.0/src/dis_if.c
+++ acm-5.0/src/dis_if.c
@@ -21,6 +21,8 @@
 
 #include stdio.h
 #include math.h
+#include stdlib.h
+#include string.h
 #ifndef WIN32
 #include sys/time.h
 #endif
@@ -381,7 +383,7 @@
  *  Allocate storage for the entity table and initialize it.
  */
 
-	entities = (Entity_t *) malloc(sizeof(Entity_t) * MAX_ENTITIES);
+	entities = (Entity_t *) calloc(MAX_ENTITIES, sizeof(Entity_t));
 	for (i = 0; i  MAX_ENTITIES; i++) {
 		entities[i].local = -1;
 	}
@@ -943,6 +945,7 @@
 	dis_pdu   pdu;
 	int   i;
 
+	memset(pdu,0,sizeof(dis_pdu));
 	if (network_enabled == 0) {
 		return 0;
 	}
diff -u acm-5.0/debian/changelog acm-5.0/debian/changelog
--- acm-5.0/debian/changelog
+++ acm-5.0/debian/changelog
@@ -1,3 +1,12 @@
+acm (5.0-23.1) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * High-urgency upload for RC bugfix.
+  * Fix several initialization bugs that can trigger crashes on some
+architectures.  Closes: #413174.
+
+ -- Steve Langasek [EMAIL PROTECTED]  Tue,  6 Mar 2007 18:05:34 -0800
+
 acm (5.0-23) unstable; urgency=low
 
   * Applied patch from Petr Salinger to fix FTBFS on GNU/kFreeBSD


Bug#413174: SEGFAULT when running acm

2007-03-03 Thread Phil Brooke

Hi,

Thanks for the report.

On Sat, 3 Mar 2007, andrea wrote:


the segfault occurs when load acm

-- System Information:
Debian Release: 4.0
 APT prefers testing
 APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-3-amd64
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)


I don't have a machine with this architecture available to test.  Are you 
willing and able to help debug the problem?


Thanks,

Phil.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Processed: Re: Bug#413174: SEGFAULT when running acm

2007-03-03 Thread Debian Bug Tracking System
Processing commands for [EMAIL PROTECTED]:

 severity 413174 important
Bug#413174: SEGFAULT when running acm
Severity set to `important' from `grave'

 thanks
Stopping processing here.

Please contact me if you need assistance.

Debian bug tracking system administrator
(administrator, Debian Bugs database)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#413174: SEGFAULT when running acm

2007-03-02 Thread andrea
Package: acm
Version: 5.0-23
Severity: grave
Justification: renders package unusable

the segfault occurs when load acm

-- Output:
$ acm
ACM version 5.0,  Copyright (C) 1991-1998   Riley Rainey ([EMAIL PROTECTED])

ACM comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it under the
conditions described in the COPYING file.

DIS protocol active.

This ACM program was built with sound support (netaudio).

About to start sound daemon.
Error setting up audio
Segmentation fault


dmesg:

acm[9919] general protection rip:2b91929271d5 rsp:7fff18b30c50 error:0
acm[10261] general protection rip:2b875f09a1d5 rsp:7fff4c3bd4f0 error:0

-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-3-amd64
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)

Versions of packages acm depends on:
ii  libaudio2   1.8-3The Network Audio System (NAS). (s
ii  libc6   2.3.6.ds1-11 GNU C Library: Shared libraries
ii  libx11-62:1.0.3-5X11 client-side library
ii  libxext61:1.0.1-2X11 miscellaneous extension librar
ii  libxt6  1:1.0.2-2X11 toolkit intrinsics library

acm recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]