Bugzilla – Bug 1952
DCE can't parse envp argument of main function
Last modified: 2014-07-16 11:11:14 EDT
1. I've compiled bash 4.1 (and 4.3, but 4.1 seems to have been the one originally used in the examples) with the needed -fPIC and -pie flags
using the hints given in the example/bash/dce-bash-simple.cc
2. Checked if the executable is now dynamic, using readelf
3. run the example: './waf --run dce-bash-simple --command-template="gdb --args %s "' but a sigsegv is given:
The reason of this crash is due to the fact that DCE doesn't pass envp argument (3rd one) of main function, resulting bash accesses uninitialized memory area making him crash.
fixed with changeset 2973905a7151.