Project

General

Profile

Bug #208

[charon] SIGSEGV when compiled with O1, Os

Added by Matija Pecotic over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
02.08.2012
Due date:
Estimated time:
Affected version:
5.0.0
Resolution:

Description

Hello,

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,

Matija Pecotic

log_g_O0.log (902 Bytes) log_g_O0.log compiled with O0 Matija Pecotic, 02.08.2012 11:39
log_g_o1.log (1.5 KB) log_g_o1.log compiled with O1 Matija Pecotic, 02.08.2012 11:39
messages (564 Bytes) messages excerpt from /var/log/messages Matija Pecotic, 02.08.2012 11:39
code_realingment.patch (1.2 KB) code_realingment.patch Matija Pecotic, 02.08.2012 11:39

Associated revisions

Revision 11d6bc3e (diff)
Added by Martin Willi over 7 years ago

Move MODP_CUSTOM va_arg fetching out of loop

It seems problematic at least on PPC with gcc 4.3, fixes #208.

History

#1 Updated by Martin Willi over 7 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.

Also available in: Atom PDF