Page 1 of 2

Seg fault on quit on macOS Mojave

Posted: Sun Oct 14, 2018 12:31 am
by robotron9000
When I quit a game with this code:

Code: Select all

function love.draw()
    love.graphics.print("hi", 10, 10)
end
I always get "Segmentation fault: 11" on the console in MacOS 10.14.

If I change the settings in the screenshot below so the the Console and love are ticked, I don't get the error. I am using love 11.1. Any ideas why this is happening? Thanks.

Also I'm never updating my Macs OS again. Stuff breaks every time.

screen.png
screen.png (313.76 KiB) Viewed 8606 times

Re: Seg fault on quit on macOS Mojave

Posted: Sun Oct 14, 2018 1:37 am
by MissDanish
A fix is in the works from what I read on the LÖVE discord

Re: Seg fault on quit on macOS Mojave

Posted: Mon Oct 15, 2018 6:39 am
by robotron9000
That's good to hear :)

Not really a big deal for now, because it does actually work.

Re: Seg fault on quit on macOS Mojave

Posted: Thu Oct 25, 2018 9:56 pm
by SiENcE
I've maybe an equal problem but on 0.10.2. When love.event.push('quit') is called the window closes but love stays in the Dock until I kill it. It seems it hangs/ is freezed.

Is there a "hard" way to quit löve? I need an urgent fix or solution ... :-/

Maybe os.exit of lua or by use of ffi ?

Re: Seg fault on quit on macOS Mojave

Posted: Fri Oct 26, 2018 8:59 am
by grump
SiENcE wrote: Thu Oct 25, 2018 9:56 pm Maybe os.exit of lua or by use of ffi ?
os.exit calls the normal C exit() function. It definitely works to quit LÖVE. Have you tried to call it?

Re: Seg fault on quit on macOS Mojave

Posted: Fri Oct 26, 2018 9:54 am
by SiENcE
[quote=grump post_id=223773 time=1540544344 user_id=139355]
SiENcE wrote: Thu Oct 25, 2018 9:56 pm Maybe os.exit of lua or by use of ffi ?
os.exit calls the normal C exit() function. It definitely works to quit LÖVE. Have you tried to call it?
[/quote]

Yes os.exit(0) or os.exit(1)?

There is also this ffi option. I hope it works on osx.

Code: Select all

        local ffi = require("ffi")
	local C = ffi.C
	ffi.cdef[[
		void _exit(int status);
	]]
	C._exit(-1)   -- exec never returns
When i exit via os.exit(0) or the ffi thing this is written in the console log:

Code: Select all

AL lib: (EE) alc_cleanup: 1 device not closed
It does not appear when i exit normally via love.event.quit.

So maybe löve waits for the device to close and on OSX it doesn't...!?

Maybe this is the problem?

Re: Seg fault on quit on macOS Mojave

Posted: Fri Oct 26, 2018 10:07 am
by grump
Call exit(0) if no error happened, exit(anything else) if you want to return that error code to the parent process.
SiENcE wrote: Fri Oct 26, 2018 9:54 am When i exit via os.exit(0) or the ffi thing this is written in the console log:

Code: Select all

AL lib: (EE) alc_cleanup: 1 device not closed
It does not appear when i exit normally via love.event.quit.

So maybe löve waits for the device to close and on OSX it doesn't...!?

Maybe this is the problem?
When you call os.exit, love can't properly free allocated resources. This is normally not a problem, because the OS will clean up after the process.

Re: Seg fault on quit on macOS Mojave

Posted: Fri Oct 26, 2018 1:12 pm
by SiENcE
grump wrote: Fri Oct 26, 2018 10:07 am When you call os.exit, love can't properly free allocated resources. This is normally not a problem, because the OS will clean up after the process.
Thx I'll try.

Btw. did you finished the layered effects of your particle editor?

Re: Seg fault on quit on macOS Mojave

Posted: Fri Oct 26, 2018 1:33 pm
by grump
SiENcE wrote: Fri Oct 26, 2018 1:12 pm Btw. did you finished the layered effects of your particle editor?
No. The project I used it for died, there was no interest in it from the community, and with LÖVE 11.0 the Nuklear UI library broke and still hasn't been fully fixed to this day. I might get back to it (or rather, rewrite it, because Nuklear sucks) one day, but chances are it's dead for good.

Re: Seg fault on quit on macOS Mojave

Posted: Fri Oct 26, 2018 7:43 pm
by SiENcE
grump wrote: Fri Oct 26, 2018 1:33 pm No. The project I used it for died, there was no interest in it from the community, and with LÖVE 11.0 the Nuklear UI library broke and still hasn't been fully fixed to this day. I might get back to it (or rather, rewrite it, because Nuklear sucks) one day, but chances are it's dead for good.
Hm it's a pity. I learned in this years when developing Aeon that the missing tools and integrations into well known tools is the biggest problem of löve creating bigger games. Good tools is important if you need to create content. One has no time to first develop all your tools and than the game. And it's harder to work externals. As a hobby, yes...at work...no.

Back to topic:

So..bu is fixed using os.exit(0) on MacOSX Mojave. Löve closes. Not a very nice solution...but hey..it works :).