--- Comment #1 from Mark Wielaard <> ---
Created attachment 101237
Don't require the current working directory to exist.

At startup valgrind fetches the current working directory and stashes
it way to be used later (in debug messages, read config files or create
log files). But if the current working directory didn't exist (or there
was some other error getting its path) then valgrind would go in a
endless loop. This was caused by assuming that any error meant a larger
buffer needed to be created to store the cwd path (ERANGE). However
there could be other reasons calling getcwd failed.

Fix this by only looping and resizing the buffer when the error is
ERANGE. Any other error just means we cannot fetch and store the current
working directory. Fix all callers to check get_startup_wd() returns
NULL. Only abort startup if a relative path needs to be used for
user supplied relative log files. Debug messages will just show
"<NO CWD>". And skip reading any config files from the startup_wd
if it doesn't exist.

Also add a new testcase that tests executing valgrind in a non-existing
directory (none/tests/nocwd.vgtest).

You are receiving this mail because:
You are watching all bug changes.

Reply via email to