mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-11 14:01:48 +00:00
rev 12001 has introduced a regression in VG_(env_remove_valgrind_env_stuff): to avoid modifying a possibly read-only env string, the string is duplicated, and the copy is modified. However, mash_env_column modifies the string "in-place". The modified string was not put back in the env (and could not, because the src string is only partially copied). This means that the valgrind preload strings were not cleaned up and when a 32 bit executable execs a 64 bits (or vice versa: 64 bit execs 32 bits), LD_PRELOAD contains both the 32 bits and 64 bits versions of Valgrind vgpreload.... => ld.so then gives an error msg, as it can't preload either the 32 or the 64 bits version. The patch fixes this by duplicating the whole env string, and passing to mash_colon_env a pointer to the correct offset in the whole env string. The duplicated string is replacing the original entry in envp. This patch adds two regression tests : none/tests/allexec32 and none/tests/allexec64. On a bi-arch valgrind, these will be 32bits and 64 bits executables, exec-ing each other. On a single arch, one will be a symlink to the other (to avoid different .exp files, and still test exec). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12287
37 lines
872 B
Bash
Executable File
37 lines
872 B
Bash
Executable File
#! /bin/sh
|
|
|
|
# prepare the hard or soft link allexec32 and allexec64
|
|
# On 'single arch' compiled Valgrind, allexec32 and allexec64 will point
|
|
# to the same executable.
|
|
# On 'bi-arch', they will point respectively to the executable compiled
|
|
# for the revelant arch.
|
|
# This allows to test the various exec system calls the same way.
|
|
|
|
|
|
pair()
|
|
{
|
|
if ../../tests/arch_test $1 || ../../tests/arch_test $2
|
|
then
|
|
if ../../tests/arch_test $1
|
|
then
|
|
ln -f $1/allexec allexec32
|
|
else
|
|
ln -f -s allexec64 allexec32
|
|
fi
|
|
if ../../tests/arch_test $2
|
|
then
|
|
ln -f $2/allexec allexec64
|
|
else
|
|
ln -f -s allexec32 allexec64
|
|
fi
|
|
fi
|
|
}
|
|
|
|
|
|
pair x86 amd64
|
|
pair ppc32 ppc64
|
|
pair s390x_unexisting_in_32bits s390x
|
|
pair arm arm_unexisting_in_64bits
|
|
|
|
exit 0
|