[armel] Thumb builds cause defective Mono 2.8 builds (SIGILL on NullReferenceException)

Bug #667225 reported by Jo Shields
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GCC
Invalid
Undecided
Unassigned
gcc-4.4 (Ubuntu)
Invalid
Undecided
Unassigned
gcc-4.5 (Ubuntu)
Invalid
Undecided
Unassigned
mono (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: gcc-4.5

It seems there is a problem with the Linaro patches to GCC.

Unmodified upstream Mono 2.8 builds with gcc-4.4 or gcc-4.5 (for 4.5, see attached for a minor build fix). However, using the Ubuntu (Linaro) compilers results in a Mono runtime which fails during the test suite when catching a NullReferenceException. Poking about with gdb implies it's an issue with SIGILL, specifically with Thumb instructions like LSLS in the wrong place.

Ubuntu gcc-4.4 and gcc-4.5 are defective here, but Debian gcc-4.4 and gcc-4.5 are fine. Significantly, gcc-4.5 in both cases is supposedly the same upstream version (4.5.1), but the Linaro-patched package in Ubuntu fails. This bug makes it impossible to update Mono in Natty.

Revision history for this message
Jo Shields (directhex) wrote :
Revision history for this message
Jo Shields (directhex) wrote :

Attached is a simple test case for this problem. Compile it on any system with "gmcs nre.cs", and run with "mono nre.exe" - it should produce an error message like this:

Caught nre: System.NullReferenceException: Object reference not set to an instance of an object
  at Tests.Main (System.String[] args) [0x00000] in <filename unknown>:0

To run the minimal test case, use:
oem@efikamx:~/mono.git/mono/mini$ MONO_PATH=../../mcs/class/lib/net_2_0 ./mono nre.exe

To run the full test case for ALL possible problems, use:

oem@efikamx:~/mono.git/mono$ make check

Revision history for this message
Jo Shields (directhex) wrote :

I should probably add that gcc-4.3, which has no Linaro patches, works fine in either Debian or Ubuntu

Revision history for this message
Matthias Klose (doko) wrote : Re: [Bug 667225] Re: [armel] Ubuntu GCC patches cause defective Mono 2.8 builds (SIGILL on NullReferenceException)

On 27.10.2010 13:21, directhex wrote:
> I should probably add that gcc-4.3, which has no Linaro patches, works
> fine in either Debian or Ubuntu

do you say that mono has to be fixed in maverick too?

Revision history for this message
Jo Shields (directhex) wrote : Re: [armel] Ubuntu GCC patches cause defective Mono 2.8 builds (SIGILL on NullReferenceException)

The GCCs in Maverick are problematic, but the problem does not manifest itself on the Mono version in that release. There are significant changes to the ARM support of the Mono runtime between Maverick's 2.6.7, and the current 2.8 release. 2.6.7 doesn't actually build on Maverick's target ARM variant without patches which we already use (but which are no longer applicable for 2.8)

Revision history for this message
Julian Brown (julian-codesourcery) wrote :

I'm attempting to reproduce this.

Revision history for this message
Jo Shields (directhex) wrote :

I've been able to reproduce this on Debian, which has no Linaro patches. Which heavily implies the issue is with Mono's Thumb code.

Changed in gcc-linaro:
status: New → Invalid
summary: - [armel] Ubuntu GCC patches cause defective Mono 2.8 builds (SIGILL on
+ [armel] Thumb builds cause defective Mono 2.8 builds (SIGILL on
NullReferenceException)
Matthias Klose (doko)
tags: added: armel armv7
Revision history for this message
Julian Brown (julian-codesourcery) wrote :

Thanks for the update -- I hadn't got very far with reproducing this anyway!

Steve Langasek (vorlon)
tags: added: arm-porting-queue
Revision history for this message
Jani Monoses (jani) wrote :

@directhex, I can reproduce the error with the test case you provided with stock 2.6.7 mono on natty.

Revision history for this message
Jani Monoses (jani) wrote :

@directhex, I may have misunderstood what the error is.

I get this on x86 as well.

Caught nre: System.NullReferenceException: Object reference not set to an instance of an object
  at Tests.Main (System.String[] args) [0x00000] in <filename unknown>:0

Is mono 2.8 that you tested with not printing this out?

Jo Shields (directhex)
Changed in gcc-4.5 (Ubuntu):
status: New → Invalid
Changed in gcc-4.4 (Ubuntu):
status: New → Invalid
Changed in mono (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.