We had a crash when bootstrapping UNO because someone removed the current working directory. Stacktrace: SEGV libuno_cppu.so.3(uno_getMapping+0x178)[0x7ffff43372c8] libuno_cppuhelpergcc3.so.3(+0x64dea)[0x7ffff4bbadea] libuno_cppuhelpergcc3.so.3(_ZN4cppu40defaultBootstrap_InitialComponentContextERKN3rtl8OUStringE+0x6f9)[0x7ffff4b993b9] uno_getMapping crashed due to aFrom, aTo being nullptr, caused by osl_getModuleURLFromAddress always returning false - so no module could be loaded. osl_getModuleURLFromAddress called osl_getProcessWorkingDir(workDir), which returned a nullptr as workDir because the current working dir had been deleted. This caused osl_getModureURLFromAddress to return false, even though the module path (as returned by getModulePathFromAddress) was an absolute path. To improve robustness against such (accidental) work directory removals, I suggest osl_getModuleURLFromAddress to not check the current working directory at all, but to delegate checking of the working dir to osl_getAbsoluteFileURL(...), once the given path is detected to be a relative path.
@Mike, I thought you might be interested in this issue
There is probably no good reason that osl_getModuleURLFromAddress calls osl_getAbsoluteFileURL(workDir,...) ever since <https://git.libreoffice.org/core/+/3dfb38a45d6495d357c3359b5b02cde871df6f67%5E!/> "added getUrlFromAddress (#88338#)", apparently under the assumption that the pathname obtained from dladdr might be relative to the process's CWD. I'll see to rip that out.
Stephan Bergmann committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c8976bdfdfa361fec9e1e5ff342094e409981fad tdf#137208 Assume that dladdr provides an absolute pathname It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thank you Stephan, your fix works well.