Page 1 of 1

Tracing Segfault

Posted: Wed Jul 31, 2019 10:43 pm
by piccaso
Hi!

I am toying with a game written in/for LÖVE and I'm getting random Segmentation faults.
But there is no stacktrace, the game just crashes and the string `Segmentation fault` is printed to the console.

Is there any way i can trace the problem?
A commandline flag or debug build, something like that?

I'm using `love-11.2-win64` and the game i am toying with is Mari0 (this branch).

Thanks!

Re: Tracing Segfault

Posted: Thu Aug 01, 2019 9:40 am
by pgimeno
I don't get a segfault, but I get these messages:

Code: Select all

shader (dotnbloom) is fucked up, yo:
	Cannot compile pixel shader code:
Line 31: error: global variable gl_TexCoord is removed after version 140
shader (scanline-3x) is fucked up, yo:
	Cannot compile pixel shader code:
Line 31: error: global variable gl_TexCoord is removed after version 140
shader (scanline-4x) is fucked up, yo:
	Cannot compile pixel shader code:
Line 31: error: global variable gl_TexCoord is removed after version 140
This suggests that the problem might possibly be that your graphics driver is less graceful when it encounters these errors. See if you can fix or disable these shaders.

Re: Tracing Segfault

Posted: Thu Aug 01, 2019 11:11 am
by piccaso
This looks like a compilation error, did the game even run?

It works fine for me for at least 10 minutes until it crashes.
But i never used any shaders and they should be disabled by default. But i'll look into that.

Which LÖVE version did you use?

Howerver, not sure if this is even related to my segfault.
So, is there anything I can enable to get more information out of the crash?
There must be some way to narrow it down...

Re: Tracing Segfault

Posted: Thu Aug 01, 2019 11:21 am
by pgimeno
piccaso wrote: Thu Aug 01, 2019 11:11 am This looks like a compilation error, did the game even run?
Yes, a shader compilation error. Yes, it did run despite the errors.

piccaso wrote: Thu Aug 01, 2019 11:11 am It works fine for me for at least 10 minutes until it crashes.
Ah ok, I didn't try that long. I'll try when I can and report back if I can reproduce the crash.

piccaso wrote: Thu Aug 01, 2019 11:11 am Which LÖVE version did you use?
11.2 compiled by myself (no custom patches, but liblove is linked statically for me).

piccaso wrote: Thu Aug 01, 2019 11:11 amHowerver, not sure if this is even related to my segfault.
So, is there anything I can enable to get more information out of the crash?
There must be some way to narrow it down...
Run it under gdb.

Code: Select all

gdb --args love <folder>
(gdb) run
Once it crashes, get a backtrace with:

Code: Select all

(gdb) bt
If it crashes in Lua code, though, a backtrace won't be very useful, as chances are that it crashes in either the LuaJIT interpreter or in code generated by the interpreter.

Re: Tracing Segfault

Posted: Thu Aug 01, 2019 11:23 am
by slime
Since you're using windows, you could try the latest LÖVE 11.3 prerelease build and see if the issue persists: https://ci.appveyor.com/project/AlexSzp ... /artifacts

LÖVE 11.3 has a bunch of fixes - one of the bigger ones is an updated version of OpenAL Soft which fixes some glitches and potential crashes around streaming audio sources.

Re: Tracing Segfault

Posted: Thu Aug 01, 2019 11:57 am
by piccaso
pgimeno wrote: Thu Aug 01, 2019 11:21 am Ah ok, I didn't try that long. I'll try when I can and report back if I can reproduce the crash.
Thanks!
pgimeno wrote: Thu Aug 01, 2019 11:21 am If it crashes in Lua code, though, a backtrace won't be very useful, as chances are that it crashes in either the LuaJIT interpreter or in code generated by the interpreter.
Too bad, but I'll give it a try.
And i could turn off JIT right?
`jit.off()`
Found it on the forum, but not (jet) in the documentation - looks like it could disable JIT and switch to just interpretation...

slime wrote: Thu Aug 01, 2019 11:23 am Since you're using windows, you could try the latest LÖVE 11.3 prerelease build and see if the issue persists: https://ci.appveyor.com/project/AlexSzp ... /artifacts

LÖVE 11.3 has a bunch of fixes - one of the bigger ones is an updated version of OpenAL Soft which fixes some glitches and potential crashes around streaming audio sources.
Thanks, I'll try that first.
I'm already suspecting that it has someting to do with the background music looping over to the start.

Re: Tracing Segfault

Posted: Thu Aug 01, 2019 3:09 pm
by pgimeno
I couldn't reproduce the crash on my Linux machine. Yes, there have been reports of crashes on Windows related to music looping, which were solved by updating OpenAL.

Re shaders, found them. In the MISC tab of the options there are shaders to select from, and the four above are not working in my system.

Re: Tracing Segfault

Posted: Thu Aug 01, 2019 8:48 pm
by piccaso
That did it! (Using the latest CI build).
Just put it through its paces with a second Player.
Used gamepads, tried all mappacks/dlc's we could find even did some screen recording with obs :)
Audio sounds perfect, not a single glicht!
This build feels so much more stable than 11.2 - on my machine :)

Thank you so much for helping out, we're having a lot of fun here!