Cuberite Forum
Change path where MCServer looks for libraries - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Discussion (https://forum.cuberite.org/forum-5.html)
+--- Thread: Change path where MCServer looks for libraries (/thread-1984.html)

Pages: 1 2


Change path where MCServer looks for libraries - Mathias - 05-28-2015

Hello,
Is there any way to change the path where MCServer looks for libraries? I need to replace a few outdated libraries to make MCServer run successfully, but I don't have any root access on the server/machine I'm using.


RE: Change path where MCServer looks for libraries - bearbin - 05-28-2015

I assume that you're talking about glibc and glibCXX, right?

If that's the case, do you have (CMake AND make AND (GCC OR clang)) installed? You should be able to compile the server yourself without root access if you have those programs installed.


RE: Change path where MCServer looks for libraries - tigerw - 05-28-2015

bearbin uses logical statements!

...

If you already have a newer library sitting somewhere, apparently this: http://unix.stackexchange.com/questions/24811/changing-linked-library-for-a-given-executable-centos-6 will work too.


RE: Change path where MCServer looks for libraries - Mathias - 05-28-2015

"I assume that you're talking about glibc and glibCXX, right?"

That's correct. Here are the errors:
Code:
./MCServer: /lib64/libm.so.6: version `GLIBC_2.15' not found (required by ./MCServer)
./MCServer: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./MCServer)
./MCServer: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by ./MCServer)
./MCServer: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by ./MCServer)
./MCServer: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by ./MCServer)
./MCServer: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.5' not found (required by ./MCServer)
./MCServer: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by ./MCServer)
./MCServer: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.19' not found (required by ./MCServer)
./MCServer: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by ./MCServer)
./MCServer: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./MCServer)

The server has CMake, make and GCC.


RE: Change path where MCServer looks for libraries - bearbin - 05-28-2015

Here's a guide on how to compile the server yourself. It should take 10-15 minutes.

http://book.mc-server.org/#1.2


RE: Change path where MCServer looks for libraries - Mathias - 05-28-2015

(05-28-2015, 01:56 AM)tigerw Wrote: bearbin uses logical statements!

...

If you already have a newer library sitting somewhere, apparently this: http://unix.stackexchange.com/questions/24811/changing-linked-library-for-a-given-executable-centos-6 will work too.
I've changed the LD_LIBRARY_PATH, but the MCServer executable still uses the old library paths.

echo $LD_LIBRARY_PATH returns the path I changed to.

(05-28-2015, 02:01 AM)bearbin Wrote: Here's a guide on how to compile the server yourself. It should take 10-15 minutes.

http://book.mc-server.org/#1.2
I can't compile MCServer directly on the server, as it only has version 4.4.7 of gcc. :/ Compiling a newer version of gcc will hit a file amount limit on the server.


RE: Change path where MCServer looks for libraries - tigerw - 05-28-2015

From that link, it also suggests that /lib/ld-linux.so.2 --library-path path executable will work?


RE: Change path where MCServer looks for libraries - Mathias - 05-28-2015

I have solved the problem by adding an rpath to the MCServer executable. The tool is used is PatchELF: http://nixos.org/patchelf.html


RE: Change path where MCServer looks for libraries - Mathias - 05-28-2015

Replacing libraries wasn't a good idea after all... Segmentation fault. :/

The problem seems to be the dynamic linker, which still uses the default library path.


RE: Change path where MCServer looks for libraries - Mathias - 05-28-2015

Changed the dynamic linker, now the server seems to start up at least. A new segfault appears though...

gdb:
Code:
#0  0x00007ffff745cf9c in __printf_fp ()
   from /var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libc.so.6
#1  0x00007ffff745bc5e in vfprintf ()
   from /var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libc.so.6
#2  0x00007ffff7516b45 in __vsnprintf_chk ()
   from /var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libc.so.6
#3  0x00000000005cd5b6 in AppendVPrintf(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, char const*, __va_list_tag*) ()
#4  0x0000000000596010 in LOG(char const*, ...) ()
#5  0x00000000005ee5cc in cSpawnPrepare::Call(int, int) ()
#6  0x0000000000592bd6 in cLightingThread::LightChunk ()
#7  0x0000000000592d88 in cLightingThread::Execute() ()
#8  0x00007ffff7b5ada0 in ?? ()
   from /var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libstdc++.so.6
#9  0x0000003000c079d1 in start_thread () from /lib64/libpthread.so.0
#10 0x00007ffff7507a6d in clone ()

MCServer:
Code:
[15:57:15]   D:    | MCServer has encountered an error and needs to close
[15:57:15] Details | SIGSEGV: Segmentation fault
./MCServer(_Z15PrintStackTracev+0x14)[0x6049a4]
./MCServer(_Z14NonCtrlHandleri+0x40)[0x5f1d40]
/var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libc.so.6(+0x352f0)[0x7f0bae8bc2f0]
/var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libc.so.6(__printf_fp+0xf3e)[0x7f0bae8d76be]
/var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libc.so.6(_IO_vfprintf+0x457e)[0x7f0bae8d519e]
/var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libc.so.6(__vsnprintf_chk+0x96)[0x7f0bae99d5a6]
./MCServer(_Z13AppendVPrintfRSsPKcP13__va_list_tag+0x66)[0x5cd5b6]
./MCServer(_Z3LOGPKcz+0xb0)[0x596010]
./MCServer(_ZN13cSpawnPrepare4CallEii+0x13c)[0x5ee5cc]
./MCServer[0x592bd6]
./MCServer(_ZN15cLightingThread7ExecuteEv+0xf8)[0x592d88]
/var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libstdc++.so.6(+0xbadd0)[0x7f0baf005dd0]
/lib64/libpthread.so.0[0x3000c079d1]
/var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libc.so.6(clone+0x6d)[0x7f0bae98deed]
[15:57:15]   D:    | MCServer has encountered an error and needs to close
[15:57:15] Details | SIGABRT: Server self-terminated due to an internal fault
./MCServer(_Z15PrintStackTracev+0x14)[0x6049a4]
./MCServer(_Z14NonCtrlHandleri+0x99)[0x5f1d99]
/var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libc.so.6(+0x352f0)[0x7f0bae8bc2f0]
/var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libc.so.6(gsignal+0x37)[0x7f0bae8bc267]
/var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libc.so.6(abort+0x16a)[0x7f0bae8bdeca]
./MCServer(_Z14NonCtrlHandleri+0x45)[0x5f1d45]
/var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libc.so.6(+0x352f0)[0x7f0bae8bc2f0]
/var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libc.so.6(__printf_fp+0xf3e)[0x7f0bae8d76be]
/var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libc.so.6(_IO_vfprintf+0x457e)[0x7f0bae8d519e]
/var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libc.so.6(__vsnprintf_chk+0x96)[0x7f0bae99d5a6]
./MCServer(_Z13AppendVPrintfRSsPKcP13__va_list_tag+0x66)[0x5cd5b6]
./MCServer(_Z3LOGPKcz+0xb0)[0x596010]
./MCServer(_ZN13cSpawnPrepare4CallEii+0x13c)[0x5ee5cc]
./MCServer[0x592bd6]
./MCServer(_ZN15cLightingThread7ExecuteEv+0xf8)[0x592d88]
/var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libstdc++.so.6(+0xbadd0)[0x7f0baf005dd0]
/lib64/libpthread.so.0[0x3000c079d1]
/var/lib/openshift/5564cc2de0b8cdcc300000c5/app-root/data/lib/libc.so.6(clone+0x6d)[0x7f0bae98deed]
Aborted

Does anyone know what the cause for this may be? I'm on libc 2.21.