| Summary: | Serialization of a Map with non-string value in the MongoSessionHandler is causing a stackoverflow due to infinite loop | ||
|---|---|---|---|
| Product: | [RT] Jetty | Reporter: | David Seymore <david.seymore> |
| Component: | other | Assignee: | Jesse McConnell <jesse.mcconnell> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jesse.mcconnell |
| Version: | unspecified | ||
| Target Milestone: | 7.5.x | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
hm, I'll take a look thanks for the report its a bit of a pain to test since since I don't have a mongo service setup at the moment, but I can see where this would be a problem have you tested your fix at all? or will you be willing to test a snapshot of this if I push it out? thanks I have just tested the fix locally building off the tag. I do see the objects being pushed into mongodb now, and stack overflow is no longer being expressed in the logs. ok, I pushed it into master I am working on the merge to 8 anyway for some dependency work we did so it should be on jetty 8 sometime today thanks for the report and simple fix! cheers |
Build Identifier: 8.1.0.v20120127 Exception in thread "Thread-1" java.lang.StackOverflowError at java.util.regex.Pattern$Start.match(Pattern.java:3055) at java.util.regex.Matcher.search(Matcher.java:1105) at java.util.regex.Matcher.find(Matcher.java:535) at java.util.regex.Matcher.replaceAll(Matcher.java:809) at java.lang.String.replace(String.java:2207) at org.eclipse.jetty.nosql.mongodb.MongoSessionManager.encodeName(MongoSessionManager.java:398) at org.eclipse.jetty.nosql.mongodb.MongoSessionManager.encodeName(MongoSessionManager.java:424) Reproducible: Always Steps to Reproduce: 1. Enable the MongoDB session handler using the jetty-nosql module 2. Add a hashmap to the session with a value that is not a string (Long in my case) 3. send a kill signal to the jvm to flush to mongodb The error appears to be on line 424 o.append(encodeName(entry.getKey().toString()),encodeName(out,bout,value)); It appears as though it should be passing the entry.getValue() rather than value (the map) to the recursive call to encodeName.