[SERVER-20665] RegExp with \u0x0000 triggers stack trace Created: 28/Sep/15 Updated: 28/Sep/15 Resolved: 28/Sep/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 3.0.6 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Peak Ji | Assignee: | Ramon Fernandez Marina |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: | db.test.save( { a: (new RegExp(String.fromCharCode(0))), _id: 'test' }) |
||||||||
| Participants: | |||||||||
| Description |
|
I can't copy or type ASCII control chars in the browser, but we can reproduce the issue in mongo shell with some Javascript:
And here the error in log:
|
| Comments |
| Comment by Ramon Fernandez Marina [ 28/Sep/15 ] | |||||||
|
Thanks for your report peakji; the command you sent doesn't crash the server, only triggers a stack trace because of a failed check – mongod's availability is not compromised. I've adjusted the ticket title to reflect that. Starting with MongoDB 3.1.5 the check happens earlier and a comprehensive error message is printed instead of the stack trace:
|