OpenParsec / openparsec

GNU General Public License v2.0
51 stars 8 forks source link

parsec client / server segfault on start #58

Closed mattthias closed 2 years ago

mattthias commented 2 years ago

Hi,

i compiled the parsec client and server from master ( 449965c520444b1e523f3c685a714a44952476c2 ) on Debian 11 (bullseye). I had to apply a small patch before i was able to compile, see #57 for more information on this.

I'm using this commands:

 git clone --recursive  https://github.com/openparsec/openparsec
 cd openparsec/platforms/premake
 premake4 gmake
 make config=debug64

The result looks good from the outside:

 $ LANG=C file client/parsec  server/parsec_server 
client/parsec:        ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1c66dcd8ae75fba0f8e4324a7894a631b106891c, for GNU/Linux 3.2.0, with debug_info, not stripped
server/parsec_server: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=c91528af7a23fc27d7b5a93f262451e8788e0233, for GNU/Linux 3.2.0, with debug_info, not stripped

I copied all files from openparsec-assets/to parsec_root/client/ and run the client -> Segmentation fault.

The logfile parsec.log.

Running parsec client through gdb shows this:

matthias@thinker:/tmp/openparsec/parsec_root/client (fix_isnan)$ gdb ./parsec 
GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./parsec...
(gdb) run
Starting program: /tmp/openparsec/parsec_root/client/parsec 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff5c94700 (LWP 27741)]
[New Thread 0x7fffece44700 (LWP 27742)]
[New Thread 0x7fffe7fff700 (LWP 27743)]
[New Thread 0x7fffe77fe700 (LWP 27744)]
[New Thread 0x7fffe6ffd700 (LWP 27745)]

Thread 1 "parsec" received signal SIGSEGV, Segmentation fault.
ODT_SwapBSPTree (node=1, inlist=0) at ../../../../src/libparsec/obj_odt.cpp:782
782     odt_tree[ node ].Polygon   = SWAP_32( odt_tree[ node ].Polygon );
(gdb) backtrace 
#0  ODT_SwapBSPTree(int, int) (node=1, inlist=0) at ../../../../src/libparsec/obj_odt.cpp:782
#1  0x00005555555b4523 in ODT_CreateObject(ODT_GenObject*, unsigned int, shader_s*) (cobj=0x555555833a40, flags=16905, shader=0x0) at ../../../../src/libparsec/obj_odt.cpp:1019
#2  0x00005555555b7000 in InitClassFromODT(unsigned int, unsigned int, shader_s*) (classid=0, flags=32768, shader=0x0) at ../../../../src/libparsec/obj_odt.cpp:2014
#3  0x00005555555b7055 in OBJ_LoadODT(unsigned int, unsigned int, shader_s*) (classid=0, flags=32768, shader=0x0) at ../../../../src/libparsec/obj_odt.cpp:2039
#4  0x00005555556004a2 in LoadObjectData() () at ../../../../src/parsec/e_loader.cpp:1205
#5  0x000055555560050a in LoadData(char*, int) (cfn=0x5555556e09e8 <ctrl_h_h> "ctrl_h_h.dat", dispinfo=1) at ../../../../src/parsec/e_loader.cpp:1234
#6  0x000055555561476b in main(int, char**) (argc=1, argv=0x7fffffffe268) at ../../../../src/parsec/sl_main.cpp:390
(gdb) 
uberlinuxguy commented 2 years ago

You are trying to compile and run a 64-bit version. Openparsec doesn't support 64-bits yet. See #7 it's.... not an easy task to fix.

Realistically, and with the disclaimer that it's been years since I have looked at the code, there are entire portions that should probably get rewritten. Object handling, for example, is very old and archaic. It could use to be modernized. I am no 3D modeling programmer, so it's over my head, under my feet, and out of my reach.

uberlinuxguy commented 2 years ago

I'm not going to lie, you are re-kinndling my interest slightly. But beware, here there be dragons. And they are old, cranky, and you are crunchy and taste good with ketchup (of the dragon variety...)

mattthias commented 2 years ago

Ok, I had this in my head but because the "debug64" / "release64" configs in the Makefile I was under the impression that 64 bit OS is supported. I'll grab an old laptop and install an i386 Debian and try again. But not today it's nearly 2.am. here :-D.

uberlinuxguy commented 2 years ago

There was some preliminary work done waaaaay back in the day. It's not clear how far the person in question got. I would love to see it run on 64-bit... Perhaps I'll give myself a refresher on what was going on there. It might be that types have to be changed to be more in line with the 64-bit modern compilers.... there was also some mention of alignment issues in structs. I think it goes pretty deep.

Cheeseness commented 2 years ago

Does premake have options/targets for building 32 bit in a 64 bit environment?

mattthias commented 2 years ago

I tried to compile it in a 32bit Debian chroot and bämm all works.

The server starts in the chroot and even the client starts and plays music -> but no video.

I also wrote down the steps to build in a fresh chroot:

https://github.com/mattthias/openparsec/blob/2d12276ee554c5b0967abafd07339613cbe614ca/README.md?plain=1#L19

CrazySpence commented 2 years ago

Yea it needs a 64bit overhaul, maybe that can be the 20 year goal (1 year 4 months from now)

uberlinuxguy commented 2 years ago

Might try this soon on my Ubuntu box and see if it works. Might be something as simple as updating the GL calls .... I thought it used SDL to wrap most of that.... but... it's been so long...

uberlinuxguy commented 2 years ago

Anyone got an issue if I close this as a dup of #7 ?

mattthias commented 2 years ago

Duplicate of #7