"Environment" related crashes
hadess opened this issue · comments
hadess commented
The upower test suite randomly crashes in getenv()
: https://gitlab.freedesktop.org/upower/upower/-/issues/216
I think that one of the possible reasons is the code that creates the testbed in src/umockdev.vala
first creates a worked thread, and then sets UMOCKDEV_DIR
. If the worker thread reads from the environment while the main thread is still setting up the environment, that could lead to a crash.
I would recommend:
- starting the worker thread after the
checked_setenv()
call - making a copy of the value of
UMOCKDEV_DIR
and passing it as data to the thread you're creating, so it has its own copy of the string and doesn't need to poke at the environment from another thread.
Martin Pitt commented
Thanks for the report! I sent a fix to PR #207.
hadess commented
Would it be possible to have this be made available in a release? I can only get one in 10 CI runs to pass in upower right now.
Martin Pitt commented