[SERVER-62561] jstests/libunwind/stacktrace_signal.js must explicitly convert pids to strings Created: 12/Jan/22  Updated: 29/Oct/23  Resolved: 13/Jan/22

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

Type: Bug Priority: Major - P3
Reporter: Richard Samuels (Inactive) Assignee: Richard Samuels (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

Replace the test with the following code block to simulate:

(function() {
const pid = 1.13879e+06;
runMongoProgram('/bin/kill', '-s', 'SIGUSR2', pid);
})();
 

Sprint: STM 2022-01-24
Participants:
Linked BF Score: 14
Story Points: 0

 Description   

This code block is vulnerable to receiving a large pid from MongoRunner. In practice, a mongod instance had a pid of 1138790 which was represented in javascript as 1.13879e+06.

This can be fixed by calling .toString() on the PID.



 Comments   
Comment by Githook User [ 13/Jan/22 ]

Author:

{'name': 'Richard Samuels', 'email': 'richard.l.samuels@gmail.com', 'username': 'richardsamuels'}

Message: SERVER-62561 jstests/libunwind/stacktrace_signal.js must explicitly convert pids to strings
Branch: master
https://github.com/mongodb/mongo/commit/85cc4332549a8aa66d7097b0c9a63d8c73b88bf8

Generated at Thu Feb 08 05:55:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.