#132 Segfault on first loading COD file when compiled with clang

closed-fixed
None
5
2011-10-22
2011-10-21
No

With small changes, I managed to get gpsim to compile with clang++ but I get an immediate segfault when opening a COD file in the gui. I tracked down what's going on and the attached patch with description fixes the problem. Strangely, this doesn't happen when I compile the project with g++.

Discussion

  • Robert Pearce

    Robert Pearce - 2011-10-22

    Interesting. The static member variable is initialized by the constructor of the ProcessorConstructor class, of which there are a LOT of static instances. Of course, C++ classes don't guarantee to construct static instances before calling main(), but it's surprising that clang++ manages to postpone it long enough to give a problem.

    Anyway, we shouldn't rely on order of initialization, so your patch is accepted and will be applied shortly.

     
  • Robert Pearce

    Robert Pearce - 2011-10-22
    • assigned_to: nobody --> bdt-rob
    • status: open --> closed-fixed
     
  • Robert Pearce

    Robert Pearce - 2011-10-22

    Patch applied at SVN r2181. Thanks.

     

Anonymous
Anonymous

Cancel  Add attachments