[SERVER-28825] Do not decode BSONObj in pretty printer if the value is optimized out Created: 17/Apr/17  Updated: 12/Oct/17  Resolved: 15/Jun/17

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 3.5.9

Type: Improvement Priority: Major - P3
Reporter: Daniel Gottlieb (Inactive) Assignee: Jonathan Abrahams
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: TIG 2017-06-19
Participants:

 Description   

In this case the exception was handled appropriately and the stack trace simply adds clutter.

[2017/04/14 18:03:54.372] #10 mongo::BlockingQueue<mongo::BSONObj>::blockingPeek (maxSecondsToWait=<optimized out>, t=Traceback (most recent call last):
[2017/04/14 18:03:54.372]   File "/data/mci/e6de067bfc5da5ee34edb8f24276e6de/src/buildscripts/gdb/mongo_printers.py", line 293, in __call__
[2017/04/14 18:03:54.372]     return printer.printer(val)
[2017/04/14 18:03:54.373]   File "/data/mci/e6de067bfc5da5ee34edb8f24276e6de/src/buildscripts/gdb/mongo_printers.py", line 106, in __init__
[2017/04/14 18:03:54.373]     self.size = struct.unpack('<I', inferior.read_memory(self.ptr, 4))[0]
[2017/04/14 18:03:54.373] gdb.error: value has been optimized out
[2017/04/14 18:03:54.373] <synthetic pointer>..., this=0x6c25638) at src/mongo/util/queue.h:219
[2017/04/14 18:03:54.374] #11 mongo::repl::OplogBufferBlockingQueue::waitForData (this=0x6c25630, waitDuration=...) at src/mongo/db/repl/oplog_buffer_blocking_queue.cpp:100



 Comments   
Comment by Githook User [ 15/Jun/17 ]

Author:

{u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}

Message: SERVER-28825 Do not decode BSONObj in pretty printer if the value is optimized out by checking with is_optimized_out.
Branch: master
https://github.com/mongodb/mongo/commit/caa31b2d9ecdc725fc5cf872a656a3bf31900e79

Comment by Jonathan Abrahams [ 14/Jun/17 ]

Implementing with test for is_optimized_out.

Comment by Max Hirschhorn [ 14/Jun/17 ]

jonathan.abrahams, could we instead have used Value.is_optimized_out (i.e. self.ptr.is_optimized_out) to avoid triggering the exception in the first place? The exception handling as written suppresses all errors from GDB, including ones that may not be related to the value being optimized out.

Comment by Githook User [ 14/Jun/17 ]

Author:

{u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}

Message: SERVER-28825 Do not decode BSONObj in pretty printer if the value is optimized out
Branch: master
https://github.com/mongodb/mongo/commit/134d2ba06c81ee09d98ef226dc1f09f5e05a49dd

Generated at Thu Feb 08 04:19:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.