LLNL / MACSio

A Multi-purpose, Application-Centric, Scalable I/O Proxy Application
https://computing.llnl.gov/projects/co-design/macsio
Other
34 stars 16 forks source link

segfault with intel compiler #11

Closed jdomke closed 5 years ago

jdomke commented 6 years ago

https://github.com/LLNL/MACSio/blob/e8bece99bfa5eab9355549bb587ee36aec9d6c67/macsio/macsio_clargs.c#L234

The way this code is written triggers an segfault (null pointer dereference later in the loop) with intel compiler due to undefined behavior of the language. gnu does not reinitialize recurring variable declaration, however intel does, so the linked line will reset both pointers to NULL in every iteration!

Best, Jens

markcmiller86 commented 6 years ago

Thanks for pointing this out. Oversight. Those vars should have been declared outside the loop. And, it looks like in my git naievety, I wound up fixing on master.