1. If you have a problem and need help, create a new thread with a title that briefly describes the problem.
    Do not use titles like 'Help!' or 'I have a problem!'
    Dismiss Notice
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Linux Segmentation fault on start on Fedora 20 Heisenbug and Ubuntu 14.04 Trusty

Discussion in 'General Help' started by FarmerJohn, Dec 28, 2013.

  1. FarmerJohn

    FarmerJohn Bison Rider

    Messages:
    21
    For those of you guys who have that problem. When started in console, game says:
    Code:
    PNG warning: Application built with libpng-1.5.5 but running with 1.6.3
    [13:51:21] LOAD PNG: Internal PNG create read struct failure
    Here is a solution:
    1. Make sure that libpng15 package is installed (rpm -q libpng15). If not - install it (yum install libpng15).
    2. Use library preload technique: LD_PRELOAD=/usr/lib/libpng15.so.15 ./rungame.sh

    Hope that will help someone.

    UPD.: The same aplies for KAG beta, e.g. LD_PRELOAD=/usr/lib/libpng15.so.15 ./KAG
     
    Last edited: Jan 5, 2014
    NinjaCell likes this.
  2. jeroth

    jeroth Builder Stabber

    Messages:
    1
    Any help? I get the following and it does the same thing...

    LD_PRELOAD=/usr/lib64/libpng15.so.15 ./KAG
    ERROR: ld.so: object '/usr/lib64/libpng15.so.15' from LD_PRELOAD cannot be preloaded: ignored.
    PID: 21677

    Thanks!
     
  3. Mazey

    Mazey Haxor Global Moderator Forum Moderator Staff Alumni Donator Official Server Admin

    Messages:
    1,914
    I googled around a bit and it should mean that that's not the correct path.
     
  4. FarmerJohn

    FarmerJohn Bison Rider

    Messages:
    21
    Well, path can be system specific. To find correct path one can use locate. Here is an example from my current system (fedora 20, x86_64, latest updates):
    Code:
    $ locate libpng15.so
    /usr/lib/libpng15.so.15
    /usr/lib/libpng15.so.15.17.0
    /usr/lib64/libpng15.so.15
    /usr/lib64/libpng15.so.15.17.0
    I took the first path and it works.
    You have to make sure that libpng15 installed (I have for both platforms - libpng15-1.5.17-1.fc20.x86_64 and libpng15-1.5.17-1.fc20.i686).
     
  5. Thx for help! :)
     
  6. FarmerJohn

    FarmerJohn Bison Rider

    Messages:
    21
    Just upgraded to Ubuntu 14.04 (trusty). Unfortunately it has no libpng15 in standard repositories. I've found source code of library at here, built it with usual way (./configure && make). I didn't want to install it globally so I copied shared library (in my case it was in <libpng_build_dir>/.libs/libpng15.so) to KAG directory. After that game is runnable with LD_PRELOAD=./libpng15.so ./rungame
     
    Mazey likes this.
  7. lolmaus

    lolmaus Catapult Fodder

    Messages:
    5
    Got the same issue after upgrading to Kubuntu 14.04.

    I tried FarmerJohn's solution and failed. :( The program would still claim that it runs with libpng-1.2.50. libpng15.so is located in the application folder, it weighs 694454 bytes, is owned by current user and has -rwxrwxr-x permissions.

    Suggestions?
     
  8. FarmerJohn

    FarmerJohn Bison Rider

    Messages:
    21
    Check if you've built library for 64-bit system. That can be problem because game uses i386 libraries.
     
  9. lolmaus

    lolmaus Catapult Fodder

    Messages:
    5
    How do i build an i386 version, FarmerJohn? I'm on 64-bit Kubuntu.

    Also, can you share the libpng15.so file that worked for you?
     
    Last edited: Apr 26, 2014
  10. FarmerJohn

    FarmerJohn Bison Rider

    Messages:
    21
    It's mine version of libpng15.so (gzipped because .so is not allowed here; to unzip - gunzip libpng15.so.gz).

    In case you want to check if it's i386 library - use ldd. Here's output on my Ubuntu system:
    Code:
    $ ldd ./libpng15.so
      linux-gate.so.1 =>  (0xb77a0000)
      libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb7725000)
      libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb76df000)
      libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb752f000)
      /lib/ld-linux.so.2 (0xb77a1000)
    I have 64-bit system at home and can try to build it this evening (I have Fedora there and it has libpng15 in standard repositories, but will try to build it manually).

    BTW just tried. Don't forget the dot and slash after LD_PRELOAD, e.g. LD_PRELOAD=./libpng15.so
    --- Double Post Merged, Apr 30, 2014, Original Post Date: Apr 29, 2014 ---
    Had no time to check it personally, but googled around and found that answer.

    In few words:

    Code:
    sudo apt-get install gcc-multilib g++-multilib
    ./configure --host=i686-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32" 
     

    Attached Files:

  11. lolmaus

    lolmaus Catapult Fodder

    Messages:
    5
    The game runs successfully with your version of libpng15. Thank you, FarmerJohn, you're awesome!

    Instructions for anyone who experiences the issue:
    1. Download the attachment from FarmerJohn's comment: https://forum.kag2d.com/attachments/libpng15-so-gz.33541/
    2. Extract it into the game directory.
    3. Open a terminal, change the current folder to the game directory.
    4. Run:
      Code:
      LD_PRELOAD=./libpng15.so ./rungame
    5. Radiate love towards FarmerJohn.
     
    NinjaCell likes this.
  12. NinjaCell

    NinjaCell Haxor

    Messages:
    358
    I had to use:
    Code:
    LD_PRELOAD=./libpng15.so sh rungame.sh 
    but it worked!