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

Array overrun while writing planet.vex #14

Open
abyrd opened this issue Oct 28, 2015 · 2 comments
Open

Array overrun while writing planet.vex #14

abyrd opened this issue Oct 28, 2015 · 2 comments

Comments

@abyrd
Copy link
Member

abyrd commented Oct 28, 2015

While writing planet.vex:

19:27:55.007 [Thread-0] DEBUG com.conveyal.osmlib.VEXBlock - Contained 5263 entities with type 2.
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1048576
    at com.conveyal.osmlib.DeflatedBlockWriter.write(DeflatedBlockWriter.java:129)
    at java.io.OutputStream.write(OutputStream.java:116)
    at java.io.OutputStream.write(OutputStream.java:75)
    at com.conveyal.osmlib.VarIntOutputStream.writeBytes(VarIntOutputStream.java:52)
    at com.conveyal.osmlib.VarIntOutputStream.writeString(VarIntOutputStream.java:58)
    at com.conveyal.osmlib.VexOutput.writeRelation(VexOutput.java:168)
    at com.conveyal.osmlib.PBFInput.parseRelations(PBFInput.java:190)
    at org.openstreetmap.osmosis.osmbinary.BinaryParser.parse(BinaryParser.java:122)
    at org.openstreetmap.osmosis.osmbinary.BinaryParser.handleBlock(BinaryParser.java:68)
    at org.openstreetmap.osmosis.osmbinary.file.FileBlock.process(FileBlock.java:135)
    at org.openstreetmap.osmosis.osmbinary.file.BlockInputStream.process(BlockInputStream.java:34)
    at com.conveyal.osmlib.PBFInput.copyTo(PBFInput.java:237)
    at com.conveyal.osmlib.main.Converter.main(Converter.java:32)
@abyrd
Copy link
Member Author

abyrd commented Oct 28, 2015

This is because there are OSM entities bigger than com.conveyal.osmlib.DeflatedBlockWriter#MAX_MESSAGE_SIZE

@abyrd
Copy link
Member Author

abyrd commented Oct 28, 2015

Temporary fix in 26deed7 (just made the buffer bigger). A better solution would be to copy any unfinished message to the beginning of the next block buffer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant