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

NUL-corrupted keys, values on JSON serialization #1274

Open
jaredstehler opened this issue Apr 25, 2024 · 5 comments · May be fixed by #1276
Open

NUL-corrupted keys, values on JSON serialization #1274

jaredstehler opened this issue Apr 25, 2024 · 5 comments · May be fixed by #1276

Comments

@jaredstehler
Copy link

First posted in discussions: FasterXML/jackson#215

Jackson version: 2.12.6

We have observed sporadic instances of serialized JSON messages containing corrupted keys and/or values (correct length, but some amount of string suffix is replaced with NUL (0) bytes).

From our metrics, it seemed to recur every 2-4 days on average. We have swapped in a fork of jackson-core with fields marked as volatile in SerializedString (HubSpot@4d3bd2d) and have not seen the issue in > 10 days now.

Even though we saw this once or twice a while back on JDK 17, it seems to have been exacerbated with JDK 21. We are also running on ARM64 instances, which could have some behavior contributing here.

I have not been able to reproduce this in isolation, unfortunately. Happy to help provide any additional information. We are working on an upgrade to jackson 2.18 but I see those fields are unchanged in that branch as well.

@pjfanning
Copy link
Member

Can you provide us with your code? Ideally as a PR but paste it here if a PR is not something you have time for.

PS We are unlikely to release a new v2.12 fix. The fix is likely to only go in more recent release lines - 2.17 and possibly 2.16, etc.

@jaredstehler
Copy link
Author

Oh I wasn't planning on pushing for a 2.12 release; we are definitely moving to a higher version. I only called it out as a clarifying point of context.

@jaredstehler
Copy link
Author

Which code are you looking for? The actual invocations to the ObjectMapper? Types being serialized?

@pjfanning
Copy link
Member

Which code are you looking for? The actual invocations to the ObjectMapper? Types being serialized?

I was asking for a PR with the changes you want to SerializedString.

@jaredstehler
Copy link
Author

ah, sorry. opened PR #1276

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

Successfully merging a pull request may close this issue.

2 participants