Comments (13)
It seems this loop does not handle the underflow condition correctly. I will check this and get back to you.
Cheers,
Michel
from bson4jackson.
I'm not sure if an underflow is actually the problem here. I can't reproduce it. Do you know anything about your input data at that point?
Michel
from bson4jackson.
Does the problem still persist?
Michel
from bson4jackson.
Yes, the problem persist.
My input data can be really different, text, image, binary content...
But I can't get a sample of data which always produce the problem. For the same input it can work or not.
Yoann
from bson4jackson.
Sounds like a multi-threading issue. Do you use bson4jackson from multiple threads at the same time? Which version of bson4jackson do you use? I fixed a multi-threading issue recently in this commit. The current version that includes this fix is 2.3.1.
Michel
from bson4jackson.
Yes i use it from multi-thread at the same time.
I will try next week the 2.3.1
Yoann
from bson4jackson.
Cool. Looking forward to hear from you.
Michel
from bson4jackson.
Did it work?
Michel
from bson4jackson.
Closing this issue due to inactivity.
Michel
from bson4jackson.
That bug is alive and we have a piece of data that causes infinite loop in de.undercouch.bson4jackson.io.DynamicOutputBuffer.putUTF8(int, String). This has nothing to do with multithreading. It has to do with memory management during encoding. Would you be able to fix the problem if we shared the data sample?
from bson4jackson.
The file size is ~320K. Not sure how best to share it with you.
from bson4jackson.
I submitted a PR #79 . Not sure why it the CI fails. I left some comments in the PR. The trigger in our case is a sequence of 3 byte UTF8 chars side by side such that it causes OVERFLOW. The logic in putUTF8 never recovers from this situation because the 4 byte buffer end up having a limit of 1 and after a flip it becomes a 1 byte buffer. If OVERFLOW is by 1 or 2 bytes your code will never allocate additional memory
from bson4jackson.
After removing the second change the CI build passes. I believe replacing rewind() with clear() is an obvious thing. It fixes the infinite loop problem for me. Please publish a new version ASAP. We use your library in prod and it served us well - good job at developing and maintaining this!
from bson4jackson.
Related Issues (20)
- Version 2.13 does not contain OSGi metadata anymore HOT 2
- UTF-8 conversion is significantly slower with BSON than regular JSON HOT 4
- Jackson 2.15.0 - Error deserializing an @JsonUnwrapped object with a field of type float HOT 6
- empty String error reading from array within sealed class with @JsonTypeInfo rules HOT 2
- Leading 4 bytes are all zeroes HOT 16
- How to enable a feature in BsonGenerator.java ? HOT 8
- unexpected block in ObjectMapper.readValue() in BSON streaming situation HOT 1
- BigDecimal precision HOT 1
- BsonGenerator does not handle null values correctly HOT 3
- BsonFactory doesn't override 'createParser(DataInput in)' method HOT 2
- UnsafeByteArrayInputStream.read for bytes >= 0x80 returns negative integer, caller thinks "Oh, EOF" HOT 1
- Buffer caching for heavy multithreaded load HOT 6
- Release 2.10.x version (+ test and document compatibility with Jackson 2.10.x)
- Failed to deserialize object HOT 2
- com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input HOT 2
- Support for Jackson 2.12 HOT 2
- ObjectId no longer compatible with mongodb ObjectId
- Decimal128 should extend Number & implement Comparable
- Serialization performance with large objects HOT 1
- IllegalStateException found when fuzzing bson4jackson HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bson4jackson.