Double *pi causes <invalid memory address>

This seems to be the case in ROOT 6.06.02 and the latest 6.06 branch on git, and “master” from git on OS X. It does not seem to affect Linux or ROOT 5.x

When creating a pointer called “pi” and assigning it with new, the pointed is incorrectly assigned.

   ------------------------------------------------------------------------
  | Welcome to ROOT 6.06/05                            http://root.cern.ch |
  |                                           (c) 1995-2016, The ROOT Team |
  | Built for macosx64                                                     |
  | From heads/v6-06-00-patches@v6-06-04-7-g2878e3f, May 16 2016, 18:24:00 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'             |
   ------------------------------------------------------------------------

root [0] double *pi=new double()
(double *) 0x7fafd281e080
root [1] pi
(double *) 0x400921fb54442d18 <invalid memory address>

Any other name for the variable works fine.
Seems like a curious bug. I wonder if anyone else sees this.

Hi,

That’s another occurrence of ROOT-8036. I will tackle that once the llvm upgrade is done - should still happen in June.

The reason is that there is another “thing” (symbol) called “pi” in your binary, and cling gets confused which one we’re talking about.

Cheers, Axel.

Hello Axel,

I see the issue, and good to know you are aware of it. I had thought it would only be TMath::Pi that would be pre-defined. Note that “pi” is not defined my code, but somewhere in ROOT.

Here is another symptom of cling getting confused:

improv:lib> root
   ------------------------------------------------------------------------
  | Welcome to ROOT 6.07/07                            http://root.cern.ch |
  |                                           (c) 1995-2016, The ROOT Team |
  | Built for macosx64                                                     |
  | From heads/master@v6-07-07-aliceml-143-ge1341b3, Jun 06 2016, 19:25:30 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'             |
   ------------------------------------------------------------------------

root [0] double pi
(double) 0.00000
root [1] pi
(double) 3.14159
root [2] pi=4

 *** Break *** bus error
[<unknown binary>]
...

Thank you for your reply and your attention to this issue.

Best,
Maurik