ryzom / ryzomcore

Ryzom Core is the open-source project related to the Ryzom game. This community repository is synchronized with the Ryzom Forge repository, based on the Core branch.
https://wiki.ryzom.dev
GNU Affero General Public License v3.0
338 stars 90 forks source link

Segmentation fault on Parabola GNU/Linux-libre #51

Closed ryzom-pipeline closed 11 years ago

ryzom-pipeline commented 11 years ago

Original report by Jorge Araya Navarro (Bitbucket: [Jorge Araya Navarro](https://bitbucket.org/Jorge Araya Navarro), ).


I compiled ryzom, just the client, but when I try to run ryzom_client it just crashes. Here is some debug that I did using GDB:

#!/usr/bin/env bash

jorge [~/packages/abslibre/pcr/ryzom-hg-debug] ~> ryzom_client
Violación de segmento (`core' generado)
jorge [~/packages/abslibre/pcr/ryzom-hg-debug] ~> gdb ryzom_client
GNU gdb (GDB) 7.6
Copyright (C) 2013 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-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/ryzom_client...done.
(gdb) run
Starting program: /usr/bin/ryzom_client
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffef2e2700 (LWP 15040)]
[Thread 0x7fffef2e2700 (LWP 15040) exited]

Program received signal SIGSEGV, Segmentation fault.
0x0000000100000000 in ?? ()
(gdb) bt
#0  0x0000000100000000 in ?? ()
#1  0x00007ffff0c32abb in XML_Parse () from /usr/lib/libxmlparse.so.0
#2  0x00007fffe7bd1d9c in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#3  0x00007fffe7b48ddd in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#4  0x00007fffe7bcfbb1 in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#5  0x00007fffede1387a in ?? () from /usr/lib/libGL.so.1
#6  0x00007fffeddf03f9 in ?? () from /usr/lib/libGL.so.1
#7  0x00007fffeddece2b in ?? () from /usr/lib/libGL.so.1
#8  0x00007fffedded5c0 in glXChooseVisual () from /usr/lib/libGL.so.1
#9  0x00007fffee080e8d in NL3D::CDriverGL::setDisplay (this=0x1229d20, wnd=wnd@entry=0, mode=..., show=show@entry=false,
    resizeable=resizeable@entry=true) at /build/src/ryzom-hg-20130727/nel/src/3d/driver/opengl/driver_opengl_window.cpp:1077
#10 0x00007ffff6b0a231 in NL3D::CDriverUser::setDisplay (this=0x10d9100, wnd=0, mode=..., show=<optimized out>, resizeable=<optimized out>)
    at /build/src/ryzom-hg-20130727/nel/src/3d/driver_user.cpp:243
#11 0x00007ffff6b05e50 in NL3D::CDriverUser::setDisplay (this=0x10d9100, mode=..., show=<optimized out>, resizeable=<optimized out>)
    at /build/src/ryzom-hg-20130727/nel/src/3d/driver_user.cpp:234
#12 0x000000000065df63 in prelogInit () at /build/src/ryzom-hg-20130727/ryzom/client/src/init.cpp:865
#13 0x0000000000607f78 in main (argc=<optimized out>, argv=<optimized out>) at /build/src/ryzom-hg-20130727/ryzom/client/src/client.cpp:553
(gdb) quit

this is what ldd says:

#!/usr/bin/env bash

jorge [~] ~> ldd /usr/bin/ryzom_client 
    linux-vdso.so.1 (0x00007fff0e1eb000)
    libnelmisc.so.0 => /usr/lib/libnelmisc.so.0 (0x00007ff30fd3a000)
    libnelnet.so.0 => /usr/lib/libnelnet.so.0 (0x00007ff30f9ff000)
    libnelligo.so.0 => /usr/lib/libnelligo.so.0 (0x00007ff30f7a7000)
    libnelgeorges.so.0 => /usr/lib/libnelgeorges.so.0 (0x00007ff30f56c000)
    libnel3d.so.0 => /usr/lib/libnel3d.so.0 (0x00007ff30ebca000)
    libnelgui.so.0 => /usr/lib/libnelgui.so.0 (0x00007ff30e732000)
    libnelsound.so.0 => /usr/lib/libnelsound.so.0 (0x00007ff30e471000)
    libryzom_clientsheets.so.0 => /usr/lib/libryzom_clientsheets.so.0 (0x00007ff30e1af000)
    libryzom_gameshare.so.0 => /usr/lib/libryzom_gameshare.so.0 (0x00007ff30dc10000)
    libnelpacs.so.0 => /usr/lib/libnelpacs.so.0 (0x00007ff30d976000)
    libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007ff30d60e000)
    liblua5.1.so.5.1 => /usr/lib/liblua5.1.so.5.1 (0x00007ff30d3e1000)
    libluabind.so.0.9.0 => /usr/lib/libluabind.so.0.9.0 (0x00007ff30d1c2000)
    libcurl.so.4 => /usr/lib/libcurl.so.4 (0x00007ff30cf5f000)
    libwwwapp.so.0 => /usr/lib/libwwwapp.so.0 (0x00007ff30cd45000)
    libz.so.1 => /usr/lib/libz.so.1 (0x00007ff30cb2f000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007ff30c82b000)
    libm.so.6 => /usr/lib/libm.so.6 (0x00007ff30c52d000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007ff30c317000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00007ff30bf6a000)
    libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007ff30bd4e000)
    libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007ff30baf9000)
    libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007ff30b8c4000)
    libdl.so.2 => /usr/lib/libdl.so.2 (0x00007ff30b6c0000)
    librt.so.1 => /usr/lib/librt.so.1 (0x00007ff30b4b8000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007ff30b216000)
    libwwwcore.so.0 => /usr/lib/libwwwcore.so.0 (0x00007ff30afe4000)
    libwwwfile.so.0 => /usr/lib/libwwwfile.so.0 (0x00007ff30adda000)
    libwwwhtml.so.0 => /usr/lib/libwwwhtml.so.0 (0x00007ff30abc7000)
    libwwwhttp.so.0 => /usr/lib/libwwwhttp.so.0 (0x00007ff30a9b3000)
    libwwwmime.so.0 => /usr/lib/libwwwmime.so.0 (0x00007ff30a7a8000)
    libwwwtrans.so.0 => /usr/lib/libwwwtrans.so.0 (0x00007ff30a5a2000)
    libwwwutils.so.0 => /usr/lib/libwwwutils.so.0 (0x00007ff30a398000)
    libwwwcache.so.0 => /usr/lib/libwwwcache.so.0 (0x00007ff30a18e000)
    libwwwftp.so.0 => /usr/lib/libwwwftp.so.0 (0x00007ff309f86000)
    libwwwgopher.so.0 => /usr/lib/libwwwgopher.so.0 (0x00007ff309d82000)
    libwwwnews.so.0 => /usr/lib/libwwwnews.so.0 (0x00007ff309b7a000)
    libwwwtelnet.so.0 => /usr/lib/libwwwtelnet.so.0 (0x00007ff309978000)
    libwwwstream.so.0 => /usr/lib/libwwwstream.so.0 (0x00007ff309771000)
    libwwwdir.so.0 => /usr/lib/libwwwdir.so.0 (0x00007ff30956c000)
    libwwwxml.so.0 => /usr/lib/libwwwxml.so.0 (0x00007ff309361000)
    libwwwzip.so.0 => /usr/lib/libwwwzip.so.0 (0x00007ff30915f000)
    libxmlparse.so.0 => /usr/lib/libxmlparse.so.0 (0x00007ff308f55000)
    libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007ff308d2b000)
    libmd5.so.0 => /usr/lib/libmd5.so.0 (0x00007ff308b29000)
    libvorbisfile.so.3 => /usr/lib/libvorbisfile.so.3 (0x00007ff308920000)
    libvorbis.so.0 => /usr/lib/libvorbis.so.0 (0x00007ff3086f3000)
    libnelsnd_lowlevel.so.0 => /usr/lib/libnelsnd_lowlevel.so.0 (0x00007ff3084e6000)
    liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007ff3082c3000)
    libssh2.so.1 => /usr/lib/libssh2.so.1 (0x00007ff30809a000)
    libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0x00007ff307e2e000)
    libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0x00007ff307a24000)
    /lib64/ld-linux-x86-64.so.2 (0x00007ff310105000)
    libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007ff307814000)
    libogg.so.0 => /usr/lib/libogg.so.0 (0x00007ff30760d000)
jorge [~] ~>

My CMake options were:

#!bash

cmake -Wno-dev "source/code" -DWITH_SYMBOLS=ON -DWITH_STATIC=OFF -DWITH_NEL_TOOLS=OFF -DWITH_NEL_TESTS=OFF -DWITH_LUA51=ON -DWITH_NEL_SAMPLES=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_RYZOM_SERVER=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_NEL=ON -DWITH_DRIVER_OPENGL=ON -DWITH_DRIVER_OPENAL=ON -DCMAKE_INSTALL_PREFIX=/usr -DRYZOM_ETC_PREFIX=/etc/ryzom -DRYZOM_SHARE_PREFIX=/usr/share/ryzom -DRYZOM_BIN_PREFIX=/usr/bin -DRYZOM_GAMES_PREFIX=/usr/bin

We do a source code snapshot when packaging software from distributed version control like mercurial or git and so, so here is the source code snapshot used to build Ryzom.

The dependencies and build dependencies were these:

#!bash
depends=('curl' 'hicolor-icon-theme' 'libvorbis' 'libjpeg' 'libwww' 'luabind') # 'freetype2' 'libx11' 'mesa' 'libxxf86vm' 'openal' 'libogg' 'libxml2' 'libpng' 'lua51' are dependencies already included by other dependencies in the array according to namcap.
#!bash
makedepends=('mercurial' 'cpptest' 'cmake' 'bison' 'freealut' 'rrdtool' 'boost')
ryzom-pipeline commented 11 years ago

Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).


We already had this problem in the past, libxmlparse.so.0 is from libwww and your OpenGL driver is linked to libexpat that define the same symbols. You have to recompile libwww to use external expat library, the same as your OpenGL driver or to compile libwww in full static.

ryzom-pipeline commented 11 years ago

Original comment by Jorge Araya Navarro (Bitbucket: [Jorge Araya Navarro](https://bitbucket.org/Jorge Araya Navarro), ).


I have some issues compiling libwww. Is There any other workaround?

ryzom-pipeline commented 11 years ago

Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).


Did you use ./configure and make ?

ryzom-pipeline commented 11 years ago

Original comment by Jorge Araya Navarro (Bitbucket: [Jorge Araya Navarro](https://bitbucket.org/Jorge Araya Navarro), ).


of course I did!!

But libwww is a package already provided in our repositories, thus, I tried to built a static version of it using the sources from the W3, but it seems to have some issues with newer versions of gcc.

I just changed the source code with the yours, and everything went well :). The next step is to build ryzom using that libwww built.

EDIT: Something went wrong while building Ryzom and seems related to your libwww:

[ 46%] Building CXX object nel/src/gui/CMakeFiles/nelgui.dir/ctrl_scroll_base.cpp.o
Linking CXX shared library ../../../lib/libnelgui.so
/usr/bin/ld: /usr/local/lib/libwwwapp.a(HTAccess.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libwwwapp.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libnelgui.so.0.9.0] Error 1
make[1]: *** [nel/src/gui/CMakeFiles/nelgui.dir/all] Error 2
make: *** [all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: (libremakepkg): An error has occurred. Exiting...
jorge [~/packages/abslibre/pcr/ryzom-hg-debug] ~> 

I compiled and packaged your libwww version with these options:

./autogen.sh
./configure --prefix=/usr/local \
    --with-ssl=no --with-zlib --with-expat --with-gnu-ld \
    --enable-shared=no --enable-static
  make

May I did something wrong?

ryzom-pipeline commented 11 years ago

Original comment by Jorge Araya Navarro (Bitbucket: [Jorge Araya Navarro](https://bitbucket.org/Jorge Araya Navarro), ).


fixed, libwww fork of @kervala does magic :D

But, I'll appreciate a better way of packaging Ryzom that does use the already provided software and libs :)