How to use AddressSanitizer in S32 Design studio

Showing results for 
Search instead for 
Did you mean: 

How to use AddressSanitizer in S32 Design studio

Contributor III

As s32 design studio use gcc, I've tried to use the -fsanitize=address compiler flag in the project settings without success: The program just won't compile. 

Is it possible to use AddressSanitizer on S32K codebases? I think this would bring a lot of value to the ecosystem. 


2 Replies

Senior Contributor II

Hi Gabriel,

the reason why you cannot compile is because if you turn on that option, you need a corresponding runtime environment which is not included in the S32DS environment. The compiler option alone only instruments your code, but you still need the runtime code. You find the runtime code documented e.g. in AddressSanitizerAlgorithm · google/sanitizers Wiki · GitHub. Additionally, that feature has originated from the LLVM/Linux/Web Browser world, and I have not seen an adoption for the more constrained embedded world of things. But I agree: it would be very useful. Having said that: I have been experimenting with AddressSanitizer for a while already building up some code base and examples, especially around FreeRTOS. But not for S32DS, my use case is MCUXpresso, but I don't see a reason why this would not be transferable to the DS world. I plan to document it maybe with a tutorial on my blog at MCU on Eclipse | Everything on Eclipse, Microcontrollers and Software  of I find time, but currently a bit under a crunch because of the university exam season.

I hope this helps,


Contributor III

Thanks for your answer Erich.
As a frequent reader of your blog, it will be my pleasure to read about this subject.

Best Regards,


0 Kudos