[charon] SIGSEGV when compiled with O1, Os
recently we had SIGSEGV on charon startup when strongswan was compiled with Os or O1, while compiling with O0 produced no fault. Problem was tracked down to crypto_factory.c which got 'optimised' by compiler. Attached you can find logs of gdb session when compiled with O0 and O1 and excerpt from messages. (These could be a bit more descriptive, but I can repeat issue and obtain further info).
Architecture is ppc, core is e500, gcc is 4.3.3
We use gcc 4.3.3 on our other target as well, multicore mips64, and there this issue is not occuring.
For the mentioned target, ppc, we also use gcc 3.4.3, with it there is also no occurance.
Problem was originally noted with 4.5.0, reroduced with up to 5.0.0
We solved it in our enviroment by realigning the code, patch is also attached for reference.
Do you have any comments?
Thanks and best regards,
#1 Updated by Martin Willi about 10 years ago
- Status changed from New to Closed
- Assignee set to Martin Willi
- Target version set to 5.0.1
I don't have PPC here to reproduce the issue, but doing va_arg operations outside the loop shouldn't harm. I've pushed the referenced patch.
Thanks for reporting this issue.