Installation problem: all global pointer are wrong (/dev/random)

Hello

We are trying to install our platform that rely on ROOT on several different clusters and we’re facing an unexpected issue on a RedHat 6.9 system with cmake 3.7.2…

The log is join to this thread. The compilation goes as expected until the very last step :
local_root_configure.txt (10.6 KB)

The problem that you’ll see below can be obtained by calling any global pointer in root (gSystem, gStyle…)

Have you ever seen this ? Any guess of what’s been done wrong ?

Thanks in advance
cheers
jb

Scanning dependencies of target hsimple
[100%] Generating tutorials/hsimple.root
Processing hsimple.C…
open(’/dev/random’): Permission denied
#0 0x00002adce34fb82e in waitpid () from /lib64/libc.so.6
#1 0x00002adce348d479 in do_system () from /lib64/libc.so.6
#2 0x00002adce271c92b in TUnixSystem::StackTrace() () at /ccc/scratch/cont002/den/uranie/tmp_sources/root-6.14.00/core/unix/src/TUnixSystem.cxx:2119
#3 0x00002adce5cc27f5 in cling::MultiplexInterpreterCallbacks::PrintStackTrace() () from /ccc/scratch/cont002/den/uranie/tmp_sources/root-6.14.00_build/lib/libCling.so
#4 0x00002adce5cc1e7d in cling_runtime_internal_throwIfInvalidPointer () from /ccc/scratch/cont002/den/uranie/tmp_sources/root-6.14.00_build/lib/libCling.so
#5 0x00002adcf5361370 in ?? ()
#6 0x0000000000000033 in ?? ()
#7 0x0000000002c40310 in ?? ()
#8 0x000000004f48c86b in ?? ()
#9 0x00002adce1d84ea5 in do_lookup_x () from /lib64/ld-linux-x86-64.so.2
#10 0x00007ffe2f7a56a0 in ?? ()
#11 0x0000000303375cb0 in ?? ()
#12 0x00007ffe2f7a56a0 in ?? ()
#13 0x0000000000000033 in ?? ()
#14 0x0000000002c40310 in ?? ()
#15 0x000000002184bba3 in ?? ()
#16 0x00002adce1d84ea5 in do_lookup_x () from /lib64/ld-linux-x86-64.so.2
#17 0x00002adce1d8526a in _dl_lookup_symbol_x () from /lib64/ld-linux-x86-64.so.2
#18 0x00002adce35762a6 in do_sym () from /lib64/libc.so.6
#19 0x00002adce37e40c4 in dlsym_doit () from /lib64/libdl.so.2
#20 0x00002adce1d895e6 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#21 0x00002adce37e429c in _dlerror_run () from /lib64/libdl.so.2
#22 0x00002adce37e408f in dlsym () from /lib64/libdl.so.2
#23 0x00002adce7c669a7 in llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(char const*) () from /ccc/scratch/cont002/den/uranie/tmp_sources/root-6.14.00_build/lib/libCling.so
#24 0x00002adce5d2927d in llvm::orc::LambdaResolver<cling::IncrementalJIT::addModule(std::shared_ptrllvm::Module const&)::{lambda(std::basic_string<char, std::char_traits, std::allocator > const&)#1}, cling::IncrementalJIT::addModule(std::shared_ptrllvm::Module const&)::{lambda(std::basic_string<char, std::char_traits, std::allocator > const&)#2}>::findSymbolInLogicalDylib(std::basic_string<char, std::char_traits, std::allocator > const&) () from /ccc/scratch/cont002/den/uranie/tmp_sources/root-6.14.00_build/lib/libCling.so
#25 0x00002adce63c1d3c in llvm::RuntimeDyldImpl::resolveExternalSymbols() () from /ccc/scratch/cont002/den/uranie/tmp_sources/root-6.14.00_build/lib/libCling.so
#26 0x0000000003365740 in ?? ()
#27 0x0000000000028e00 in ?? ()
#28 0x0000000003377600 in ?? ()
#29 0x00002adce37dd120 in ?? () from /lib64/libc.so.6
#30 0x0000000000016f40 in ?? ()
#31 0x0000000000000001 in ?? ()
#32 0x00000000e34c7c18 in ?? ()
#33 0x00000000031c5640 in ?? ()
#34 0x00000000031b0f90 in ?? ()
#35 0x00000000031fcb60 in ?? ()
#36 0x000000002f7a5dc0 in ?? ()
#37 0x00000000031c8090 in ?? ()
#38 0x000000000316be18 in ?? ()
#39 0x000000000316bde0 in ?? ()
#40 0x000000000316be18 in ?? ()
#41 0x00002adce2d95820 in ?? () from /ccc/products/gcc-4.9.1/default/lib64/libstdc++.so.6
#42 0x00002adce7c28812 in llvm::StringMapImpl::FindKey(llvm::StringRef) const () from /ccc/scratch/cont002/den/uranie/tmp_sources/root-6.14.00_build/lib/libCling.so
#43 0x00002adce5d23a0e in std::_Function_handler<llvm::Expected ()(), llvm::orc::RTDyldObjectLinkingLayer::ConcreteLinkedObject<std::shared_ptrllvm::RuntimeDyld::MemoryManager, std::shared_ptrllvm::JITSymbolResolver, llvm::orc::RTDyldObjectLinkingLayer::addObject(std::shared_ptr<llvm::object::OwningBinaryllvm::object::ObjectFile >, std::shared_ptrllvm::JITSymbolResolver)::{lambda(std::_List_iterator<std::unique_ptr<llvm::orc::RTDyldObjectLinkingLayerBase::LinkedObject, std::default_deletellvm::orc::RTDyldObjectLinkingLayerBase::LinkedObject > >, llvm::RuntimeDyld&, std::shared_ptr<llvm::object::OwningBinaryllvm::object::ObjectFile > const&, std::function<void ()()>)#1}>::getSymbolMaterializer(std::basic_string<char, std::char_traits, std::allocator >)::{lambda()#1}>::_M_invoke(std::_Any_data const&) () from /ccc/scratch/cont002/den/uranie/tmp_sources/root-6.14.00_build/lib/libCling.so
#44 0x00002adce5d28f56 in llvm::JITSymbol::getAddress() () from /ccc/scratch/cont002/den/uranie/tmp_sources/root-6.14.00_build/lib/libCling.so
#45 0x00002adce5d2ea99 in std::_Function_handler<llvm::Expected ()(), llvm::orc::LazyEmittingLayer<llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer, llvm::orc::SimpleCompiler> >::EmissionDeferredModule::find(llvm::StringRef, bool, llvm::orc::IRCompileLayer<cling::IncrementalJIT::RemovableObjectLinkingLayer, llvm::orc::SimpleCompiler>&)::{lambda()#1}>::_M_invoke(std::_Any_data const&) () from /ccc/scratch/cont002/den/uranie/tmp_sources/root-6.14.00_build/lib/libCling.so
#46 0x00002adce5d2aa16 in llvm::orc::LambdaResolver<cling::IncrementalJIT::addModule(std::shared_ptrllvm::Module const&)::{lambda(std::basic_string<char, std::char_traits, std::allocator > const&)#1}, cling::IncrementalJIT::addModule(std::shared_ptrllvm::Module const&)::{lambda(std::basic_string<char, std::char_traits, std::allocator > const&)#2}>::findSymbol(std::basic_string<char, std::char_traits, std::allocator > const&) () from /ccc/scratch/cont002/den/uranie/tmp_sources/root-6.14.00_build/lib/libCling.so
#47 0x00002adce63c1d3c in llvm::RuntimeDyldImpl::resolveExternalSymbols() () from /ccc/scratch/cont002/den/uranie/tmp_sources/root-6.14.00_build/lib/libCling.so
#48 0x000000000311f510 in ?? ()
#49 0x00000000025ad2e8 in ?? ()
#50 0x0000000000000000 in ?? ()
Error in : Trying to access a pointer that points to an invalid memory address…
Execution of your code was aborted.
In file included from input_line_11:1:
/ccc/scratch/cont002/den/uranie/tmp_sources/root-6.14.00_build/tutorials/hsimple.C:56:8: warning: invalid memory pointer passed to a callee:
if (gSystem->AccessPathName(".",kWritePermission)) {
^~~~~~~
make[2]: *** [tutorials/hsimple.root] Error 1
make[1]: *** [CMakeFiles/hsimple.dir/all] Error 2
make: *** [all] Error 2


_ROOT Version: 6.14.00
_Platform: RedHat 6.9
_Compiler: gnu 4.9.1


This is the real problem. You are probably building ROOT inside a sandbox environment and ROOT needs to access /dev/random to build the file hsimple.root.

Thanks for the reply

Let’s be honest : I didn’t get it :stuck_out_tongue:
From what we’ve been doing so far, this means there’s been a change of global conception going from root5 to root6 right ?

On this very same platform, as soon as we connect to the machine, if I try a

touch /dev/random
touch: cannot touch `/dev/random’: Permission denied

which doesn’t prevent our root5 installation to work fine…
If you have any suggestion, it would be greatly appreciated cause we’re a bit in a dead end here.

cheers
jb

If all you need is to compile ROOT, just remove generation of hsimple.root in CMakeLists.txt and it will work. However, if you do not have permissions to access /dev/random, ROOT will fail at runtime because it needs read access to it at least. The patch for you to apply is below:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a3a0f59925..80acb34916 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -374,26 +374,6 @@ else()
   install(DIRECTORY ${CMAKE_BINARY_DIR}/etc/dictpch DESTINATION ${CMAKE_INSTALL_SYSCONFDIR})
 endif()
 
-#---hsimple.root---------(use the executable for clearer dependencies and proper return code)---
-add_custom_target(hsimple ALL DEPENDS tutorials/hsimple.root)
-add_dependencies(hsimple onepcm)
-if(WIN32)
-  add_custom_command(OUTPUT tutorials/hsimple.root
-                     COMMAND set PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} &&
-                             set ROOTIGNOREPREFIX=1 &&
-                             $<TARGET_FILE:root.exe> -l -q -b -n -x hsimple.C -e return
-                     WORKING_DIRECTORY tutorials
-                     DEPENDS $<TARGET_FILE:root.exe> Cling Hist Tree Gpad Graf HistPainter move_artifacts)
-else()
-  add_custom_command(OUTPUT tutorials/hsimple.root
-                     COMMAND ${ld_library_path}=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}:$ENV{${ld_library_path}}
-                             ROOTIGNOREPREFIX=1
-                             $<TARGET_FILE:root.exe> -l -q -b -n -x hsimple.C -e return
-                     WORKING_DIRECTORY tutorials
-                     DEPENDS $<TARGET_FILE:root.exe> Cling Hist Tree Gpad Graf HistPainter move_artifacts)
-endif()
-install(FILES ${CMAKE_BINARY_DIR}/tutorials/hsimple.root DESTINATION ${CMAKE_INSTALL_TUTDIR} COMPONENT tests)
-
 #---version--------------------------------------------------------------------------------------
 if(NOT WIN32)
 add_custom_target(version COMMAND ${CMAKE_SOURCE_DIR}/build/unix/makeversion.sh ${CMAKE_BINARY_DIR}

Thanks

Indeed, without the hsimple test the installation can be completed but if we can’t run root, then we have a problem :smiley:

I guess this has changed from the way this was done in root5… Would there be a workaround to prevent from having to touch /dev/random… ?
On our side we’ll ask the platform responsible why we cannot touch this file and if they can grant us access (if this is absolutely compulsory)

thanks again for your quick reply
jb

just a drive-by comment, but… why /dev/random instead of /dev/urandom ?
the former is usually used for crypto stuff. filling a histogram doesn’t require that kind of randomness :slight_smile:

(ah… it seems it’s used within cling, not per se within hsimple – which makes sense otherwise reproducibility would be at risk…)

Hi @jbb - what does echo > /dev/urandom say?

in both cases :

echo > /dev/urandom
-bash: /dev/urandom: Permission denied
echo > /dev/random
-bash: /dev/random: Permission denied

Hmm. On a SLC6.10 machine (==RHEL 6.10) I get

$ echo > /dev/random
$

It just works. Why is your /dev/random read-only? What does ls -l /dev/random show?

It is not even in read-only :

[uranie@curie70 ~]$ ls -l /dev/random
crw-rw-rw-. 1 root root 1, 8 Jun 22 18:39 /dev/random

It is very mis-leading: the command return suggest that this file is not read-only but according to the cluster support team it is.

We’ll try to see with them the reason why and if we can circumvent this.

Thanks anyway for your time, we’ll let you know how things are going.
cheers
jb

Thanks jb,

I’d indeed be interested in hearing back from you. We need to write some bytes to some arbitrary location where we don’t care about the effect of writing. /dev/null doesn’t work, because many OSes simply make that a no-op. But we need the kernel to check the source address of the write() operation (which it doesn’t do for /dev/null, for some kernels.)

Cheers, Axel.

Hi Axel

After some discussion with the platform responsible, they told us that the target we were working on, is about to die… They pointed us to the new target and (how surprinsingly), its /dev/random is writable (I found a ROOT-6 version on it, so I’m pretty sure it is not a coincidence).

So it seems we don’t have to found a way to circumvent this issue.
Thanks anyway for your replies.
jb

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.