Macro hangs on Mac but not Linux

Dear RootTalk forum,

I have come across a curious problem with a macro that I have written. After having compiled it using ACLiC and executed it once, recompiling and executing it a second time (without restarting ROOT in the mean time) causes the code to hang.

I attached a distilled test code which has the same problem. To make matters more interesting, when I run the test code on my Linux VM it does not hang.

Any thoughts on what I am doing wrong?

Sincerely,
Bertrand

System configurations:

Mac OS X 10.7.3 (build 11D50) with XQuartz 2.6.3 (xorg-server 1.10.3)
ROOT 5.32/02 (macosx64)

Fedora 16 (3.3.1-3 x86_64)
ROOT 5.28/00d (linuxx8664gcc)
test.cpp (3.58 KB)

I can’t try it myself on Mac, but maybe you could try to …

  1. replace all “candelete[23]->Close();” with “delete candelete[23];”
  2. replace all “h[12]->Delete();” with “delete h[12];”
  3. maybe also replace “#include <stdio.h>” with "#include "

Hi Pepe Le Pew,

Thanks for the prompt reply. I followed your suggestion but it did not make a difference.

Perhaps some additional information might help. I noticed there is a difference if I use my rootlogon.C file or not. If I include it then the code does not always hang on the second execution on the Mac, instead I get the warning

When I do not include the rootlogon.C file then the code predictable hangs on the second execution.

On the Linux side ROOT immediately crashes if I include the logon file - that is a separate issue though since the test.cpp macro thus far does not hang under Linux no matter how often I recompile/re-execute it.

Bertrand

Maybe after each:
c[123]->Divide(2,0);
try to add:
c[123]->Update();
(and maybe try to add this call after every “draw” command).

Maybe it would be good if you attached your “rootlogon.C”.
BTW. What do you mean by “I include the logon file”? The “rootlogon.C” is automatically executed on ROOT startup (just once), if it exists (unless you start ROOT using “root -n”).

Hi Pepe Le Pew,

Sorry for not replying sooner, for some reason I didn’t get a notification email like I had for your initial post.

I made the suggested modifications but the macro still hangs. Any other ideas?

As for the rootlogon.C file, what I had meant was that I just renamed it so that ROOT wouldn’t find it when I initially launched it - forgot about the -n startup option :slight_smile: Attached in the relevant file.
rootlogon.C (1.73 KB)

Hi,

If you still have this problem, I recommend you run using valgrind (valgrind root.exe)

Cheers,
Philippe.