Note that there are some explanatory texts on larger screens.

plurals
  1. POCrashing MongoDB with one badly named field, what's so special about it?
    primarykey
    data
    text
    <p>Using the Java driver, we today discovered that is possible to bring a MongoDB instance down with a segmentation fault. </p> <pre><code>new Mongo().getDB("test").getCollection("test"). insert(new BasicDBObject("\u0000Žö", "")); </code></pre> <p>This will produce the following output from <code>mongod</code> before it dies:</p> <pre><code>Fri Nov 16 18:53:18 Invalid access at address: 0xbac3c5fe from thread: conn5 Fri Nov 16 18:53:18 Got signal: 11 (Segmentation fault: 11). Fri Nov 16 18:53:18 Backtrace: 0x10004241b 0x10005628b 0x100056941 0x7fff828afcfa 0x1 0x100281611 0x100288c91 0x10006c501 0x10058e50c 0x1005e31d3 0x7fff8285b8bf 0x7fff8285eb75 0 mongod 0x000000010004241b _ZN5mongo15printStackTraceERSo + 43 1 mongod 0x000000010005628b _ZN5mongo10abruptQuitEi + 987 2 mongod 0x0000000100056941 _ZN5mongo24abruptQuitWithAddrSignalEiP9__siginfoPv + 673 3 libsystem_c.dylib 0x00007fff828afcfa _sigtramp + 26 4 ??? 0x0000000000000001 0x0 + 1 5 mongod 0x0000000100281611 _ZN5mongo14receivedInsertERNS_7MessageERNS_5CurOpE + 1841 6 mongod 0x0000000100288c91 _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE + 4705 7 mongod 0x000000010006c501 _ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE + 257 8 mongod 0x000000010058e50c _ZN5mongo3pms9threadRunEPNS_13MessagingPortE + 1084 9 mongod 0x00000001005e31d3 thread_proxy + 163 10 libsystem_c.dylib 0x00007fff8285b8bf _pthread_start + 335 11 libsystem_c.dylib 0x00007fff8285eb75 thread_start + 13 </code></pre> <p>I've been trying to understand what on earth makes this magical field name special. Removing <strong>any</strong> of the characters involved makes mongodb survive just fine, and the stack trace isn't making me any wiser.</p> <p>I've written up a short <a href="http://jwdev.tumblr.com/post/35851221681/how-to-crash-mongodb-in-1-line-of-java" rel="nofollow">blog post</a> on the issue, and filed a <a href="https://jira.mongodb.org/browse/SERVER-7691" rel="nofollow">JIRA ticket</a> at mongodb.org, but my curiosity is killing me. Can anyone figure out what makes <code>\u0000Žö</code> special?</p> <p><strong>Edit to clarify</strong>: <code>\u0000</code> and <code>\u0000Ž</code> is fine, and so is <code>\u0000Žsomerandomtext</code> </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload