Running this gist against MongoDB 1.8.1 on FreeBSD will crash the server
https://gist.github.com/1071926
Message is:
Fri Jul 8 09:58:29 Invalid access at address: 0x801fffffa
Fri Jul 8 09:58:29 Got signal: 11 (Segmentation fault: 11).
Fri Jul 8 09:58:29 Backtrace:
Fri Jul 8 09:58:29 Invalid access at address: 0x801b1c813
Fri Jul 8 09:58:29 Got signal: 10 (Bus error: 10).
Fri Jul 8 09:58:29 Backtrace:
Repro:
Install node.js
Install npm
npm install mongoose
node crashMongo.js
Expected:
Bad query (because of the blank id)
Observed:
Server crashes
My other test environment is MongoDB 1.6.5 on Linux, and it does not crash
The driver is probably doing something incorrect, but I would expect the server to be robust against ill-formed queries.