Skip to content

IllegalArgumentException in EdgeKVStorage #2609

Closed

Description

@karussell

Unsure how this can happen as we use Helper.cutString before:

Caused by: java.lang.IllegalArgumentException: bytes.length cannot be > 255 but was 257
        at com.graphhopper.search.EdgeKVStorage.getBytesForValue(EdgeKVStorage.java:340)
        at com.graphhopper.search.EdgeKVStorage.add(EdgeKVStorage.java:178)
        at com.graphhopper.storage.BaseGraph.setName(BaseGraph.java:467)
        at com.graphhopper.storage.BaseGraph.access$200(BaseGraph.java:45)
        at com.graphhopper.storage.BaseGraph$EdgeIteratorStateImpl.setName(BaseGraph.java:967)
        at com.graphhopper.reader.osm.OSMReader.addEdge(OSMReader.java:337)
        at com.graphhopper.reader.osm.WaySegmentParser$Pass2Handler.handleSegment(WaySegmentParser.java:365)
        at com.graphhopper.reader.osm.WaySegmentParser$Pass2Handler.splitSegmentAtSplitNodes(WaySegmentParser.java:338)
        at com.graphhopper.reader.osm.WaySegmentParser$Pass2Handler.splitLoopSegments(WaySegmentParser.java:299)
        at com.graphhopper.reader.osm.WaySegmentParser$Pass2Handler.splitWayAtJunctionsAndEmptySections(WaySegmentParser.java:274)
        at com.graphhopper.reader.osm.WaySegmentParser$Pass2Handler.handleWay(WaySegmentParser.java:256)
        at com.graphhopper.reader.osm.WaySegmentParser$ReaderElementHandler.handleElement(WaySegmentParser.java:520)
        at com.graphhopper.reader.osm.WaySegmentParser.readOSM(WaySegmentParser.java:396

Activity

  1. easbar commented on Jun 23, 2022

    @easbar
    Member

    thanks for the quick fix!

  2. karussell commented on Jun 23, 2022

    @karussell
    MemberAuthor

    I do not yet fully understand if this is a correcting procedure of the String constructor or if this is due to length bits of the char (didn't find an indication here). But reducing the length further to 250 should always help. (still the method shouldn't be used as a generic cut method and so I renamed it and removed the parameter)

  3. added this to the 6.0 milestone on Jun 23, 2022
  4. otbutz commented on Jun 23, 2022

    @otbutz
    Contributor
  5. karussell commented on Jun 23, 2022

    @karussell
    MemberAuthor

    We do not just split the string at the byte length. See the used String constructor.

    if this is due to length bits of the char (didn't find an indication here)

    Or a bit is used as "char uses more bytes" marker ... this might be the case according to some code in the String constructor:

    int b2 = bytes[offset + 1];
    if (isNotContinuation(b2)) break
    
  6. added a commit that references this issue on Jun 24, 2022
    514e515
  7. added a commit that references this issue on Dec 1, 2022
    64acc41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions