[Mono-bugs] [Bug 638864] New: Handling an exception can cause the next method call to incorrectly get a null value

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Sep 13 06:16:18 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=638864

https://bugzilla.novell.com/show_bug.cgi?id=638864#c0


           Summary: Handling an exception can cause the next method call
                    to incorrectly get a null value
    Classification: Mono
           Product: Mono: Runtime
           Version: 1.2.0
          Platform: i686
        OS/Version: openSUSE 11.2
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: calberto.cortez at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=389117)
 --> (http://bugzilla.novell.com/attachment.cgi?id=389117)
test case

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.5
(KHTML, like Gecko) Chrome/4.0.249.43 Safari/532.5

It seems that in some very specific scenarios, handling an exception can cause
the next method call to receive a parameter as a null value, even if the user
supplied a non-null value.

I extracted the next small test case from a failing corlib test, and the
attached test case is the *simplest* I could get (commit 2f1c4b3a6c8850cf48e5
in master, as of today). Basically in the third call to DateTime.ParseExact we
are receiving a null value for the 'string [] formats' parameter, even if we
provided a non-null value (thus getting an ArgumentNullException).

Based on my tests, if any of the catch sentences is changed from

catch (FormatException exc)

to

catch (FormatException)

then the code works just fine - which could make us think this is a compiler
issue - but the resulting code in both cases is running just fine in .net.

* Trying to use dummy methods/code didn't work here, so I had to use the direct
calls to DateTime, just as we do in our currently failing corlib test cases.


Reproducible: Always

Actual Results:  
We are getting an ArgumentNullException - even if we are providing a non-value
valid in the method call.

Expected Results:  
The test case should work just fine and the exceptions should be handled
correctly.

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


More information about the mono-bugs mailing list