Infinite recursion leading to crash when death tests are disabled
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 39.6k
- Forks
- 10.9k
- Avg merge
- 6d 13h
- Merged PRs (30d)
- 1
Description
**Describe the bug**
https://github.com/google/googletest/commit/e5686bb18b52dc29312a7b79c3d6ca2c826c31ed from https://github.com/google/googletest/pull/3090 introduced a change where `original_working_dir_` is only set when `GTEST_HAS_DEATH_TEST` are enabled. This makes the assumption that death tests being disabled is synonymous to being on a diskless system.
On a non-diskless system where `GTEST_HAS_DEATH_TEST` are disabled, this results in the variable being empty, and then `CreateDirectoriesRecursively` being called without a parent and recursing infinitely.
**Steps to reproduce the bug**
1. Define `GTEST_HAS_DEATH_TEST` to 0
2. run with `-gtest_output=xml:out.xml`
I will provide a PR for this, but I was curious to know if there was a reason to make the assumption that "diskless" and death tests are correlated?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing original_working_dir_ and CreateDirectoriesRecursively in the XML output path handling. Reproduce with GTEST_HAS_DEATH_TEST set to 0 and -gtest_output=xml:out.xml; done means the command no longer recurses infinitely and produces the expected XML output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100