[Mono-bugs] [Bug 609023] Interlocked.Exchange(ref int, int) raises a "System.ExecutionEngineException: SIGILL" exception on a S390X platform

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed May 26 12:48:06 EDT 2010



--- Comment #1 from Aurelien Minvielle <aurelien.minvielle+mono at gmail.com> 2010-05-26 16:48:06 UTC ---
Sorry, I got it wrong and not tested my patch well enough. The SIGILL is no
longer raised, but the value is not exchanged correctly.

There is no such "64 bits context". The "int foo" variable is correctly stored
as a 32bits variable by the STY instruction (I though it was STG).

So the problem is not in the CS instruction. It is just before, in the LG
instruction : LG loads  in %R0 the foo variable in 0(%R2) as if it were a
64bits variable. This is the mistake.

%R0 is therefore incorrect, and the CS equallity check fails.

The correction is to replace the LG instruction by a L instruction. By doing
so, the offset of the JNE becomes correct. I think that's what the programmer
who wrote this had in mind.

I do not know if the "len" of the OP_ATOMIC_EXCHANGE_I4 opcode should be
changed in mono/mini/cpu-s390x.md:58. It is now 16 instead of 18. But this
seems to be a "maximum_lenght", not the actual length.

I will attach a new patch as "InterlockedEchange.corrected.patch"
This time I properly tested it : the exception is no longer raised, the value
is correctly exchanged, and the return value of Interlocked.Exchanged is also
the one expected.

Hope this helps.

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list