[strongSwan] SIGILL in 4.3.5 and above

Tobias Brunner tobias at strongswan.org
Wed Jul 21 18:51:38 CEST 2010


> Looks suspicious:
> 
>> +    return rekey - jitter * (random() / (RAND_MAX + 1.0));
> 
> @Tobias: What's the idea behind RAND_MAX + 1.0? Might this end in a 
> division by zero?

random() / (RAND_MAX + 1.0) returns a random floating point number in
the range [0, 1). The value of RAND_MAX depends on the C library and in
glibc it's 0x7fffffff.  Which shouldn't overflow a double-precision
floating point number (in what RAND_MAX + 1.0 implicitly should result).

As Martin recommended, using a debugger is probably be the fastest way
to find the cause for this SIGILL.  If you can't use a debugger, it
would help to know in what situations the SIGILL actually occurs (i.e.
config, log).

Regards,
Tobias




More information about the Users mailing list