https://bugs.kde.org/show_bug.cgi?id=369209
Bug ID: 369209 Summary: valgrind loops and eats up all memory (very slowly) when the current working directory doesn't exist. Product: valgrind Version: 3.12 SVN Platform: Other OS: Linux Status: UNCONFIRMED Severity: normal Priority: NOR Component: general Assignee: jsew...@acm.org Reporter: m...@redhat.com The following code in record_startup_wd(): /* Simple: just ask the kernel */ SysRes res; SizeT szB = 0; do { szB += 500; startup_wd = VG_(realloc)("startup_wd", startup_wd, szB); VG_(memset)(startup_wd, 0, szB); res = VG_(do_syscall2)(__NR_getcwd, (UWord)startup_wd, szB-1); } while (sr_isError(res)); Will loop forever when getcwd() produces any error. It should check that the error is ERANGE. Even when fixing that and returning an error (False) will make valgrind refuse to run the program. This isn't really necessary because often the startup_wd isn't really used or needed. Reproducible: Always -- You are receiving this mail because: You are watching all bug changes.