[SERVER-15032] Mongo shell should reject script file larger than 2G Created: 25/Aug/14 Updated: 22/Jul/15 Resolved: 30/Aug/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 2.6.3 |
| Fix Version/s: | 2.7.6 |
| Type: | Bug | Priority: | Trivial - P5 |
| Reporter: | Siyuan Zhou | Assignee: | Benety Goh |
| Resolution: | Done | Votes: | 1 |
| Labels: | community-team, polish | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Minor Change |
| Operating System: | ALL |
| Sprint: | Server 2.7.4, Server 2.7.5, Server 2.7.6 |
| Participants: |
| Description |
|
Reported by a user here. The shell reads the whole script file into memory and compile it, so shell doesn't allow script file to exceed 2G to keep the compatibility on 32bit OS. But the current limit is about 4G. Also when reading a file in file.cpp, pread() doesn't guarantee reading until the EOF in one shot. It should be checked in a loop until the EOF or an error.
|
| Comments |
| Comment by Benety Goh [ 30/Aug/14 ] |
|
Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}Message: |
| Comment by Githook User [ 30/Aug/14 ] |
|
Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}Message: |
| Comment by Matt Kangas [ 29/Aug/14 ] |
|
The current error message still says "attempted to execute javascript file larger than 2GB". Let's enforce that limit. A limit less than 2 GB would be sensible but will be a breaking change for some users, so we cannot change this arbitrarily. |