Unity-Technologies / qstat

New official qstat repository
Artistic License 2.0
121 stars 33 forks source link

Bus Error (10) when network is down/disabled #78

Closed tdm4 closed 3 years ago

tdm4 commented 6 years ago

I discovered a Bus Error when the network is down or disabled. Here's a backtrace:

$ gdb qstat ./qstat.core
GNU gdb 6.3
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 "amd64-unknown-openbsd6.3"...
Core was generated by `qstat'.
Program terminated with signal 10, Bus error.
Loaded symbols for /usr/local/bin/qstat
Reading symbols from /usr/lib/libc.so.92.3...done.
Loaded symbols for /usr/lib/libc.so.92.3
Reading symbols from /usr/libexec/ld.so...done.
Loaded symbols for /usr/libexec/ld.so
#0  bind_sockets () at qstat.c:5023
5023                    next_server = server->next;
(gdb) bt
#0  bind_sockets () at qstat.c:5023
#1  0x000003a2b531cefc in do_work () at qstat.c:3136
#2  0x000003a2b531faec in main (argc=1450583696, argv=0x7f7fffff1368) at qstat.c:3976
Current language:  auto; currently minimal

It looks like it occurs in the bind_sockets() function on line 5023 (qstat.c in version 2.14) Perhaps it needs an extra check or something to prevent an error condition?

Steps to reproduce:

  1. Be on a UNIX like OS (I've not tested this on Linux)
  2. Bring down your network interfaces so there's no outbound network connectivity
  3. Run qstat on a server (I tried on a quake 2 server)
  4. Program dies with signal 10 (Bus error)
stevenh commented 3 years ago

Is this reproducible with the latest version?

tdm4 commented 3 years ago

Can confirm. Not reproducible with v2.16. It displays: ERROR <try again> instead of the bus error. Thanks!