Bug#401773: netpanzer: client doesn't detect server shutdown, eats 100% cpu

Fabian Fagerholm fabbe at paniq.net
Tue Dec 5 21:35:54 CET 2006


Package: netpanzer
Version: 0.8+svn20060319-2
Severity: normal

While playing a game over the internet, my netpanzer server said:

<2006-12-05 22:24:10>Detected endless loop. Shutting down.
Closing logfile.
Network send error when sending to client 61: Send error: Couldn't send
all data.
Received signal SIGSEGV(11)
aborting and trying to shutdown.
Segmentation fault

That's probably bad enough on itself, but the client went crazy and ate
100% CPU. strace showed this repeatedly:

time([1165350381])                      = 1165350381
time([1165350381])                      = 1165350381
write(9, "\222\3\n\0\r\0\0\3\16\0\0\3\0\4\0\3\0\0\0\0\0\4\0\3\0\0"..., 44) = 44
read(9, "\1\1\210\"\0\0\0\0\3\0\0\3\4\0\0\0\0\0\0\0\4\0\0\0\360"..., 32) = 32
recv(11, "", 4096, 0)                   = 0
select(9, [8], NULL, NULL, {0, 0})      = 1 (in [8], left {0, 0})

After 10-15 minutes, I got tired of waiting, and clicked a tank and told it
to move to another square. Only then did the client react, by instantly
closing. The strace showed this:

ioctl(8, FIONREAD, [32])                = 0
read(8, "\5\1t\fh\247KT\\\0\0\0\r\0\0\3\0\0\0\0z\1\235\0u\1k\0\0"..., 32) = 32
select(9, [8], NULL, NULL, {0, 0})      = 0 (Timeout)
select(9, [8], NULL, NULL, {0, 0})      = 0 (Timeout)
send(11, "=\0\0\0\2\34\0\6\0=\30\0\1\0E\1\0\0K\1\0\0\0\0\0\0\0\0"..., 61, 0) = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) @ 0 (0) ---
write(2, "An unexpected exception occured:"..., 74) = 74
write(3, "An unexpected exception occured:"..., 74) = 74
futex(0xa7927bf8, FUTEX_WAIT, 5062, NULL) = 0
futex(0xa70d2bf8, FUTEX_WAIT, 5065, NULL) = 0
poll([{fd=4, events=POLLIN|POLLERR|POLLNVAL, revents=POLLIN}], 1, -1) = 1
read(4, "\1\0\0\0\355\325uE@\22i\34\1\0\0\0", 64) = 16
poll([{fd=4, events=POLLIN|POLLERR|POLLNVAL, revents=POLLIN}], 1, -1) = 1
read(4, "\1\0\0\0\355\325uEx\216\256\35\1\0\0\0", 64) = 16
poll([{fd=4, events=POLLIN|POLLERR|POLLNVAL, revents=POLLIN}], 1, -1) = 1
ioctl(4, 0x54a1, 0x4a)                  = 0
read(4, "\1\0\0\0\355\325uEh\26\364\36\1\0\0\0", 64) = 16
read(4, 0xafbeb914, 64)                 = -1 EAGAIN (Resource temporarily unavailable)
ioctl(4, 0x54a1, 0xa7f472f9)            = 0
read(4, 0xafbeb964, 64)                 = -1 EAGAIN (Resource temporarily unavailable)
close(4)                                = 0
semop(851978, 0xafbeb99a, 2)            = 0
munmap(0xa7f27000, 65536)               = 0
close(5)                                = 0
munmap(0xa7f38000, 4096)                = 0
munmap(0xa7f37000, 4096)                = 0
shmdt(0xa70d3000)                       = 0
shmctl(2981909, IPC_64|IPC_STAT, 0xafbeb90c) = 0
shmctl(2981909, IPC_64|IPC_RMID, 0)     = 0
shmdt(0xa7f39000)                       = 0
shmctl(2916372, IPC_64|IPC_STAT, 0xafbeb90c) = 0
semop(851978, 0xafbeb9a6, 1)            = 0
close(6)                                = 0
rt_sigaction(SIGINT, {SIG_DFL}, {0x804dd00, [INT], SA_RESTART}, 8) = 0
rt_sigaction(SIGINT, {0x804dd00, [INT], SA_RESTART}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGTERM, {SIG_DFL}, {0x804dd00, [TERM], SA_RESTART}, 8) = 0
rt_sigaction(SIGTERM, {0x804dd00, [TERM], SA_RESTART}, {SIG_DFL}, 8) = 0
write(8, "_\3\2\0\v\0\0\3+\0\1\0", 12)  = 12
read(8, "\1\1v\f\0\0\0\0\3\0\0\3\4\0\0\0\0\0\0\0\4\0\0\0\360$\34"..., 32) = 32
write(9, "+\3\1\0", 4)                  = 4
read(9, "\1\1\211\"\0\0\0\0\3\0\0\3\4\0\0\0(\0\0\0\4\0\0\0\360$"..., 32) = 32
write(8, "\222\2\2\0\17\0\0\3+\0\1\0", 12) = 12
read(8, "\1\1x\f\0\0\0\0\3\0\0\3\4\0\0\0\0\0\0\0\4\0\0\0\360$\34"..., 32) = 32
shmdt(0xa5a32000)                       = 0
write(8, "\n\2\2\0\3\0\0\3\4\0\2\0\r\0\0\3<\0\2\0\16\0\0\3O\0\2\0"..., 36) = 36
read(8, "\22\270y\f\3\0\0\3\3\0\0\3\0\0\0\3\1\0\0\300\1\0\0\0\0"..., 32) = 32
read(8, "\n\3y\f\3\0\0\3\0\375\272\10x\270\327\257\360$\34\10\0"..., 32) = 32
read(8, "\t\5y\f\3\0\0\3\0000%\10\230\267\327\257M\10\t\10\5\0\0"..., 32) = 32
read(8, "\v\0\0\0\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
read(8, "\10\0y\f\321\247KT\\\0\0\0\r\0\0\3\0\0\0\0z\1\235\0u\1"..., 32) = 32
read(8, "\1\0}\f\0\0\0\0\0\0\0\0\1\1\0\0\4\0\0\0\0\0\0\0\4\0\0\0"..., 32) = 32
write(8, "k\2\3\0\0\0\0\0\1\1\2\0\212\4\1\0_\0\2\0\7\0\0\3+\0\1\0"..., 28) = 28
read(8, "\1\1\201\f\0\0\0\0\1\0\0\0\4\0\0\0\0\0\0\0\4\0\0\0\360"..., 32) = 32
write(9, "<\3\2\0\0\0 \3+\0\1\0", 12)   = 12
read(9, "\1\1\213\"\0\0\0\0\1\0\0\0\4\0\0\0\0\0\0\0\4\0\0\0\360"..., 32) = 32
shutdown(9, 2 /* send and receive */)   = 0
close(9)                                = 0
write(8, "<\2\2\0\0\0\0\3+\1\1\0", 12)  = 12
read(8, "\1\1\203\f\0\0\0\0\1\0\0\0\4\0\0\0\0\0\0\0\4\0\0\0\360"..., 32) = 32
shutdown(8, 2 /* send and receive */)   = 0
close(8)                                = 0
munmap(0xa5d40000, 13020)               = 0
munmap(0xa5d4c000, 56060)               = 0
rt_sigaction(SIGSEGV, NULL, {0x804dd00, [SEGV], SA_RESTART}, 8) = 0
rt_sigaction(SIGBUS, NULL, {0x804dd00, [BUS], SA_RESTART}, 8) = 0
rt_sigaction(SIGFPE, NULL, {0x804dd00, [FPE], SA_RESTART}, 8) = 0
rt_sigaction(SIGQUIT, NULL, {SIG_DFL}, 8) = 0
lstat64("/home/fabbe/.netpanzer/config", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
lstat64("/home/fabbe/.netpanzer/config", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
lstat64("/home/fabbe/.netpanzer/config/netpanzer.ini", {st_mode=S_IFREG|0600, st_size=1216, ...}) = 0
lstat64("/home/fabbe/.netpanzer/config/netpanzer.ini", {st_mode=S_IFREG|0600, st_size=1216, ...}) = 0
open("/home/fabbe/.netpanzer/config/netpanzer.ini", O_WRONLY|O_CREAT|O_TRUNC, 0600) = 4
write(4, "[game]\n\n[interface]\nattacknotifi"..., 1024) = 1024
write(4, "\n", 1)                       = 1
write(4, "effects=yes\neffectsvolume=100\nen"..., 191) = 191
fsync(4)                                = 0
close(4)                                = 0
write(3, "Closing logfile.\n", 17)      = 17
fsync(3)                                = 0
close(3)                                = 0
fsync(7)                                = 0
close(7)                                = 0
munmap(0xa4886000, 7802880)             = 0
munmap(0xa57f8000, 311296)              = 0
exit_group(1)                           = ?
Process 5061 detached

The above is probably useless for most debugging, but it should be
recorded in the BTS that this program has many latent bugs.

-- 
Fabian Fagerholm <fabbe at paniq.net>

-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-1-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages netpanzer depends on:
ii  libc6                  2.3.6.ds1-8       GNU C Library: Shared libraries
ii  libgcc1                1:4.1.1-19        GCC support library
ii  libphysfs-1.0-0        1.0.0-5           filesystem abstraction library for
ii  libsdl-image1.2        1.2.5-2+b1        image loading library for Simple D
ii  libsdl-mixer1.2        1.2.6-1.1+b2      mixer library for Simple DirectMed
ii  libsdl1.2debian        1.2.11-7          Simple DirectMedia Layer
ii  libstdc++6             4.1.1-19          The GNU Standard C++ Library v3
ii  netpanzer-data         0.8+svn20060319-1 data files for the netPanzer game

netpanzer recommends no packages.

-- no debconf information




More information about the Pkg-games-devel mailing list