From tommy at amberson.ca Fri Mar 18 19:00:26 2016 From: tommy at amberson.ca (Tommy Amberson) Date: Fri, 18 Mar 2016 18:00:26 -0600 Subject: [netrek-dev] Netrek In-Reply-To: References: Message-ID: Hello. I'm not sure whether this email address is still maintained, but I am having some problems installing a personal netrek server and was wondering if you could help me. The INSTALL file in the source code said "For assistance, write to netrek-dev at us.netrek.org." My problem is not exactly the installing. The configure, make, make install worked well. It is when I connect a client to it that things start going wrong. If a client sends any message, my server will say ***buffer overflow detected***: netserv terminated then it gives the backtrace and memory map meanwhile the client crashes (the program still runs but nothing happens no matter what you do). Whenever the server enters t-mode,kills a robot, or sometimes when another player enters the game the same thing happens. I'm also not sure if I am using the right software and hardware. I'm running Ubuntu 14.04 LTS on what used to be a windows desktop pc (hp pavilion elite m9425f PC). Any help or pointers would be very much appreciated. Thanks Tommy -------------- next part -------------- An HTML attachment was scrubbed... URL: From kevinz5000 at gmail.com Sun Mar 20 15:47:39 2016 From: kevinz5000 at gmail.com (Kevin Zheng) Date: Sun, 20 Mar 2016 13:47:39 -0700 Subject: [netrek-dev] Netrek In-Reply-To: References: Message-ID: <56EF0C6B.1080808@gmail.com> On 03/18/2016 17:00, Tommy Amberson wrote: > My problem is not exactly the installing. The configure, make, make > install worked well. It is when I connect a client to it that things > start going wrong. If a client sends any message, my server will say > ***buffer overflow detected***: netserv terminated then it gives the > backtrace and memory map meanwhile the client crashes (the program still > runs but nothing happens no matter what you do). Whenever the server > enters t-mode,kills a robot, or sometimes when another player enters the > game the same thing happens. > > I'm also not sure if I am using the right software and hardware. I'm > running Ubuntu 14.04 LTS on what used to be a windows desktop pc (hp > pavilion elite m9425f PC). If I remember correctly, the server doesn't work on 64-bit x86. Is that what you're using? Could you pastebin your backtrace? Thanks, Kevin -- Kevin Zheng kevinz5000 at gmail.com | kevinz at berkeley.edu | PGP: 0xC22E1090 From iggyvolz at gmail.com Sun Mar 20 17:37:25 2016 From: iggyvolz at gmail.com (iggyvolz .) Date: Sun, 20 Mar 2016 18:37:25 -0400 Subject: [netrek-dev] Netrek In-Reply-To: <56EF0C6B.1080808@gmail.com> References: <56EF0C6B.1080808@gmail.com> Message-ID: I recently tried installing netrek on an Ubuntu computer (that computer has since been wiped so I don't have any logs) but I remember it was a pain getting it installed. I believe I finally got it to work by installing -i386 libraries from apt-get. On Sun, Mar 20, 2016 at 4:47 PM, Kevin Zheng wrote: > On 03/18/2016 17:00, Tommy Amberson wrote: > > My problem is not exactly the installing. The configure, make, make > > install worked well. It is when I connect a client to it that things > > start going wrong. If a client sends any message, my server will say > > ***buffer overflow detected***: netserv terminated then it gives the > > backtrace and memory map meanwhile the client crashes (the program still > > runs but nothing happens no matter what you do). Whenever the server > > enters t-mode,kills a robot, or sometimes when another player enters the > > game the same thing happens. > > > > I'm also not sure if I am using the right software and hardware. I'm > > running Ubuntu 14.04 LTS on what used to be a windows desktop pc (hp > > pavilion elite m9425f PC). > > If I remember correctly, the server doesn't work on 64-bit x86. Is that > what you're using? > > Could you pastebin your backtrace? > > Thanks, > Kevin > > -- > Kevin Zheng > kevinz5000 at gmail.com | kevinz at berkeley.edu | PGP: 0xC22E1090 > _______________________________________________ > netrek-dev mailing list > netrek-dev at us.netrek.org > http://mailman.us.netrek.org/mailman/listinfo/netrek-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From quozl at netrek.org Mon Mar 21 01:29:55 2016 From: quozl at netrek.org (James Cameron) Date: Mon, 21 Mar 2016 17:29:55 +1100 Subject: [netrek-dev] netrek-server git force push to master Message-ID: <20160321062955.GB4882@us.netrek.org> https://github.com/quozl/netrek-server is up to date. Now that darcs 2.10 has good integration with git, it was possible to copy the patch history into my repository. -- James Cameron http://quozl.netrek.org/ From jrd at gerdesas.com Mon Mar 21 02:29:46 2016 From: jrd at gerdesas.com (John R. Dennison) Date: Mon, 21 Mar 2016 02:29:46 -0500 Subject: [netrek-dev] Netrek In-Reply-To: <56EF0C6B.1080808@gmail.com> References: <56EF0C6B.1080808@gmail.com> Message-ID: <20160321072946.GD5287@frodo.gerdesas.com> On Sun, Mar 20, 2016 at 01:47:39PM -0700, Kevin Zheng wrote: > > If I remember correctly, the server doesn't work on 64-bit x86. Is that > what you're using? Server works fine in 64bit. The bots, on the other hand, do not. They need to be compiled with -m32 in CFLAGS in their respective directory. John -- We only think when we are confronted with problems. -- John Dewey (1859-1952), American philosopher, educator -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From quozl at us.netrek.org Mon Mar 21 03:02:07 2016 From: quozl at us.netrek.org (James Cameron) Date: Mon, 21 Mar 2016 19:02:07 +1100 Subject: [netrek-dev] Netrek In-Reply-To: <20160321072946.GD5287@frodo.gerdesas.com> References: <56EF0C6B.1080808@gmail.com> <20160321072946.GD5287@frodo.gerdesas.com> Message-ID: <20160321080207.GD4882@us.netrek.org> Agreed, works fine in 64-bit. I've just tested git head. -- James Cameron http://quozl.netrek.org/ From jrd at gerdesas.com Mon Mar 21 03:09:16 2016 From: jrd at gerdesas.com (John R. Dennison) Date: Mon, 21 Mar 2016 03:09:16 -0500 Subject: [netrek-dev] Netrek In-Reply-To: <20160321080207.GD4882@us.netrek.org> References: <56EF0C6B.1080808@gmail.com> <20160321072946.GD5287@frodo.gerdesas.com> <20160321080207.GD4882@us.netrek.org> Message-ID: <20160321080916.GE5287@frodo.gerdesas.com> On Mon, Mar 21, 2016 at 07:02:07PM +1100, James Cameron wrote: > Agreed, works fine in 64-bit. I've just tested git head. Including the bot framework for pre-t? That was the one that gave us problems over the past few years and I don't recall any work done towards fixing that. At least nothing that ever made it in. But I'm old and my memory is going so... John -- Life is the path you beat while you walk it. It is the walking that beats the path. It is not the path that makes the walk. -- Antonio Cipriano JosF MarFa y Francisco de Santa Ana Machado y Ruiz (1875-1939), known as Antonio Machado, Spanish poet -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From quozl at us.netrek.org Mon Mar 21 03:19:30 2016 From: quozl at us.netrek.org (James Cameron) Date: Mon, 21 Mar 2016 19:19:30 +1100 Subject: [netrek-dev] Netrek In-Reply-To: <20160321080916.GE5287@frodo.gerdesas.com> References: <56EF0C6B.1080808@gmail.com> <20160321072946.GD5287@frodo.gerdesas.com> <20160321080207.GD4882@us.netrek.org> <20160321080916.GE5287@frodo.gerdesas.com> Message-ID: <20160321081930.GE4882@us.netrek.org> On Mon, Mar 21, 2016 at 03:09:16AM -0500, John R. Dennison wrote: > On Mon, Mar 21, 2016 at 07:02:07PM +1100, James Cameron wrote: > > Agreed, works fine in 64-bit. I've just tested git head. > > Including the bot framework for pre-t? Good point. No, not tested. Tommy didn't mention that; he used INSTALL not INSTALL.Newbie. The message he describes is consistent with using the latest release instead of the latest source. https://github.com/quozl/netrek-server/commit/1971404ab1068f83333745e97d1e47316a77d10f is where _FORTIFY_SOURCE was turned off. -- James Cameron http://quozl.netrek.org/ From quozl at us.netrek.org Mon Mar 21 06:00:27 2016 From: quozl at us.netrek.org (James Cameron) Date: Mon, 21 Mar 2016 22:00:27 +1100 Subject: [netrek-dev] netrek-client-cow and gytha git repositories added on github Message-ID: <20160321110026.GA24541@us.netrek.org> https://github.com/quozl/netrek-client-cow https://github.com/quozl/gytha -- James Cameron http://quozl.netrek.org/ From quozl at us.netrek.org Tue Mar 22 03:52:01 2016 From: quozl at us.netrek.org (James Cameron) Date: Tue, 22 Mar 2016 19:52:01 +1100 Subject: [netrek-dev] Netrek In-Reply-To: <20160321072946.GD5287@frodo.gerdesas.com> References: <56EF0C6B.1080808@gmail.com> <20160321072946.GD5287@frodo.gerdesas.com> Message-ID: <20160322085201.GA18822@us.netrek.org> On Mon, Mar 21, 2016 at 02:29:46AM -0500, John R. Dennison wrote: > Server works fine in 64bit. The bots, on the other hand, do not. > They need to be compiled with -m32 in CFLAGS in their respective > directory. Symptom: bots don't get a ship, because they abort with "Packet fragment. Server must be dead.", because their definition of SP_LOGIN packet is 112 instead of 108 bytes, because long flags; is sixteen and not eight bytes as it was once upon a time. robotd/packets.h needs the ntserv/packets.h definitions, 'cause what it has now has 32-bit assumptions. -- James Cameron http://quozl.netrek.org/ From tommy at amberson.ca Tue Mar 22 11:14:04 2016 From: tommy at amberson.ca (Tommy Amberson) Date: Tue, 22 Mar 2016 10:14:04 -0600 Subject: [netrek-dev] Netrek In-Reply-To: <20160321072946.GD5287@frodo.gerdesas.com> References: <56EF0C6B.1080808@gmail.com> <20160321072946.GD5287@frodo.gerdesas.com> Message-ID: I'm not sure what you meant by compiling the bots with -m32 in CFLAGS in their respective directory. I tried adding -m32 to the makefile in the line that said CFLAGS=... . I think that worked for the bots because now pre-t entertainment mostly works. I also look at the github link where _FORTIFY_SOURCE was turned off and added that flag to my system.mk files. However whenever a client sends a message and sometimes when the server sends messages (like in pre-T when a planet gets taken) it still causes a buffer overflow and kills netserv so the client has to reconnect even though pre-t goes on without changing. On Mon, Mar 21, 2016 at 1:29 AM, John R. Dennison wrote: > On Sun, Mar 20, 2016 at 01:47:39PM -0700, Kevin Zheng wrote: > > > > If I remember correctly, the server doesn't work on 64-bit x86. Is that > > what you're using? > > Server works fine in 64bit. The bots, on the other hand, do not. They > need to be compiled with -m32 in CFLAGS in their respective directory. > > > > > > John > -- > We only think when we are confronted with problems. > > -- John Dewey (1859-1952), American philosopher, educator > -------------- next part -------------- An HTML attachment was scrubbed... URL: From quozl at us.netrek.org Tue Mar 22 15:09:05 2016 From: quozl at us.netrek.org (James Cameron) Date: Wed, 23 Mar 2016 07:09:05 +1100 Subject: [netrek-dev] Netrek In-Reply-To: References: <56EF0C6B.1080808@gmail.com> <20160321072946.GD5287@frodo.gerdesas.com> Message-ID: <20160322200905.GA30243@us.netrek.org> Thanks Tommy. On the one hand, let's resolve the ambiguity about why your server is overflowing a buffer on messaging. If we knew the exact line of code that was failing we could pinpoint it accurately. But to do you must attach gdb to ntserv just before it fails, then capture a backtrace. % gdb -p $(pgrep ntserv) lib/ntserv (gdb) continue (gdb) bt On the other hand, the latest source doesn't have the problem; tested Ubuntu 14.04 LTS. The fix was already applied. In doing the above we'd only learn exactly how old your source was. I've tried looking for the fix, but there are so many, and I don't know which version of the server you are using. Your quickest fix should be to use the latest source, which I've tested repeatedly and does not do for me what you observe. Please clone from git, run autogen.sh, then follow INSTALL. git clone https://github.com/quozl/netrek-server.git cd netrek-server ./autogen.sh My best guess is that you followed http://netrek.org/ to http://www.netrek.org/files/Vanilla/ which had said the latest release of the server was 2.14 from 2008. That directory was out of date, and I've fixed it now. Latest is 2.18 from 2011, but the latest source in git is the best. http://vanilla.netrek.org/ was up to date. On Tue, Mar 22, 2016 at 10:14:04AM -0600, Tommy Amberson wrote: > I'm not sure what you meant by compiling the bots with?-m32 in CFLAGS in their > respective directory. I tried adding -m32 to the makefile in the line that said > CFLAGS=... . I think that worked for the bots because now pre-t entertainment > mostly works. I also look at the github link?where _FORTIFY_SOURCE was turned > off and added that flag to my [1]system.mk files. However whenever a client > sends a message and sometimes when the server sends messages (like in pre-T > when a planet gets taken) it still causes a buffer overflow and kills netserv > so the client has to reconnect even though pre-t goes on?without changing. > > On Mon, Mar 21, 2016 at 1:29 AM, John R. Dennison <[2]jrd at gerdesas.com> wrote: > > On Sun, Mar 20, 2016 at 01:47:39PM -0700, Kevin Zheng wrote: > > > > If I remember correctly, the server doesn't work on 64-bit x86. Is that > > what you're using? > > Server works fine in 64bit.? The bots, on the other hand, do not.? They > need to be compiled with -m32 in CFLAGS in their respective directory. > > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? John > -- > We only think when we are confronted with problems. > > -- John Dewey (1859-1952), American philosopher, educator > > References: > > [1] http://system.mk/ > [2] mailto:jrd at gerdesas.com -- James Cameron http://quozl.netrek.org/ From quozl at us.netrek.org Tue Mar 22 17:27:46 2016 From: quozl at us.netrek.org (James Cameron) Date: Wed, 23 Mar 2016 09:27:46 +1100 Subject: [netrek-dev] Netrek In-Reply-To: <20160322200905.GA30243@us.netrek.org> References: <56EF0C6B.1080808@gmail.com> <20160321072946.GD5287@frodo.gerdesas.com> <20160322200905.GA30243@us.netrek.org> Message-ID: <20160322222746.GC30243@us.netrek.org> Tommy says it worked from git, so it was an old server release. Lesson for next time; check the version. -- James Cameron http://quozl.netrek.org/ From quozl at us.netrek.org Sun Mar 27 00:38:35 2016 From: quozl at us.netrek.org (James Cameron) Date: Sun, 27 Mar 2016 16:38:35 +1100 Subject: [netrek-dev] Netrek In-Reply-To: <20160322085201.GA18822@us.netrek.org> References: <56EF0C6B.1080808@gmail.com> <20160321072946.GD5287@frodo.gerdesas.com> <20160322085201.GA18822@us.netrek.org> Message-ID: <20160327053835.GA11314@us.netrek.org> On Tue, Mar 22, 2016 at 07:52:01PM +1100, James Cameron wrote: > On Mon, Mar 21, 2016 at 02:29:46AM -0500, John R. Dennison wrote: > > Server works fine in 64bit. The bots, on the other hand, do not. > > They need to be compiled with -m32 in CFLAGS in their respective > > directory. > > Symptom: bots don't get a ship, because they abort with "Packet > fragment. Server must be dead.", because their definition of SP_LOGIN > packet is 112 instead of 108 bytes, [...] It was easy. Fixed in git by using ISO C99 types: https://github.com/quozl/netrek-server/commit/988ee156d4f76e085a53e5fead9ada15ba686b61 The robots work reasonably well now on 64-bit, though there's a couple of problems that have little impact; - UDP negotiation fails, so they remain on TCP, - an SP_FEATURE (60) packet is received, which is unsupported, and causes a spurious message only. -- James Cameron http://quozl.netrek.org/ From netrek at gmail.com Sun Mar 27 04:13:33 2016 From: netrek at gmail.com (Zachary Uram) Date: Sun, 27 Mar 2016 05:13:33 -0400 Subject: [netrek-dev] Netrek In-Reply-To: <20160327053835.GA11314@us.netrek.org> References: <56EF0C6B.1080808@gmail.com> <20160321072946.GD5287@frodo.gerdesas.com> <20160322085201.GA18822@us.netrek.org> <20160327053835.GA11314@us.netrek.org> Message-ID: Nice. On Sun, Mar 27, 2016 at 1:38 AM, James Cameron wrote: > On Tue, Mar 22, 2016 at 07:52:01PM +1100, James Cameron wrote: > > On Mon, Mar 21, 2016 at 02:29:46AM -0500, John R. Dennison wrote: > > > Server works fine in 64bit. The bots, on the other hand, do not. > > > They need to be compiled with -m32 in CFLAGS in their respective > > > directory. > > > > Symptom: bots don't get a ship, because they abort with "Packet > > fragment. Server must be dead.", because their definition of SP_LOGIN > > packet is 112 instead of 108 bytes, [...] > > It was easy. Fixed in git by using ISO C99 types: > > > https://github.com/quozl/netrek-server/commit/988ee156d4f76e085a53e5fead9ada15ba686b61 > > The robots work reasonably well now on 64-bit, though there's a couple > of problems that have little impact; > > - UDP negotiation fails, so they remain on TCP, > > - an SP_FEATURE (60) packet is received, which is unsupported, and > causes a spurious message only. > > -- > James Cameron > http://quozl.netrek.org/ > _______________________________________________ > netrek-dev mailing list > netrek-dev at us.netrek.org > http://mailman.us.netrek.org/mailman/listinfo/netrek-dev > -- http://www.fidei.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From quozl at us.netrek.org Tue Mar 29 01:27:06 2016 From: quozl at us.netrek.org (James Cameron) Date: Tue, 29 Mar 2016 17:27:06 +1100 Subject: [netrek-dev] ntserv buffer overflow on messaging In-Reply-To: <20160322200905.GA30243@us.netrek.org> References: <56EF0C6B.1080808@gmail.com> <20160321072946.GD5287@frodo.gerdesas.com> <20160322200905.GA30243@us.netrek.org> Message-ID: <20160329062706.GA23351@us.netrek.org> On Wed, Mar 23, 2016 at 07:09:05AM +1100, James Cameron wrote: > On the one hand, let's resolve the ambiguity about why your server is > overflowing a buffer on messaging. If we knew the exact line of code > that was failing we could pinpoint it accurately. [...] With _FORTIFY_SOURCE removed temporarily, the buffer overflow comes back as expected. The cause is Tedd Hadley and Heiko Wengler's amazing short packets code from 24th May 1993, which relies on strcpy to overflow the destination string without complaint: https://github.com/quozl/netrek-server/blob/master/ntserv/genspkt.c#L995 The source string is a message, e.g. " testing". The destination string is a one character buffer in the short packet structure: https://github.com/quozl/netrek-server/blob/master/include/packets.h#L1011 Original intent was for the data to be written over the bytes in the packet, overflowing into the remainder of the structure fields. It is an intentional overflow, which the fortify wrappers are enthusiastically reporting as a problem. There will be plenty more where that came from. ;-) -- Method to test on client: netrek-client-cow -h server_ip -s 9292 Method to test on server: ulimit -c unlimited lib/ntserv -q 9 -s 9292 -d client_ip gdb lib/ntserv core Backtrace as captured: (gdb) bt #0 0x00007f6658600cc9 in raise () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x00007f6658604218 in abort () from /lib/x86_64-linux-gnu/libc.so.6 #2 0x00007f665863d394 in ?? () from /lib/x86_64-linux-gnu/libc.so.6 #3 0x00007f66586d4c9c in __fortify_fail () from /lib/x86_64-linux-gnu/libc.so.6 #4 0x00007f66586d3b60 in __chk_fail () from /lib/x86_64-linux-gnu/libc.so.6 #5 0x000000000041057f in strcpy (__src=0x7f6659288f31 " testing", __dest=0x7ffdd8f686c5 " ") at /usr/include/x86_64-linux-gnu/bits/string3.h:104 #6 updtMessage (msg=msg at entry=0x7ffdd8f686c0, cur=cur at entry=0x7f6659288f18) at genspkt.c:995 #7 0x00000000004116eb in updateMessages () at genspkt.c:1698 #8 0x00000000004206ad in updateClient () at socket.c:623 #9 0x0000000000407a91 in intrupt () at redraw.c:119 #10 0x00000000004063c9 in setflag () at input.c:42 #11 input () at input.c:122 #12 0x00000000004038b5 in main (argc=0, argv=) at main.c:461 (gdb) -- James Cameron http://quozl.netrek.org/