-
Notifications
You must be signed in to change notification settings - Fork 106
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
Large diagnostic response payloads aren't sent properly in JSON #375
Comments
I'll bet it's hitting the
in pipeline.h, when calling |
The payload in your example stop exactly at 256 bytes - I'll bet the rest is garbage from other regions of memory that we unintentionally read because the payload is not null-terminated. |
Yeah, I was looking at that earlier. I did increase that size which helps. But also needed to increase the size of the Queue here: vi-firmware/src/util/bytebuffer.h Line 7 in 0ee0b5a
|
The queue availability is checked here: https://github.com/openxc/vi-firmware/blob/master/src/pipeline.cpp#L46. It's a bit tough to debug though because adding any debug statements cause a recursive function call to |
Alternatively, you could fit a lot more data in the string if it uses base64 encoding instead of hex, but that would be a breaking API change. |
Alright, so after further investigation and attempts to get 255 bytes of payload response out over JSON, I don't think we can do it... I tried increasing the queue size to 700 and the |
* reduce max payload size. see OpenXC vi-firmware issue #375 openxc/vi-firmware#375. * update isotp dependency with reduce isotp message size.
Pull request (#374) has been merged to limit the diagnostic payload response size to 127 bytes so this error shouldn't happen. Changed this from a |
Initially created an issue in openxc-android here. Turns out I was able to recreate the same issue with the Python command line tools, so now I think it's an issue in the firmware.
In IsoTp and UDS-C we allow a max diagnostic payload size of 255 bytes. When trying to send many bytes through in the diagnostic response, part of the JSON string is overwritten by other information. Like this:
In this example case, the payload should have contained 128 bytes (256 ascii characters when converted to JSON string).
The text was updated successfully, but these errors were encountered: