Page 1 of 1

[closed] memory access error caused by a "vertical_frames"

PostPosted: Tue Jan 20, 2015 16:28
by Hybrid Dog
l tried to make an animated nyancat rainbow.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.override_item("default:nyancat_rainbow", {
   tiles = {   -- 300ms (from nyan.cat)
      {
         name = "default_nc_rb_ani.png^[transformR90",
         animation = {
            type = "vertical_frames",
            aspect_w = 16,
            aspect_h = 16,
            length = 0.6,
         },
      },
      --"default_nc_rb.png^[transformR90",
      "default_nc_rb.png^[transformR90",
   },
})

The animated rainbow texture:Image
But when l want to test it, minetest crashes and tells me a memory access error (Speicherzugriffsfehler).
lt crashes if l look for the cat in the unified inventory and/or look at it when it's placed.
I tested it with an additional inventory_image in the node definition but it didn't help.

If I remove the "^[transformR90", minetest doesn't crash.

minetest --trace just tells me following:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
12 <- 127.0.0.1:d770, size=85, data= 4f45 7403 0001 17:16:55: INFO[main]: Lazily creating item texture and mesh for "default:nyancat_rainbow"
10 -> 127.0.0.1:9b8d, size=20, data= 4f45 7403 0001 0003 061c 0100 3200 0100 0f09 00000003 061b 0100 4700 1900 0001 f400...
...
12 -> 127.0.0.1:d770, size=bSpeicherzugriffsfehler


My problem is following:
When minetest crashes it doesn't inform me enough about the mistake, it only tells me that it crashed when creating an item texture for "default:nyancat_rainbow". And it doesn't tell me the exact reason for the crash.

Re: memory access error caused by a "vertical_frames" animat

PostPosted: Wed Jan 21, 2015 06:36
by 4aiman
You have vertical frames and a rotated image.
I guess the engine couldn't find the second part of an image because it's not "below" but "to the right" of the first frame after you have rotated the texture.

Anyway, why don't you want to supply an already rotated image?

Or, if the whole case is about MT doesn't tell what to do, then I'm all for adding more info in the verbose mode. Currently even that can't tell one where to start searching for a bug.

Re: memory access error caused by a "vertical_frames" animat

PostPosted: Wed Jan 21, 2015 16:18
by Hybrid Dog
4aiman wrote:You have vertical frames and a rotated image.
I guess the engine couldn't find the second part of an image because it's not "below" but "to the right" of the first frame after you have rotated the texture.

Anyway, why don't you want to supply an already rotated image?

For the nyancat l would need 2 more rainbow textures instead of only one. I think I could use ^[combine for it.

4aiman wrote:Or, if the whole case is about MT doesn't tell what to do, then I'm all for adding more info in the verbose mode. Currently even that can't tell one where to start searching for a bug.

lf l use a not existing texture, minetest informs me about it but if l use vertical_frames in a wrong way minetest crashes with "Speicherzugriffsfehler" as reason.

Re: memory access error caused by a "vertical_frames" animat

PostPosted: Thu Jan 22, 2015 08:22
by 4aiman
For the nyancat l would need 2 more rainbow textures instead of only one. I think I could use ^[combine for it.

Why not use a 2x2 textures image? Or did I get your wrong?

lf l use a not existing texture, minetest informs me about it but if l use vertical_frames in a wrong way minetest crashes with "Speicherzugriffsfehler" as reason.

Me "nein sprachen Deutch" (I don't know how to spell "I do not speak German" in German ;) but the memory access error seems to be a valid reason - the engine searches for pixels outside the actual canvas.

"Rotate" modifier only rotates image.
If it was like
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
+-+-+
| | |
+-+-+


it will become
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
+-+
| |
+-+
| |
+-+


and not

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
+-+-+
| | |
+-+-+
| | |
+-+-+


Or maybe I didn't get you at all :'(

Re: memory access error caused by a "vertical_frames" animat

PostPosted: Thu Jan 22, 2015 15:54
by Hybrid Dog
4aiman wrote:
For the nyancat l would need 2 more rainbow textures instead of only one. I think I could use ^[combine for it.

Why not use a 2x2 textures image? Or did I get your wrong?

lf l use a not existing texture, minetest informs me about it but if l use vertical_frames in a wrong way minetest crashes with "Speicherzugriffsfehler" as reason.

Me "nein sprachen Deutch" (I don't know how to spell "I do not speak German" in German ;) but the memory access error seems to be a valid reason - the engine searches for pixels outside the actual canvas.

"Rotate" modifier only rotates image.
If it was like
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
+-+-+
| | |
+-+-+


it will become
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
+-+
| |
+-+
| |
+-+


and not

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
+-+-+
| | |
+-+-+
| | |
+-+-+


Or maybe I didn't get you at all :'(

Ok, a 32x32 animated rainbow texture should work, too, but like an additional image it would need more space, l think. l could use ^verticalframe to cut the animated water texture and do rainbows onto it with ^combine…
And memory access error isn't accurate enough in my opinion.