Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash w/ gpu #44

Open
fluxionary opened this issue Jan 7, 2024 · 5 comments · May be fixed by #58
Open

crash w/ gpu #44

fluxionary opened this issue Jan 7, 2024 · 5 comments · May be fixed by #58
Labels
bug Something isn't working

Comments

@fluxionary
Copy link
Member

fluxionary commented Jan 7, 2024

this was reported by a player calling themselves frogTheSecond

run the following in a luacontroller:

if 'program' == event.type then
  digiline_send("g", {
    {
      command = "createbuffer",
      buffer = 1,
      xsize = 64,
      ysize = 12,
      fill = "ffffff",
    },
    {
      command = "drawline",
      buffer = 1,
      x1 = 100,
      y1 = 100,
      x2 = 1,
      y2 = 12,
      color = "ffffff",
      antialias = true
    }
  })
end

result:

AsyncErr: Lua: Runtime error from mod '??' in callback environment_Step(): ...t/bin/../worlds/rolling_test/worldmods/digistuff/gpu.lua:348: attempt to index a nil value
stack traceback:
	...t/bin/../worlds/rolling_test/worldmods/digistuff/gpu.lua:348: in function 'runcommand'
	...t/bin/../worlds/rolling_test/worldmods/digistuff/gpu.lua:566: in function 'action'
	/opt/minetest/bin/../mods/digilines/internal.lua:106: in function 'transmit'
	/opt/minetest/bin/../mods/digilines/init.lua:60: in function 'receptor_send'
	...est/bin/../mods/mesecons/mesecons_luacontroller/init.lua:749: in function <...est/bin/../mods/mesecons/mesecons_luacontroller/init.lua:743>
	/opt/minetest/bin/../mods/mesecons/mesecons/actionqueue.lua:137: in function 'old_execute'
	...st/worldmods/mesecons_debug/overrides/mesecons_queue.lua:27: in function 'execute'
	/opt/minetest/bin/../mods/mesecons/mesecons/actionqueue.lua:111: in function </opt/minetest/bin/../mods/mesecons/mesecons/actionqueue.lua:73>
	/opt/minetest/bin/../builtin/common/register.lua:26: in function </opt/minetest/bin/../builtin/common/register.lua:12>
@BuckarooBanzay BuckarooBanzay added the bug Something isn't working label Jan 7, 2024
@FeXoR-o-Illuria
Copy link

So buffer[point.y] is nil in: https://github.com/mt-mods/digistuff/blob/master/gpu.lua#L348
Can't find any issue with the buffer creation, serialization and storage at first glance.

@TheEt1234
Copy link

TheEt1234 commented Feb 10, 2024

So buffer[point.y] is nil in: https://github.com/mt-mods/digistuff/blob/master/gpu.lua#L348
Can't find any issue with the buffer creation, serialization and storage at first glance.

x1 and y1 are bigger than x2 and y2, i think thats the cause (?), or they are out of range, but honestly it (the gpu) should just be rewritten imo

@TheEt1234
Copy link

TheEt1234 commented Apr 23, 2024

What causes it and what doesn't (i will be using (x1, y1, x2, y2) to keep it short)

Keep in mind that buffer size is 64 x 64
(10,10,100,120) - doesn't
(100, 120, 10, 10) - doesn't
(65, 65, 1, 64) - doesn't
(100, 500, 1, 64) - doesn't

Well i've gotten some crashes while doing stuff on 11 x 11 before... so
(buffer size is now 11 x 11)
(13,6,6,6) - does (came from my wireframe renderer)
(13,1,1,1) - does

Well i think i get the idea... i will try 64 x 64...
(65, 1, 1, 1) - doesn't???

Weird... i guess time to try 63 x 63?
(65, 1, 1, 1) - does???

What

buffer size: 62 x 62
(65, 1, 1, 1) - does

oh i see

if the buffer size is less than 64 and x1 is more than that it crashes

Tested on pandorabox

@SwissalpS SwissalpS linked a pull request Apr 28, 2024 that will close this issue
@SwissalpS
Copy link
Contributor

The script snippet in OP doesn't crash game when using #58
Please test the other cases you found @TheEt1234 (or whoever feels like it)
and comment on PR #58, thanks.

@TheEt1234
Copy link

The original case that started the issue was fixed, so has the (65, 1, 1, 1) case when buffer size is 63x63

So it's most likely patched

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants