Bug 405716

Summary: int-overflow in stack size Margin calculation
Product: [Developer tools] valgrind Reporter: alsdfjoiloeilt4o23l34jjjlskfjsadoh8s7df736giwqk
Component: drdAssignee: Bart Van Assche <bart.vanassche+kde>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 3.13.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description alsdfjoiloeilt4o23l34jjjlskfjsadoh8s7df736giwqk 2019-03-21 10:10:49 UTC
SUMMARY
int-overflow in stack size Margin calculation

STEPS TO REPRODUCE
1. run a multithreaded program which uses more stack than available with the following call: valgrind --tool=drd --show-stack-usage=yes ./myProg
2. drd reports: ==10476== thread 9 (which is a detached thread) finished and used 18223 bytes out of 16384 on its stack. Margin: 18446744073709549777 bytes.

OBSERVED RESULT
Margin shows a huge value

EXPECTED RESULT
Margin should show -1839

SOFTWARE/OS VERSIONS
Linux Xubuntu 18.04
Comment 1 Bart Van Assche 2019-03-22 03:10:20 UTC
A fix has been checked in on the master branch. Please verify.