FredyH / GWSockets

WebSockets for GLua
MIT License
87 stars 7 forks source link

Debian 10 64bit support #16

Closed xcpep closed 4 years ago

xcpep commented 4 years ago

Hey,

For reference:

I'm getting some issues trying to use this module on my server. When I used the pre-compiled DLLs from the releases page it will never load the module and my script can never require "gwsockets".

However, if I build the 64 bit version from source and include, I still cannot load the module which returns the error:

Couldn't include file 'includes/modules/gwsockets.lua' (File not found) (@addons/testing/lua/autorun/server/sv_test.lua (line 2))

[ERROR] addons/testing/lua/autorun/server/sv_test.lua:2: Couldn't load module library!
  1. require - [C]:-1
   2. unknown - addons/testing/lua/autorun/server/sv_test.lua:2

Oddly, if I compile the 32 bit version, I no longer get this error, however the server will crash due to a segmentation fault:

Segmentation fault (core dumped)
BFD: warning: /home/gs/gmod1/serverfiles/core is truncated: expected core file size >= 562954240, found: 1449984
Cannot access memory at address 0xf7efe934
Cannot access memory at address 0xf7efe930
Failed to read a valid object file image from memory.
Cannot access memory at address 0xf7efe934
Cannot access memory at address 0xf7efe930
debug.cmds:5: Error in sourced command file:
No function contains program counter for selected frame.
email debug.log to linux@valvesoftware.com
Sat 29 Feb 2020 04:51:00 AM EST: Server restart in 10 seconds
Sat 29 Feb 2020 04:51:01 AM EST: Server Quit

I've tried all of the linux 32 & 64bit builds in the releases, of which none worked for me, and I have built from the GitHub source files and also tried building by replacing the _libboostsystem.a libcrypto.a libssl.a files with the ones installed on my system, but still cannot get the module to load or be required in my script.

This is the output running ldd on the binary I built:

ldd gmsv_gwsockets_linux64.dll 
    linux-vdso.so.1 (0x00007ffdb99a4000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f3d24cce000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f3d24945000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f3d2472d000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3d2433c000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f3d255a4000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3d23f9e000)
xcpep commented 4 years ago

So after deeper searching, I've found that the issue appears to be when compiling, however I've checked the flags and -m32 and -m64 appear to be used correctly so I'm not sure where this error may still be happening from.

Couldn't include file 'includes/modules/string.lua' (File not found) (<nowhere>)
Ignore the above error about being unable to include string.lua, it means Garry is being an ass

[ERROR] error loading module 'gwsockets' from file 'gmsv_gwsockets_linux.dll':
    /home/gs/gmod1/serverfiles/garrysmod/lua/bin/gmsv_gwsockets_linux.dll: wrong ELF class: ELFCLASS64
  1. error - [C]:-1
   2. searcher - lua/includes/modules/require.lua:58
    3. require - lua/includes/modules/require.lua:140
     4. unknown - addons/testing/lua/autorun/server/sv_test.lua:6
FredyH commented 4 years ago

Fixed in latest release.