On Windows 7, gInterpreter->GetCurrentMacroName() crashes

Hello,

My goal is to test a simple script on Windows: get_name.cpp (81 Bytes).

After downloading root_v6.14.02.win32.vc15.debug.zip, I followed the instructions given in https://root.cern.ch/content/release-61402 to load ROOT environment.

In a Microsoft Visual Studio Prompt, I entered the following commands:


**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.7.6
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>C:\URANIE\tools\root6.14.02_debug\bin\thisroot.bat

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>cd C:\URANIE\ManualTests\11975

C:\URANIE\ManualTests\11975>root -l get_name.cpp
root [0]
Processing get_name.cpp...
C:\URANIE\ManualTests\11975\get_name.cpp

Then a window told me root.exe stopped. And I was invited to debug it with Visual Studio 2017.

Visual Studio was launched. And the uncaught exception message was:

Exception non gérée à 0x777EE466 (ntdll.dll) dans root.exe : 0xC0000005 : Violation d'accès lors de la lecture de l'emplacement 0x0A70B42C. a eu lieu
which is about an Access violation reading a location.

Here is an excerpt from the machine code:

777EE44C  je          @RtlpLowFragHeapFree@8+64834h (77852C6Eh)
777EE452  mov         eax,dword ptr [edi]
777EE454  mov         esi,edi
777EE456  shr         esi,3
777EE459  xor         esi,eax
777EE45B  xor         esi,dword ptr [_RtlpLFHKey (778C00A4h)]
777EE461  mov         dword ptr [ebp-4],edi
777EE464  xor         esi,ecx
777EE466  mov         eax,dword ptr [esi+4]  <===
777EE469  mov         dword ptr [ebp-0Ch],eax
777EE46C  mov         byte ptr [edi+7],80h
777EE470  mov         byte ptr [edi+6],0
777EE474  mov         ebx,dword ptr [esi+8]
777EE477  mov         ecx,dword ptr [esi+0Ch]
777EE47A  mov         dword ptr [ebp-20h],ebx
777EE47D  add         ebx,1
777EE480  mov         dword ptr [ebp-1Ch],ecx
777EE483  adc         ecx,1
777EE486  and         ebx,7FFFh
777EE48C  cmp         bx,word ptr [esi+14h]

The call stack was also shown:

ntdll.dll!@RtlpLowFragHeapFree@8()	Inconnu <===
ntdll.dll!_RtlFreeHeap@12()	Inconnu
msvcrt.dll!_free()	Inconnu
002f5e61()	Inconnu
[Les frames ci-dessous sont peut-être incorrects et/ou manquants]
[Code externe]
libCling.dll!cling::IncrementalExecutor::executeWrapper(llvm::StringRef function, cling::Value * returnValue) Ligne 196	C++
libCling.dll!cling::Interpreter::RunFunction(const clang::FunctionDecl * FD, cling::Value * res) Ligne 1000	C++
libCling.dll!cling::Interpreter::EvaluateInternal(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & input, cling::CompilationOptions CO, cling::Value * V, cling::Transaction * * T, unsigned int wrapPoint) Ligne 1253	C++
libCling.dll!cling::Interpreter::echo(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & input, cling::Value * V) Ligne 903	C++
libCling.dll!cling::MetaSema::actOnxCommand(llvm::StringRef file, llvm::StringRef args, cling::Value * result) Ligne 146	C++
libCling.dll!cling::MetaParser::isXCommand(cling::MetaSema::ActionResult & actionResult, cling::Value * resultValue) Ligne 288	C++
libCling.dll!cling::MetaParser::isCommand(cling::MetaSema::ActionResult & actionResult, cling::Value * resultValue) Ligne 123	C++
libCling.dll!cling::MetaParser::isMetaCommand(cling::MetaSema::ActionResult & actionResult, cling::Value * resultValue) Ligne 101	C++
libCling.dll!cling::MetaProcessor::process(llvm::StringRef input_line, cling::Interpreter::CompilationResult & compRes, cling::Value * result, bool disableValuePrinting) Ligne 316	C++
libCling.dll!HandleInterpreterException(cling::MetaProcessor * metaProcessor, const char * input_line, cling::Interpreter::CompilationResult & compRes, cling::Value * result) Ligne 2060	C++
libCling.dll!TCling::ProcessLine(const char * line, TInterpreter::EErrorCode * error) Ligne 2202	C++
libCling.dll!TCling::ProcessLineSynch(const char * line, TInterpreter::EErrorCode * error) Ligne 3049	C++
libCore.dll!TApplication::ExecuteFile(const char * file, int * error, bool keep) Ligne 1157	C++
libCore.dll!TApplication::ProcessFile(const char * file, int * error, bool keep) Ligne 1029	C++
libCore.dll!TApplication::ProcessLine(const char * line, bool sync, int * err) Ligne 1002	C++
libRint.dll!TRint::ProcessLineNr(const char * filestem, const char * line, int * error) Ligne 757	C++
libRint.dll!TRint::Run(bool retrn) Ligne 416	C++
root.exe!main(int argc, char * * argv) Ligne 32	C++
[Code externe]

Have you ever encountered this error?

Regards,


ROOT Version: ROOT 6.14/02 (debug)
Platform: Windows 7 Enterprise 64 bits SP1
Compiler: Visual Studio 2017 Community


Some additional information about gInterpreter:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>root
------------------------------------------------------------
| Welcome to ROOT 6.14/02                http://root.cern.ch |
|                               (c) 1995-2018, The ROOT Team |
| Built for win32                                            |
| From tags/v6-14-02@v6-14-02, Jul 27 2018, 10:56:25         |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------

root [0] gInterpreter->GetName()
(const char *) "C++"
root [1] gInterpreter->GetTitle()
(const char *) "cling C++ Interpreter"

Here is what I get with the master:

**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.7.6
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86'

C:\Users\sftnight>cd rootdev

C:\Users\sftnight\rootdev>..\build\debug\bin\thisroot.bat

C:\Users\sftnight\rootdev>root -l get_name.cpp
root [0]
Processing get_name.cpp...
C:\Users\sftnight\rootdev\get_name.cpp
root [1]

I’ll try with 6.14/02 and let you know…

OK. Thank you very much.

OK, so 6.14.02 doesn’t work, but 6.14.04 does. Can you try?

Thank you for your investigation.

Here is the result of the test with ROOT 6.14/04:


** Visual Studio 2017 Developer Command Prompt v15.7.6
** Copyright © 2017 Microsoft Corporation


C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>C:\URANIE\tools\root6.14.04_debug\bin\thisroot.bat

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>cd C:\URANIE\ManualTests\11975


C:\URANIE\ManualTests\11975>root get_name.cpp
------------------------------------------------------------
| Welcome to ROOT 6.14/04                http://root.cern.ch |
|                               (c) 1995-2018, The ROOT Team |
| Built for win32                                            |
| From tags/v6-14-04@v6-14-04, Aug 23 2018, 17:00:44         |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------

root [0]
Processing get_name.cpp...
C:\URANIE\ManualTests\11975\get_name.cpp
C:\URANIE\ManualTests\11975>

As before, a window popped up telling root.exe stopped. Then I asked to quit the program.
However, the printed filename is correct.

OK, so it’s better, even if it works differently on your computer. Which version of Windows do you use?
(And BTW, don’t forget it’s a preview release. More bug fixes will come…)

P.S. you can also start root in the debugger by typing:

devenv /debugexe root.exe -l get_name.cpp

OK. Thank you.
My platform is Windows 7 Enterprise 64 bits SP1.

OK, I’m on Windows 10, so it’s maybe the reason (yes that makes a difference… :tired_face: )

ROOT6 is not supposed to work on Windows 64-bits

The 32 bit version of ROOT 6 works just fine on Windows 64 bit.

Hello,

tl;dr: I compiled ROOT 6.14/04 from sources but the test still fails.

After downloading https://root.cern.ch/download/root_v6.14.04.source.tar.gz, I untar the archive to C:\URANIE\tools\root-6.14.04. Then from a build directory, I launched CMake configuration:

C:\URANIE\tools\root-6.14.04_build>cmake.exe ..\root-6.14.04 -DCMAKE_CONFIGURATION_TYPES="Release"^
-DCMAKE_INSTALL_PREFIX="C:\URANIE\tools\root-6.14.04_install_release"^
[...]

The ROOT solution was opened with Visual Studio 2017 (v15.7.6):

C:\URANIE\tools\root-6.14.04_build_release>start ROOT.sln

The targets ALL_BUILD and INSTALL were successfully built:

[...]
396>------ Début de la génération : Projet : ALL_BUILD, Configuration : Release Win32 ------
========== Génération : 396 a réussi, 0 a échoué, 0 mis à jour, 0 a été ignoré ==========
[...]
212>-- Installing: C:/URANIE/tools/root-6.14.04_install_release/include/TTreeAsFlatMatrix.h
========== Génération : 212 a réussi, 0 a échoué, 185 mis à jour, 0 a été ignoré ==========

But the test failed:

** Visual Studio 2017 Developer Command Prompt v15.7.6
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>C:\URANIE\tools\root-6.14.04_install_release\bin\thisroot.bat

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>cd C:\URANIE\ManualTests\11975

C:\URANIE\ManualTests\11975>root get_name.cpp
------------------------------------------------------------
| Welcome to ROOT 6.14/04                http://root.cern.ch |
|                               (c) 1995-2018, The ROOT Team |
| Built for win32                                            |
| From tags/v6-14-04@v6-14-04, Aug 23 2018, 17:00:44         |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------

root [0]
Processing get_name.cpp...
C:\URANIE\ManualTests\11975\get_name.cpp
C:\URANIE\ManualTests\11975>echo %ERRORLEVEL%
-1073741819
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.7.6
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86'

C:\Users\sftnight>cd temp

C:\Users\sftnight\temp>root_v6.14.04\bin\thisroot.bat

C:\Users\sftnight\temp>root get_name.cpp
   ------------------------------------------------------------
  | Welcome to ROOT 6.14/04                http://root.cern.ch |
  |                               (c) 1995-2018, The ROOT Team |
  | Built for win32                                            |
  | From tags/v6-14-04@v6-14-04, Aug 23 2018, 17:00:44         |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------

root [0]
Processing get_name.cpp...
C:\Users\sftnight\temp\get_name.cpp
root [1]

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