Issue Details (XML | Word | Printable)

Key: SERVER-622
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Eliot Horowitz
Reporter: Colin Snover
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Core Server

element_.eoo assertion on invalid upsert

Created: Feb 10 2010 04:20 AM UTC   Updated: Feb 12 2010 02:46 PM UTC
Component/s: None
Affects Version/s: None
Fix Version/s: 1.3.2

Environment: mongodb-linux-x86_64-1.3.1 (binary release) running on Linux 2.6.31-17-generic (Ubuntu 9.10), PHP 5.2.10-2ubuntu6.4

Backport: No


 Description  « Hide
{code}
<?php
class Site {
  public $url;
  public $title;
}

$site = new Site();

$db = new MongoDB(new Mongo(), 'wotato');

// Inserts { "_id" : ObjectId(...), "title" : null, "url" : null }
$db->test->update(array('url' => 'http://example.com'), array('$set' => $site), array('upsert' => true));

$site->url = 'http://example.com';

// As update: Assertion error in database engine
// Expected: Successful update { "_id" : ObjectId(...), "url" : "http://example.com", "title" : null }
$db->test->update(array('url' => 'http://example.com'), array('$set' => $site), array('upsert' => true));

$db->dropCollection('test');

// As insert: Assertion error here too
// Expected: Successful insert { "_id" : ObjectId(...), "url" : "http://example.com", "title" : null }
$db->test->update(array('url' => 'http://example.com'), array('$set' => $site), array('upsert' => true));
{code}

Assertion (same for both operations):
{code}
Wed Feb 10 03:10:10 test.test Assertion failure !element_.eoo() db/jsobjmanipulator.h 32
0x4e8316 0x4f095f 0x550e9a 0x557b36 0x5597a3 0x5cbd7c 0x5ce1ca 0x647105 0x65f930 0x7f6fbc721a04 0x7f6fbbce080d
 ./mongod(_ZN5mongo12sayDbContextEPKc+0xe6) [0x4e8316]
 ./mongod(_ZN5mongo8assertedEPKcS1_j+0x13f) [0x4f095f]
 ./mongod(_ZNK5mongo6ModSet16applyModsInPlaceERKNS_7BSONObjE+0x34a) [0x550e9a]
 ./mongod(_ZN5mongo6ModSet18createNewFromQueryERKNS_7BSONObjE+0x676) [0x557b36]
 ./mongod(_ZN5mongo13updateObjectsEPKcNS_7BSONObjES2_bbbRNS_7OpDebugE+0x1893) [0x5597a3]
 ./mongod(_ZN5mongo14receivedUpdateERNS_7MessageERNS_5CurOpE+0x60c) [0x5cbd7c]
 ./mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERK11sockaddr_in+0xfaa) [0x5ce1ca]
 ./mongod(_ZN5mongo10connThreadEv+0x235) [0x647105]
 ./mongod(thread_proxy+0x80) [0x65f930]
 /lib/libpthread.so.0 [0x7f6fbc721a04]
 /lib/libc.so.6(clone+0x6d) [0x7f6fbbce080d]
Wed Feb 10 03:10:10 update test.test query: { url: "http://example.com" } exception assertion db/jsobjmanipulator.h:32 1ms
{code}

 All   Comments   Change History   git Commits      Sort Order: Ascending order - Click to sort in descending order
Colin Snover added a comment - Feb 10 2010 04:27 AM UTC
Argh...can't edit description!

I am not sure that the upsert I am doing is actually invalid; I was just confused based on the response to SERVER-514.

Also, this is actually a SERVER issue, not PHP; I didn't think it was initially, but then I realized that the test I was doing on the command-line was not the same (I was omitting $set). Sorry!

Kristina Chodorow made changes - Feb 10 2010 06:21 AM UTC
Field Original Value New Value
Project PHP Driver [ 10007 ] Core Server [ 10000 ]
Key PHP-80 SERVER-622
Backport No
Kristina Chodorow added a comment - Feb 10 2010 06:24 AM UTC
This does seem to be a server bug, the equivalent JS code reproduces the assertion on the command line:

> db.foo.update({'url':'http://example.com'},{$set:{url:'http://example.com', 'title':null}}, true)
!element_.eoo()

Seems like ending the $set with a null messes things up.

Kristina Chodorow made changes - Feb 10 2010 06:24 AM UTC
Assignee Kristina Chodorow [ kristina ] Eliot Horowitz [ eliot ]
auto added a comment - Feb 10 2010 01:35 PM UTC
Author:{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}
Message: test for SERVER-622
http://github.com/mongodb/mongo/commit/38b822809b4ee78dc7721b49096b7b52761d155b

Eliot Horowitz added a comment - Feb 10 2010 01:35 PM UTC
see set5.js

Eliot Horowitz made changes - Feb 10 2010 01:35 PM UTC
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 1.3.2 [ 10117 ]
Resolution Fixed [ 1 ]
Repository Revision Date Author/Committer Message
server 38b8228... Wed Feb 10 18:35:43 UTC 2010 Eliot Horowitz / Eliot Horowitz test for SERVER-622
Files Changed
ADD jstests/set5.js

Eliot Horowitz made changes - Feb 12 2010 02:46 PM UTC
Status Resolved [ 5 ] Closed [ 6 ]