>>>>>   I see a very strange bug in crypto/sparcv9cap.c. OpenSSL 1.0.0d checks
>>>>> sparc capabilities with SIGILL signal. On sparc64 (both Linux and
>>>>> solaris, with UltraSPARC III+ and T1 CPU's), SIGILL handler is called
>>>>> and program terminates with SIGILL in _sparcv9_fmadd_probe:
>>>>>
>>>>> 00000001002a32d0<_sparcv9_fmadd_probe>:
>>>>> 1002a32d0: 81 b0 0d 80 impdep1 108, %f0, %f0, %f0
>>>>> 1002a32d4: 85 b0 8d 82 impdep1 108, %f2, %f2, %f2
>>>>> 1002a32d8: 81 c3 e0 08 retl
>>>>> 1002a32dc: 81 b8 04 40 impdep2 34, %f0, %f0, %f0<= here
> 
>       Question : if sparc processor cannot execute impdep2 instruction, 
> SIGILL is caught and program has to jump to signal handler.

... and the question is? I mean it sounds more like a statement rather
than question... And it can be strengthened. If *a* processor cannot
execute unimplemented instruction, modern OSes make it possible to
arrange that execution flow is transferred to user-supplied code.

BTW. As for question posed earlier. Why do I test for sparcv9
instructions in 32-bit mode? v9 instructions are perfectly usable even
in 32-bit mode. And they *are* extensively used in assembler, even in
32-bit application context. Even compilers were observed to use them,
also in 32-bit code. If your goal is to produce 32-bit binary that can
be executed on wider range of SPARC-based systems, then you should be
configuring for linux-sparcv8 (where the code in question is not even
compiled). For reference. Why do I test for fmadd? Well, this is
actually reserved for future, no code is using it now, so that this
particular check can be omitted [for now].

>>>>>   If I add printf() in signal handler, I see that it is called, and that
>>>>> siglongjmp() works. With my printf(), my program doesn't abort with
>>>>> SIGILL anymore but with SIGBUS (?!).
>>>> Could you 'truss -v sigaction,sigprocmask apps/openssl version' and
>>>> submit output?
>>>     I cannot. My server doesn't run Solaris but Linux/sparc. I just have
>>> seen the same bug a long time ago on Solaris but I don't have any
>>> solaris server anymore.
>> Then run 'strace -v apps/openssl version'.
> 
>       Output is attached.

But according to the output, the apps/openssl didn't crash, but caught
*and* handled SIGILL. So it works at least in apps/openssl context. Do
same against your application that crashes. Also do tell if there is
anything special about your application, in particular what other
libraries is it linked with.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to