[SERVER-10784] Additional information for bsonobj size assertions Created: 16/Sep/13  Updated: 06/Dec/22  Resolved: 02/Nov/21

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Alexander Komyagin Assignee: Backlog - Storage Execution Team
Resolution: Won't Do Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Assigned Teams:
Storage Execution
Participants:

 Description   

In order to be able to diagnose BSONObj size assertions we need to log additional information along with them:

Sun Sep  1 17:09:17 [conn509177] Assertion: 10334:Invalid BSONObj size: 1953785856 (0x00687474) first element: ://XXXXXXXXX.com/XXXXXXXXX/picture: ?type=112
0xb07561 0xacd449 0xacd5cc 0x5721e8 0x80cdb5 0x80d748 0x6515d1 0x83081e 0x6f1152 0x6e8e51 0x6ea7e0 0x6eb67c 0x837468 0x83abb0 0x7b0afd 0x7b3e23 0x56c688 0xaf57b5 0x7f40aebdae9a 0x7f40adef04bd 
 /usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x21) [0xb07561]
 /usr/bin/mongod(_ZN5mongo11msgassertedEiPKc+0x99) [0xacd449]
 /usr/bin/mongod() [0xacd5cc]
 /usr/bin/mongod(_ZNK5mongo7BSONObj14_assertInvalidEv+0x468) [0x5721e8]
 /usr/bin/mongod(_ZNK5mongo19CoveredIndexMatcher7matchesERKNS_7BSONObjERKNS_7DiskLocEPNS_12MatchDetailsEb+0x1f5) [0x80cdb5]
 /usr/bin/mongod(_ZNK5mongo19CoveredIndexMatcher14matchesCurrentEPNS_6CursorEPNS_12MatchDetailsE+0xa8) [0x80d748]
 /usr/bin/mongod(_ZN5mongo6Cursor14currentMatchesEPNS_12MatchDetailsE+0x41) [0x6515d1]
 /usr/bin/mongod(_ZN5mongo8runCountEPKcRKNS_7BSONObjERSsRi+0x6ce) [0x83081e]
 /usr/bin/mongod(_ZN5mongo8CmdCount3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb+0x62) [0x6f1152]
 /usr/bin/mongod(_ZN5mongo12_execCommandEPNS_7CommandERKSsRNS_7BSONObjEiRNS_14BSONObjBuilderEb+0x51) [0x6e8e51]
 /usr/bin/mongod(_ZN5mongo11execCommandEPNS_7CommandERNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb+0xe70) [0x6ea7e0]
 /usr/bin/mongod(_ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi+0x2ac) [0x6eb67c]
 /usr/bin/mongod(_ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi+0x38) [0x837468]
 /usr/bin/mongod(_ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_+0xc10) [0x83abb0]
 /usr/bin/mongod() [0x7b0afd]
 /usr/bin/mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE+0x3a3) [0x7b3e23]
 /usr/bin/mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0x98) [0x56c688]
 /usr/bin/mongod(_ZN5mongo3pms9threadRunEPNS_13MessagingPortE+0x415) [0xaf57b5]
 /lib/x86_64-linux-gnu/libpthread.so.0(+0x7e9a) [0x7f40aebdae9a]
 /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7f40adef04bd]
<...>
Sun Sep  1 17:06:59 [conn630365] remove COLLECTION_XXXX query: { FIELD_XXXX._id: ObjectId('XXXXXXXXXXXXXXXXXXXXXXXXXX') } keyUpdates:0 exception: Invalid BSONObj size: 1953785856 (0x00687474) first element: ://XXXXXXXXX.com/XXXXXXXXXXXXXXXXXXX/picture: ?type=112 code:10334 locks(micros) w:4748 4ms

At this point it seems reasonable to have the following in addition to stack trace:

  • namespace
  • file name
  • offset


 Comments   
Comment by Dianna Hohensee (Inactive) [ 02/Nov/21 ]

In the presence of heap corruption, it would probably be unwise to try to follow pointers around. We're closing as Won't Do.

Comment by Alexander Komyagin [ 20/Sep/13 ]

Is this information unavailable at the moment we detect the invalid BSONObj size?

Comment by Daniel Pasette (Inactive) [ 20/Sep/13 ]

We don't have any blanket way to return this information after this check fails.

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