Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROOT does not work when launched from non-accessible folder #12409

Closed
ktf opened this issue Mar 2, 2023 · 9 comments
Closed

ROOT does not work when launched from non-accessible folder #12409

ktf opened this issue Mar 2, 2023 · 9 comments
Assignees
Labels
bug experiment Affects an experiment / reported by its software & computimng experts priority:critical

Comments

@ktf
Copy link
Contributor

ktf commented Mar 2, 2023

  • [x ] Checked for duplicates

Describe the bug

ROOT 6.28.00 does not work correctly when $PWD is not accessible by the user.

If I do:

mkdir -p foo
cd foo
chmod 000 .
root

it fails with:

input_line_2:1:10: fatal error: cannot open file './cling/Interpreter/RuntimeUniverse.h': Permission denied
#include "cling/Interpreter/RuntimeUniverse.h"
         ^
Replaced symbol atexit cannot be found in JIT!
Replaced symbol at_quick_exit cannot be found in JIT!
input_line_4:2:10: fatal error: cannot open file './TError.h': Permission denied
#include "TError.h"
         ^
input_line_5:1:10: fatal error: cannot open file './cling/Interpreter/DynamicLookupRuntimeUniverse.h': Permission denied
#include "cling/Interpreter/DynamicLookupRuntimeUniverse.h"

the same snippet works fine with 6.26.10.

Notice things work fine with just the x bit set (i.e. chmod 100 . still works).

Expected behavior

The standard root prompt without any error.

To Reproduce

See above.

mkdir -p foo
cd foo
chmod 000 .
root

Setup

ROOT 6.28.00, both el7 and ubuntu.

Additional context

While this can look like a corner case, it reflects the way ALICE runs its online reconstruction jobs, so it's rather critical for us. I am in parallel trying to understand if the unaccessible cwd can be avoided, but this might have non trivial implications (and its for sure beyond my responsibilities).

@ktf ktf added the bug label Mar 2, 2023
@ktf
Copy link
Contributor Author

ktf commented Mar 2, 2023

@knopers @vascobarroso FYI

@Axel-Naumann Axel-Naumann added experiment Affects an experiment / reported by its software & computimng experts priority:critical labels Mar 2, 2023
@ktf
Copy link
Contributor Author

ktf commented Mar 2, 2023

@Barthelemy

@ktf
Copy link
Contributor Author

ktf commented Mar 2, 2023

I had a typo in the reproducer, now corrected.

@ktf
Copy link
Contributor Author

ktf commented Mar 2, 2023

For ALICE people see also https://alice.its.cern.ch/jira/browse/O2-3591.

@ktf
Copy link
Contributor Author

ktf commented Mar 2, 2023

FYI @pzhristov

@Axel-Naumann
Copy link
Member

Update: I can reproduce this with the (for our tests nicer) case

mkdir cling
chmod a-xr cling
root

which gives the same diagnostics as above.

Axel-Naumann added a commit to Axel-Naumann/root that referenced this issue Mar 3, 2023
These headers are part of cling, not user code, so starting
with the current directory is pointless and can actually be
counterproductive.

This helps with root-project#12409
but not enough; any dictionary header will still try to access "./".
@Axel-Naumann
Copy link
Member

clang does not work when launched from non-accessible folder, either:

$ mkdir noread
$ cd noread/
$ chmod a-rwx .
$ echo '#include "ROOT/config/RVersion.hxx"' | clang++ -I. -I$ROOTSYS/include/  -fsyntax-only -x c++ -
<stdin>:1:10: fatal error: cannot open file './ROOT/config/RVersion.hxx': Permission denied
#include "ROOT/config/RVersion.hxx"
         ^
1 error generated.

I.e. clang tries to argue "don't do that". But I would argue "clang, please." because it even just goes on and finds the header!

This was introduced here, with subsequent refinements to not have so many irrelevant errors. #12418 now adds another case.

Axel-Naumann added a commit that referenced this issue Mar 3, 2023
These headers are part of cling, not user code, so starting
with the current directory is pointless and can actually be
counterproductive.

This helps with #12409
but not enough; any dictionary header will still try to access "./".
FonsRademakers pushed a commit to root-project/cling that referenced this issue Mar 3, 2023
These headers are part of cling, not user code, so starting
with the current directory is pointless and can actually be
counterproductive.

This helps with root-project/root#12409
but not enough; any dictionary header will still try to access "./".
Axel-Naumann added a commit to Axel-Naumann/root that referenced this issue Mar 6, 2023
These headers are part of cling, not user code, so starting
with the current directory is pointless and can actually be
counterproductive.

This helps with root-project#12409
but not enough; any dictionary header will still try to access "./".

(cherry picked from commit e660b0b)
Axel-Naumann added a commit that referenced this issue Mar 9, 2023
These headers are part of cling, not user code, so starting
with the current directory is pointless and can actually be
counterproductive.

This helps with #12409
but not enough; any dictionary header will still try to access "./".

(cherry picked from commit e660b0b)
@Axel-Naumann
Copy link
Member

Fixed in master and 6.28/02, thanks for reporting!

omazapa pushed a commit to omazapa/root that referenced this issue Apr 13, 2023
These headers are part of cling, not user code, so starting
with the current directory is pointless and can actually be
counterproductive.

This helps with root-project#12409
but not enough; any dictionary header will still try to access "./".
@Axel-Naumann
Copy link
Member

Follow-up to potentially upstream this: https://discourse.llvm.org/t/evil-elements-in-header-search-path-cause-havoc/70705

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug experiment Affects an experiment / reported by its software & computimng experts priority:critical
Projects
None yet
Development

No branches or pull requests

3 participants