-
Notifications
You must be signed in to change notification settings - Fork 235
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
Bug: SegFault caused by invalid string #750
Comments
D'oh, sorry that you're hitting this. I can offer some context. In #583, I changed In #618, I further changed it to use at most 9 bits: tilemaker/include/attribute_store.h Line 49 in eab08d1
That limits us to at most 512 unique keys. Except... this has the same bug as #672 did: it's using a signed type. Instead of So probably there are at least two things that ought to be done:
And then possibly:
|
@cldellow Nice. My first thought was that it was an overflow, given the unexpected number, but the bounds (-245) just didn't make sense to me. Too big for 8 bit, too small for 16 bit. The daft part is that when looking at the definition Just to verify this...
Feeling pretty daft that I didn't work that one out 🤦 So, with regards to this:
|
This fixes two issues: - use an unsigned type, so we can use the whole 9 bits and have 512 keys, not 256 - fix the bounds check in AttributeKeyStore to reflex the lower threshold that was introduced in systemed#618 Hat tip @oobayly for reporting this.
Great, thanks for verifying the issue! I opened #760 to apply that fix + improve the failure mode. I've left the limit at 512 - if/when someone complains that it's not enough, we can revisit improving it. |
This fixes two issues: - use an unsigned type, so we can use the whole 9 bits and have 512 keys, not 256 - fix the bounds check in AttributeKeyStore to reflex the lower threshold that was introduced in systemed#618 Hat tip @oobayly for reporting this. Fixes systemed#750.
This fixes two issues: - use an unsigned type, so we can use the whole 9 bits and have 512 keys, not 256 - fix the bounds check in AttributeKeyStore to reflex the lower threshold that was introduced in systemed#618 Hat tip @oobayly for reporting this.
I came across this when adding a large number of attributes to a nodes. In my case I was adding all the OSM tags with a
railway:
prefix (I'm not planning on doing always doing this, but it's useful for development). This was fine for a small region (Köln Rebenz), but would end with SIGSEGV when using the parent area (Nordrehin Westfalen).My first thought was that it's an OOM error, but this turned out not to be the case:
--store
flag, but this made no difference.railways:
tags did work, with a similar 3.5GB usage.So, it seems to be an issue with attributes, I:
AttributeStore->keyStore
. I appreciate that this many not be great practice, but nor should this be causing a SegFault.In short, it was
error reading variable: Cannot access memory at address 0x1a149fe
, and was been thrown in OutputObject::writeAttributes:49Attaching a debugger, I found that address of the string
const std::string& key = attributeStore.keyStore.getKeyUnsafe(it->keyIndex);
was invalid, and attempting to read it is causing an access violation. More specifically, the iteratorit
had an invalid (negative)keyIndex
value.What's interesting is that the other properties for the
AttributePair
is valid,valueType
and the string instringValue
.I'll try setting up a simple (but completely unrealistic) set up so it can be reproduced on demand.
As an aside, I'm going to create another 2 issues with associated PR that helped me with getting live debugging to work via docker.
The text was updated successfully, but these errors were encountered: