# ACLiC fatal error on union

**URL:** <https://root-forum.cern.ch/t/aclic-fatal-error-on-union/6569>\
**Category:** ROOT\
**Created:** [May 20, 2008, 5:48am UTC](https://root-forum.cern.ch/t/aclic-fatal-error-on-union/6569 "2008-05-20T05:48:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yukio.Okuda](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/7993a0/32.png) [@Yukio.Okuda](https://root-forum.cern.ch/u/Yukio.Okuda)\
**Post date:** [May 20, 2008, 5:48am UTC](https://root-forum.cern.ch/t/aclic-fatal-error-on-union/6569/1 "2008-05-20T05:48:09Z")

</div>

Hi Rooters,

Why ACLiC cause fatal error and core-dump on union?

A simple code (ACLiC.cxx) generates the following message and return to Linux:  
Fatal: sizeof(::\_ColRec) == sizeof(::ROOT::Shadow::\_ColRec) violated at  
line 73 of `fileRndAvp.cxx’  
aborting

I could not suppose the reasons to generate an object related to C-structure  
in such way in fileRndAvp.cxx:

`namespace ROOT { // LINE # 32
   namespace Shadow {
      #if !(defined(R__ACCESS_IN_SYMBOL) || defined(R__USE_SHADOW_CLASS))
      typedef ::_ColRec _ColRec;
      #else
      class _ColRec {
         public:
         //friend XX;
         #if !(defined(R__ACCESS_IN_SYMBOL) || defined(R__USE_SHADOW_CLASS))
         typedef ::_ColRec::U1 U1;
         #else
         class U1 {
            public:
            //friend XX;
            int* intVec; //
            float* floatVec; //
         };
         #endif
`  
— Cut ----

```
  // Make sure the shadow class has the right sizeof
  R__ASSERT(sizeof(::_ColRec) == sizeof(::ROOT::Shadow::_ColRec)); // LINE #73

```

Let me know workarounds to continue my project.  
Thanks, Yuki

```auto
ACLiC.cxx
#include <stdio.h>
  typedef struct _ColRec {
    char * name ; 
    union U1 {
      int * intVec ;
      float * floatVec ;
    } data ;
  } ColRec ;
  typedef ColRec * Col ;

int ACLiC( Col col ) {
  printf("%s\n", col->name ) ;
  return 1 ;
}

```

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [May 22, 2008, 9:21am UTC](https://root-forum.cern.ch/t/aclic-fatal-error-on-union/6569/2 "2008-05-22T09:21:51Z")

</div>

Hi Yuki!

Thanks for reporting, this was a bug! It’s now fixed in the subversion trunk. You will have to update to the current ROOT sources, see [root.cern.ch/twiki/bin/view/ROOT … \_ROOT\_Subv](http://root.cern.ch/twiki/bin/view/ROOT/SubversionHowto#How_do_I_check_out_the_ROOT_Subv)

Cheers, Axel.

---

<div class="post-metadata">

**Author:** ![Yukio.Okuda](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/7993a0/32.png) [@Yukio.Okuda](https://root-forum.cern.ch/u/Yukio.Okuda)\
**Post date:** [May 22, 2008, 9:44am UTC](https://root-forum.cern.ch/t/aclic-fatal-error-on-union/6569/3 "2008-05-22T09:44:34Z")

</div>

Axel-san,

Thank you for your quick fixing, which makes me a ROOT fan.  
😃

Sincerely, Yuki
