problem with minetestmapper

User avatar
linushsao
Member
 
Posts: 331
Joined: Mon Jan 27, 2014 12:56
IRC: linushsao
In-game: linus

problem with minetestmapper

by linushsao » Wed Feb 15, 2017 11:59

hi,all i always got error message while generate map by minetestmapper:

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
GD Warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully


how should you generate map?
1).My Server:Mars World
2).address:139.59.238.211:30016
3).manual(in processing):http://tinyurl.com/jyjkrgl
4).for my(admin's) role in all my servers,i'll be as the earth/water/fire/wind. i maintain that system,but not manage/touch players directly in game,not own the crafts on planet. i just keep watching the worlds.
 

Beerholder
Member
 
Posts: 33
Joined: Wed Aug 03, 2016 20:23
In-game: Beerholder

Re: problem with minetestmapper

by Beerholder » Wed Feb 15, 2017 13:30

How big is the world you want to map? From the looks of it the resulting image would be too large so LibGD exits before it would crash trying to process the image. Larger image sizes using 64 bit support is scheduled for GD release 2.3 and it will probably take quite a while before that is released. Maybe you can generate tiles using the --geometry option to avoid running into this problem? E.g. from the docs:

./minetestmapper --geometry -10000:-10000+20000+20000 -i /etc/etc

And then use e.g. ImageMagick to stitch the tiles using -append and +append?
 

User avatar
Sergey
Member
 
Posts: 362
Joined: Wed Jan 11, 2017 13:28

Re: problem with minetestmapper

by Sergey » Wed Feb 15, 2017 17:04

I made map of square size 10km x 10km with origin in the center. Generation took much time but no errors occured.
The size of generated PNG file was about 92Mb.
 

Beerholder
Member
 
Posts: 33
Joined: Wed Aug 03, 2016 20:23
In-game: Beerholder

Re: problem with minetestmapper

by Beerholder » Thu Feb 16, 2017 10:48

Size on disk does not equal size in memory since PNG uses compression whereas LibGD needs to have the full image in memory. For a 10k x 10k that would be roughly 100MB times 4 as there are 4 channels, RGB and A (alpha) which is 400MB in memory. The relevant buffer overflow protection is here: https://github.com/libgd/libgd/blob/mas ... rity.c#L27

Call to overflow2 for PNG images is here https://github.com/libgd/libgd/blob/mas ... png.c#L417

So as per this code rowbytes (a) would be 10000 pixels x 4 channels = 40000 (RGBA) and height (b) is 10000 pixels. Then (a > INT_MAX / b) => 40000 > 2147483647 / 10000 => 40000 > 214748 which is false. In general, rowbytes x height should not exceed INT_MAX. FYI the max size before the overflow check would fail will be a little over 23k x 23k, and more generally height x width x 4 must remain < 2GB.
 


Return to Minetest Problems

Who is online

Users browsing this forum: Bing [Bot] and 10 guests

cron