The attached LOVE file is causing a segfault. It seems to only occur on Linux machines thus far, and I can't reproduce it in Windows. It also won't occur if I run the code from ZeroBrane, with or without debugging enabled.
Use the arrow keys and space, line up three or more gems to clear. It usually happens to me after 2 or 3 gem clears.
I really have no clue what's causing it.
[Closed] Segmentation Fault
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- SneakySnake
- Citizen
- Posts: 94
- Joined: Fri May 31, 2013 2:01 pm
- Contact:
Re: Segmentation Fault
It seems to be a problem with LuaJIT.
I reduced the problem to this:
This crashes both LÖVE and standalone LuaJIT.
I reduced the problem to this:
Code: Select all
local t = {[0] = {}, [1] = {}, [2] = {}, [3] = {}}
for i = 1, 1000 do
for i = 3,0,-1 do
t[i].foo = t[i - 1]
end
end
Last edited by SneakySnake on Sat Jun 28, 2014 3:52 pm, edited 1 time in total.
- SneakySnake
- Citizen
- Posts: 94
- Joined: Fri May 31, 2013 2:01 pm
- Contact:
Re: Segmentation Fault
Double post for some awkward reason.
Last edited by SneakySnake on Sat Jun 28, 2014 3:25 pm, edited 2 times in total.
Re: Segmentation Fault
You're creating an infinite loop. Of course it is going to crashSneakySnake wrote:It seems to be a problem with LuaJIT.
I reduced the problem to this:This crashes both LÖVE and standalone LuaJIT.Code: Select all
local t = {[0] = {}, [1] = {}, [2] = {}, [3] = {}} while true do for i = 3,0,-1 do t[i].foo = t[i - 1] end end
Your screen is very zoomed in...
- SneakySnake
- Citizen
- Posts: 94
- Joined: Fri May 31, 2013 2:01 pm
- Contact:
Re: Segmentation Fault
An infinite loop in itself won't cause segmentation fault.mickeyjm wrote:You're creating an infinite loop. Of course it is going to crash
- slime
- Solid Snayke
- Posts: 3132
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Segmentation Fault
It might if it runs out of memory, or if there's a bug in the version of LuaJIT you're using (some bugs have been fixed since 2.0.3.)
Last edited by slime on Sat Jun 28, 2014 3:56 pm, edited 1 time in total.
- SneakySnake
- Citizen
- Posts: 94
- Joined: Fri May 31, 2013 2:01 pm
- Contact:
Re: Segmentation Fault
Okay, to avoid confusion, I changed the infinite loop to a block that repeats 1000 times.
That ought to crash it, but it is in no way enough to cause Lua to run out of memory.
On my system. it runs fine on official Lua interpreter, but crashes with LuaJIT on the 23rd iteration.
I tried to bisect it, but the bug seems to exist ever since v2.0.0-beta10 (versions before that up to initial commit don't build).
That ought to crash it, but it is in no way enough to cause Lua to run out of memory.
On my system. it runs fine on official Lua interpreter, but crashes with LuaJIT on the 23rd iteration.
It also crashes with LuaJIT Git master.slime wrote: or if there's a bug in the version of LuaJIT you're using (some bugs have been fixed since 2.0.3.)
I tried to bisect it, but the bug seems to exist ever since v2.0.0-beta10 (versions before that up to initial commit don't build).
Re: Segmentation Fault
yes, crashes for me in both 2.0 and 2.1, but not stock luaSneakySnake wrote:Okay, to avoid confusion, I changed the infinite loop to a block that repeats 1000 times.
That ought to crash it, but it is in no way enough to cause Lua to run out of memory.
On my system. it runs fine on official Lua interpreter, but crashes with LuaJIT on the 23rd iteration.
It also crashes with LuaJIT Git master.slime wrote: or if there's a bug in the version of LuaJIT you're using (some bugs have been fixed since 2.0.3.)
I tried to bisect it, but the bug seems to exist ever since v2.0.0-beta10 (versions before that up to initial commit don't build).
i would definitely report this to mike with your test case
- slime
- Solid Snayke
- Posts: 3132
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Segmentation Fault
Yeah definitely, once you report a bug with a test case he usually fixes it very quickly.
You can also try calling jit.off() before the code to see if it only happens when the code is JIT-compiled.
You can also try calling jit.off() before the code to see if it only happens when the code is JIT-compiled.
- SneakySnake
- Citizen
- Posts: 94
- Joined: Fri May 31, 2013 2:01 pm
- Contact:
Re: Segmentation Fault
Indeed, it doesn't crash with jit.off().slime wrote:Yeah definitely, once you report a bug with a test case he usually fixes it very quickly.
You can also try calling jit.off() before the code to see if it only happens when the code is JIT-compiled.
I reported it to the LuaJIT mailing list.
(why it doesn't have a bug tracker baffles me)
Who is online
Users browsing this forum: No registered users and 77 guests