Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

linedot

[Crash] on Linux, Steam without error.

Recommended Posts

linedot    0

Please choose a category
[Crash]
Platform
Steam, Linux
Do you use mods?
no
Version Number
Rev. 90423
Issue title
Errorless crash on start
Describe your issue

Hi!

First of all thank you for making the game, it works perfectly fine if I run it on an officially supported platform.

I've been toying with it on one that isn't though (gentoo). My machine is a laptop with an Intel Ivy Bridge CPU and an AMD Radeon HD 7970M GPU.  I have the latest versions of mesa, libdrm and other components of the X/linux graphics stack installed. Also the newest fglrx driver. Linux kernel version is 3.12.2


This is what is happening:

1. If I don't mess with anything:

    The game will run if I use the Radeon GPU with fglrx, there are no issues.
    The game will not run if I use the Intel GPU with mesa (crashes without error before any GL messages appear - probably segfaulting when trying to load the GL library).
    The game will not run if I use the Radeon GPU with mesa (same as intel)

2. If I remove the included libSDL2.so.* and use a self built one:

    The game will run on any GPU with any driver, but there are issues with the mouse input:

  • Moving the mouse up and down will do nothing
  • ​Moving the mouse to the right will move the cursor down, left moves it up
  • ​Clicking the mouse buttons will do nothing
  • ​Scrolling the wheel up will zoom in. Scrolling the wheel down will also zoom in


I thought maybe the 32 bit version of my SDL2 is messed up, so I threw this together and built it with -m32 for 32 bit just to check - it seemed to report proper coordinates though. Tried recompiling SDL2 ver. 2.0.0 and 2.0.1 with different flags, but all lead to the same result - messed up mouse (I made sure Don't Starve was actually using the libraries I built by pldd'ing the process)

 

The mouse works in other games that use SDL2, it also works in the steam overlay. Tried disabling the overlay - same issues.

​I know this is probably a bit rude to ask for support on an unsupported platform, but I really want to get it to run on my primary OS and maybe you could help me fix my libraries to get them to work with the game properly.

Share this post


Link to post
Share on other sites
linedot    0

Ok, so you guys use a "custom" SDL2 - your SDL_MouseMotionEvent, SDL_MouseButtonEvent and SDL_MouseWheelEvent are different from the original SDL2 source code.

 

I don't know if that is public knowledge or even whether you did that intentionally or if that's just some alignment bug - but I modified the SDL2 code (Just removed the "Uint32 which;" field from the three event structs as well as the code from SDL_mouse.c that assigns a value to that field). Compiling that resulted in a SDL2 library that provides events that Don't Starve can interpret correctly and now I can play the game without any issues!

Share this post


Link to post
Share on other sites
Klubba    0

Ok, so you guys use a "custom" SDL2 - your SDL_MouseMotionEvent, SDL_MouseButtonEvent and SDL_MouseWheelEvent are different from the original SDL2 source code.

 

I don't know if that is public knowledge or even whether you did that intentionally or if that's just some alignment bug - but I modified the SDL2 code (Just removed the "Uint32 which;" field from the three event structs as well as the code from SDL_mouse.c that assigns a value to that field). Compiling that resulted in a SDL2 library that provides events that Don't Starve can interpret correctly and now I can play the game without any issues!

 

Would you care to share the finished file or explain how you made it? I dont know how to compile your own files and i have an Intel GPU so i cannot play the game. When i bought it on steam i checked the recomendations and it didnt mention it wouldnt work with Intel (thats the worlds biggest gpu manufacturer) and ive gotten no help at all from the devs or this forum.  Would really apriciate your help thanks.  (im running mint 15 if that makes a difference)

Share this post


Link to post
Share on other sites
linedot    0

Well if it crashes for you because the included libSDL2 won't work with your graphics drivers then maybe you could fix the issue by compiling your own SDL2. Here's how (this assumes 64 bit linux and steam version of the game):

​1. Download libsdl2 from www.libsdl2.org

​2. unpack it

​3. open <SDL2 root>/include/SDL_events.h

​4. go to line 218, look at the lines till line 259 and whenever you encounter this line:

Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */

​delete it

​5. Save the file

6. open <SDL2 root>/src/events/SDL_mouse.c

​7. go to line 261, look at the lines till line 316 and whenever you encounter any of these lines:

event.motion.which = mouseID;event.button.which = mouseID;event.wheel.which = mouseID;

​delete it
​8. Save the file
​9. go to the SDL2 root
​10. run in terminal from the SDL2 root:

./configure --prefix=`pwd`/output --host=i686-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"make -j9make installmkdir ~/.local/share/Steam/SteamApps/common/dont_starve/bin/lib32/backupmv ~/.local/share/Steam/SteamApps/common/dont_starve/bin/lib32/libSDL2*so* ~/.local/share/Steam/SteamApps/common/dont_starve/bin/lib32/backup/cp output/lib/libSDL2*so* ~/.local/share/Steam/SteamApps/common/dont_starve/bin/lib32/

​11. I don't know what distro you're on but you'll need to install some dependencies of SDL2 as well as tools to build libraries, if you're on ubuntu, look here under "build dependencies" there's a list of stuff you need and I think

sudo apt-get build-dep libsdl2

will automatically install them. After you're done try if your game works, if it does - woohoo - we both had the same problem. If it doesn't, run

cp ~/.local/share/Steam/SteamApps/common/dont_starve/bin/lib32/backup/* ~/.local/share/Steam/SteamApps/common/dont_starve/bin/lib32/rm -r ~/.local/share/Steam/SteamApps/common/dont_starve/bin/lib32/backup

to restore the original libSDL2 files.

​I'm not sure this is very healthy advice though. It's probably an overcomplicated solution for a simple problem... Also - I skimmed through your previous posts and it seems your game segfaults only AFTER it has initialized GL, so I have no Idea if this will help.

Share this post


Link to post
Share on other sites
simplex    2619

@linedot

Strange that you were having problems under Gentoo. It works fine under Arch, using the i915 kernel module (xorg-video-intel driver, or however you want to call it).

But how did you figure out Don't Starve's version of SDL2 was customized to remove the mouse identifier from mouse events?

Share this post


Link to post
Share on other sites
linedot    0

I made this and let it run with the "normal" and Don't Starve's SDL and debugged the memory after the memcpy. First thing I saw was that when running with the game's library the x field contained the value for the y coordinates, and that yrel contained a garbage value. So I figured the garbage value came from reading outside the struct, and since x contained y, at least the last 4 values are must be shifted by 4 bytes so I just tried removing a 4 byte field from the struct eh voila - it worked. Then I removed the field from the button struct and now buttons were reporting the correct value too. Did the same for the Wheel struct but didn't test with the program, just replaced the Don't Starve files and opened the game and everything worked.

My drivers and mesa are straight from git, plus I added some patches to my x server. Maybe the SDL had some trouble with that.

Share this post


Link to post
Share on other sites