[SERVER-40180] resmoke.py should escape null bytes in the output of subprocesses Created: 17/Mar/19  Updated: 29/Oct/23  Resolved: 18/Mar/19

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

Type: Improvement Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Fixed Votes: 0
Labels: tig-resmoke
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Sprint: STM 2019-03-25
Participants:
Story Points: 1

 Description   

mongod is very happy to write null bytes to its stdout when they come from user input. Take setting logComponentVerbosity={write: 1} and including a null byte in an update command as one example. mongod writing a null byte to its stdout causes resmoke.py to write a null bytes to its stdout. (resmoke.py currently only attempts to deal with how the server doesn't necessarily write valid UTF-8 to its logs, see SERVER-7506). This has an unfortunate consequence with tools like grep which treat output containing a null byte as binary rather than text.

In order to make it so grep --text doesn't need to be specified when engineers are filtering out log messages from the server that pass through resmoke.py, we should have resmoke.py escape b"\0" as

b"\\0"

.



 Comments   
Comment by Githook User [ 18/Mar/19 ]

Author:

{'email': 'max.hirschhorn@mongodb.com', 'name': 'Max Hirschhorn', 'username': 'visemet'}

Message: SERVER-40180 Escape null bytes in output of subprocesses.
Branch: master
https://github.com/mongodb/mongo/commit/a191b8f35eadb567d4bbb8d8826fc3702e99538b

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