[SERVER-11617] Sorting with value of Infinity causes assertion Created: 07/Nov/13  Updated: 11/Jul/16  Resolved: 21/Nov/13

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

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

> db.serverBuildInfo()
{
"version" : "2.5.4-pre-",
"gitVersion" : "9766387567e366e167835880818369cee7f8d42d",
"OpenSSLVersion" : "",
"sysInfo" : "Darwin vero 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49",
"loaderFlags" : "-fPIC -pthread -Wl,-bind_at_load -mmacosx-version-min=10.6",
"compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wno-unknown-pragmas -Winvalid-pch -pipe -O3 -Wno-unused-function -Wno-deprecated-declarations -mmacosx-version-min=10.6",
"allocator" : "tcmalloc",
"versionArray" : [
2,
5,
4,
-100
],
"javascriptEngine" : "V8",
"bits" : 64,
"debug" : false,
"maxBsonObjectSize" : 16777216,
"ok" : 1
}


Attachments: File server11617.js    
Issue Links:
Depends
is depended on by SERVER-9277 Ranged index bounds do not permit ret... Closed
Duplicate
duplicates SERVER-12511 2.4 indexes can cause incorrect resul... Closed
Related
related to SERVER-11837 Documents with value Infinity for ind... Closed
Operating System: ALL
Participants:

 Description   

Problem:
Sorting on an element who's value is Infinity, causes an assertion.

Reproduce:

db.q.drop()
db.q.insert({ "_id" : 688, "b" : Infinity })
db.q.find(  { "b" : { $gte : 314159265019 } }  )
db.q.find(  { "b" : { $gte : 314159265019 } }  ).sort( { "b" : 1 } )
error: { "$err" : "assertion src/mongo/db/exec/sort.cpp:166" }

This executes without an assertion on 2.4.5



 Comments   
Comment by Githook User [ 21/Nov/13 ]

Author:

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

Message: SERVER-11617 fixed index bounds for numerical types to support infinity
Branch: master
https://github.com/mongodb/mongo/commit/12d8903c8a16ca7aa12090846b2a0a0cce7654b0

Comment by Alvin Richards (Inactive) [ 07/Nov/13 ]

The predicate seems to influence this assert, if removed the query executes

> db.q.find().sort( { "b" : 1 } )
{ "_id" : 688, "b" : Infinity }

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