[SERVER-40131] Incorrect format string in Windows stacktrace generator. Created: 14/Mar/19  Updated: 29/Oct/23  Resolved: 18/Mar/19

Status: Closed
Project: Core Server
Component/s: Logging
Affects Version/s: None
Fix Version/s: 3.6.12, 4.0.9, 4.1.10

Type: Bug Priority: Major - P3
Reporter: John Festa Assignee: John Festa
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0, v3.6
Steps To Reproduce:

The format string passed to _snprintf is "0x%llux". The 'u' and 'x' are mutally exclusive. Since the output is expected to be a hexadecimal number, the correct string is "0x%llx".

 
 
 
 
 
 
 
 

Participants:

 Description   

The following line reports incorrect stacktrace information due to an incorrect formatting string.

src/mongo/util/stacktrace_windows.cpp:224

_snprintf(symbolOffset.get(), bufferSize, "+"0x%llux", displacement64);

The format string should be "0x%llx"



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

Author:

{'name': 'JohnFestaMongo', 'username': 'JohnFestaMongo', 'email': 'john.festa@mongodb.com'}

Message: SERVER-40131 Incorrect format string in Windows stacktrace generator

close #1301

Signed-off-by: Mark Benvenuto <mark.benvenuto@mongodb.com>
(cherry picked from commit 41d912bb27877d7965aa64b51c4cd7a8c79590cc)
Branch: v3.6
https://github.com/mongodb/mongo/commit/c8e20b5cb43e950f32fc36a79fb7d5b16da424a1

Comment by Githook User [ 29/Mar/19 ]

Author:

{'name': 'JohnFestaMongo', 'username': 'JohnFestaMongo', 'email': 'john.festa@mongodb.com'}

Message: SERVER-40131 Incorrect format string in Windows stacktrace generator

close #1301

Signed-off-by: Mark Benvenuto <mark.benvenuto@mongodb.com>
(cherry picked from commit 41d912bb27877d7965aa64b51c4cd7a8c79590cc)
Branch: v4.0
https://github.com/mongodb/mongo/commit/75bb4ccaec68d6ce691ced12cb97529509310e52

Comment by Githook User [ 18/Mar/19 ]

Author:

{'email': 'john.festa@mongodb.com', 'name': 'JohnFestaMongo', 'username': 'JohnFestaMongo'}

Message: SERVER-40131 Incorrect format string in Windows stacktrace generator

close #1301

Signed-off-by: Mark Benvenuto <mark.benvenuto@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/41d912bb27877d7965aa64b51c4cd7a8c79590cc

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