[SERVER-12117] some $where queries with $ operator in projection crash server Created: 16/Dec/13  Updated: 11/Jul/16  Resolved: 17/Dec/13

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 2.5.5

Type: Bug Priority: Major - P3
Reporter: Andrew Emil (Inactive) Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: 26qa, query_triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File server12117.js    
Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

running db.test.find({$where:"return this.a;"},

{"a.$":1}

) will crash the server. Tested on trunk from today. Seems to work fine in 2.4.8 and 2.5.4.

Relevant log output:
2013-12-16T11:58:08.061-0500 [conn1] ERROR: Uncaught std::exception: basic_string::_S_construct NULL not valid, terminating
2013-12-16T11:58:08.061-0500 [conn1] shutdown: going to close listening sockets...
2013-12-16T11:58:08.061-0500 [conn1] closing listening socket: 9
2013-12-16T11:58:08.061-0500 [initandlisten] now exiting



 Comments   
Comment by Githook User [ 17/Dec/13 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-12117 fixed path checking when parsing projection on $where query
Branch: master
https://github.com/mongodb/mongo/commit/b43c12902599e0ecea596975c081655a0cdc121c

Generated at Thu Feb 08 03:27:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.