[SERVER-1056] utf8 error causes Segmentation fault while deleting a Map/Reduce temporary collection Created: 27/Apr/10 Updated: 12/Jul/16 Resolved: 28/Apr/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Stability |
| Affects Version/s: | 1.4.1 |
| Fix Version/s: | 1.5.1 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Nicolas Fouché | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 3 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
fedora 9 x86_64 |
||
| Attachments: |
|
| Participants: |
| Description |
|
Replica-pair setup: production-shard1-002 and production-shard1-002.silentale.net I launch a Map/Reduce command with the Ruby driver. The command fails, I receive this exception: #<Mongo::OperationFailure: map-reduce failed: assertion: invalid utf8>. Tue Apr 27 14:05:25 CMD: drop random_db_name.tmp.mr.mapreduce_1272377125_2 The sad part is that I did not notice that the master crashed (auto-reconnect), and I crashed the second pair right after I attached the logs of the two servers, and the Map/Reduce code in a Ruby file. I can reproduce the problem on my laptop (MongoDB 1.4.1 64bits OSX) with the same collection, and a single mongod instance. But it does not raise a segmentation fault, mongod just gently kills itself. Tue Apr 27 18:19:09 connection accepted from 127.0.0.1:60353 #1 So I suppose that this problems appears as soon as a previous map/reduce command fails. |
| Comments |
| Comment by Nicolas Fouché [ 29/Apr/10 ] |
|
Thanks, with the nightly build, I can rescue the errors in Javascript, and ignore them until I fix the documents in our database. Here are the logs I get: Thu Apr 29 10:26:14 connection accepted from 127.0.0.1:62770 #9 for veronica_production.tmp.mr.mapreduce_1272529574_8_inc , name: "0_1" } I still have a question: what about the segmentation fault problem ? Now that we can rescue this particular utf-8 problem in Javascript, what about other problems that could occur ? Would mongod still crash ? |
| Comment by auto [ 28/Apr/10 ] |
|
Author: {'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}Message: handle utf8 errors better in js, try to convert to js error |
| Comment by Nicolas Fouché [ 28/Apr/10 ] |
|
If a throw a Javascript exception in my map method, logs show: Wed Apr 28 12:15:22 JS Error: uncaught exception: blah And I can launch any M/R I want after that. So the problem seems to occur only when a exception is launched in the C code. In this case, it's in engine_spidermonkey.cpp, and I cannot catch it in Javascript (with a try/catch block). throw UserException( 9006 , "invalid utf8" ); |
| Comment by Nicolas Fouché [ 27/Apr/10 ] |
|
By the way, if you know a solution to the first Map/Reduce fail, "invalid utf-8 string", I take it |
| Comment by Nicolas Fouché [ 27/Apr/10 ] |
|
Forgot to update the subject of the ticket, it's not quite exact. I let you change it to something like: "Segmentation fault if a former Map/Reduce query fails". |