[SERVER-66842] Fix CodeFragment::toString() Created: 27/May/22  Updated: 29/Oct/23  Resolved: 11/Jul/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Task Priority: Major - P3
Reporter: Ian Boros Assignee: Parker Felix
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: QE 2022-06-27, QE 2022-07-11, QE 2022-07-25
Participants:

 Description   

The VM bytecode toString() function does not work when certain instructions are present (fillEmptyConst, getFieldConst, traversePConst, traverseFConst, and others). This is because the instruction pointer does not advance correctly. We should fix this, and add a sanity test for toString().

https://github.com/mongodb/mongo/blob/6bd5618937542267553791332394c571973740eb/src/mongo/db/exec/sbe/vm/vm.cpp#L175



 Comments   
Comment by Githook User [ 23/Jun/22 ]

Author:

{'name': 'Parker Felix', 'email': 'parker.felix@mongodb.com', 'username': 'parker-felix'}

Message: SERVER-66842 Fix pcPointer for instructions that take arguments in CodeFragment::toString()
Branch: davish/SERVER-63099
https://github.com/mongodb/mongo/commit/af7d7199295acdd5001ff25e197fe74d93cfef66

Comment by Githook User [ 22/Jun/22 ]

Author:

{'name': 'Parker Felix', 'email': 'parker.felix@mongodb.com', 'username': 'parker-felix'}

Message: SERVER-66842 Fix pcPointer for instructions that take arguments in CodeFragment::toString()
Branch: master
https://github.com/mongodb/mongo/commit/af7d7199295acdd5001ff25e197fe74d93cfef66

Comment by Kyle Suarez [ 31/May/22 ]

This isn't severe because there are actually no callers of this function: http://10.1.2.40/mongodb/search?q=%2Bcallers%3A%22mongo%3A%3Asbe%3A%3Avm%3A%3ACodeFragment%3A%3AtoString%28%29+const%22

ian.boros@mongodb.com and martin.neupauer@mongodb.com, I assume we still want to maintain this for future debugging purposes?

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