You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran out of disk space while in the middle of caching a tile, which caused the cached tile to become corrupted (which is fine).
When I then tried to retrieve the tile from the cache, I get the following error (below).
The problem is that that this error isn't thrown - it's caught and printed to the console internally in Mapsforge.
In addition, with a regular tile cache setup, because the tilecache contains a value for this job (even though it's corrupt), it's never replaced.
I think the default behaviour should not be to print exceptions to the console, and if this error occurs then it should be rethrown and the corrupt tile removed from the cache.
java.lang.IndexOutOfBoundsException: off < 0 || len < 0 || off+len > b.length || off+len < 0!
at javax.imageio.stream.FileCacheImageInputStream.read(FileCacheImageInputStream.java:177)
at com.sun.imageio.plugins.common.SubImageInputStream.read(SubImageInputStream.java:61)
at com.sun.imageio.plugins.common.InputStreamAdapter.read(InputStreamAdapter.java:47)
at java.io.SequenceInputStream.read(SequenceInputStream.java:208)
at java.io.SequenceInputStream.read(SequenceInputStream.java:211)
at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:238)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at java.io.DataInputStream.readFully(DataInputStream.java:195)
at com.sun.imageio.plugins.png.PNGImageReader.decodePass(PNGImageReader.java:1092)
at com.sun.imageio.plugins.png.PNGImageReader.decodeImage(PNGImageReader.java:1196)
at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1301)
at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1577)
at javax.imageio.ImageIO.read(ImageIO.java:1448)
at javax.imageio.ImageIO.read(ImageIO.java:1352)
at org.mapsforge.map.awt.graphics.AwtBitmap.(AwtBitmap.java:36)
at org.mapsforge.map.awt.graphics.AwtTileBitmap.(AwtTileBitmap.java:33)
at org.mapsforge.map.awt.graphics.AwtGraphicFactory.createTileBitmap(AwtGraphicFactory.java:203)
at org.mapsforge.map.layer.cache.FileSystemTileCache.get(FileSystemTileCache.java:254)
The text was updated successfully, but these errors were encountered:
A re-throw can crash the app, should be handled internally there like mentioned by clearing any bad one and request again the tile.
Though looking at FileSystemTileCache in case of errors the job is removed and return null to trigger a reload of the tile.
I ran out of disk space while in the middle of caching a tile, which caused the cached tile to become corrupted (which is fine).
When I then tried to retrieve the tile from the cache, I get the following error (below).
The problem is that that this error isn't thrown - it's caught and printed to the console internally in Mapsforge.
In addition, with a regular tile cache setup, because the tilecache contains a value for this job (even though it's corrupt), it's never replaced.
I think the default behaviour should not be to print exceptions to the console, and if this error occurs then it should be rethrown and the corrupt tile removed from the cache.
java.lang.IndexOutOfBoundsException: off < 0 || len < 0 || off+len > b.length || off+len < 0!
at javax.imageio.stream.FileCacheImageInputStream.read(FileCacheImageInputStream.java:177)
at com.sun.imageio.plugins.common.SubImageInputStream.read(SubImageInputStream.java:61)
at com.sun.imageio.plugins.common.InputStreamAdapter.read(InputStreamAdapter.java:47)
at java.io.SequenceInputStream.read(SequenceInputStream.java:208)
at java.io.SequenceInputStream.read(SequenceInputStream.java:211)
at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:238)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at java.io.DataInputStream.readFully(DataInputStream.java:195)
at com.sun.imageio.plugins.png.PNGImageReader.decodePass(PNGImageReader.java:1092)
at com.sun.imageio.plugins.png.PNGImageReader.decodeImage(PNGImageReader.java:1196)
at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1301)
at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1577)
at javax.imageio.ImageIO.read(ImageIO.java:1448)
at javax.imageio.ImageIO.read(ImageIO.java:1352)
at org.mapsforge.map.awt.graphics.AwtBitmap.(AwtBitmap.java:36)
at org.mapsforge.map.awt.graphics.AwtTileBitmap.(AwtTileBitmap.java:33)
at org.mapsforge.map.awt.graphics.AwtGraphicFactory.createTileBitmap(AwtGraphicFactory.java:203)
at org.mapsforge.map.layer.cache.FileSystemTileCache.get(FileSystemTileCache.java:254)
The text was updated successfully, but these errors were encountered: