[Mono-bugs] [Bug 459221] New: Wrong NullPointerException when dereferencing parameter for calling base ctor

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Dec 15 15:35:58 EST 2008


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


           Summary: Wrong NullPointerException when dereferencing parameter
                    for calling base ctor
           Product: Mono: Compilers
           Version: SVN
          Platform: x86-64
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: daniel at hofmannmail.ath.cx
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


This seems to be a regression, as it works with Mono 1.9.1 and it doesn't work
with r121527. With that revision I just overwrote my prevision ~1-2 weeks old
svn-installation, that didn't contain the error as well AFAIR.

I'm getting the following Stacktrace:
---------------------------------
System.NullReferenceException: Object reference not set to an instance of an
object
  at EvoLab.Vis.Gui.RunStartWindow..ctor (EvoLab.Vis.EvoVis evovis,
EvoLab.Vis.Model.Run run, EvoLab.Vis.Gui.EvoVisWindow window) [0x00000] in
/home/dani_nobkup/src/evolab/svn/trunk/EvoLab/src/EvoLab.Vis/Main.cs:1 
  at (wrapper remoting-invoke-with-check) EvoLab.Vis.Gui.RunStartWindow:.ctor
(EvoLab.Vis.EvoVis,EvoLab.Vis.Model.Run,EvoLab.Vis.Gui.EvoVisWindow)
[..]
------------------------------------

Notice, that the File Main.cs surely shouldn't appear in the Stacktrace, as it
contains only the Main method and the exception occurs deep inside the Gui.

The corresponding code looks like this:
--------------------------------------
[..]
    public sealed class RunStartWindow : ConfirmationWindow<TableLayoutPanel> {

        private CheckBox doStartCheckBox = new CheckBox ();

        public RunStartWindow (EvoVis evovis, Run run, EvoVisWindow window)
            : base ("Lauf '" + run.Name + "'vorbereiten", 200, 200)
        {
            if (run == null)
                throw new ArgumentNullException ("run");
[..]
---------------------------------------

Notice, that when doing a
-            : base ("Lauf '" + run.Name + "'vorbereiten", 200, 200)
+            : base ("Lauf '" + /*run.Name +*/ "'vorbereiten", 200, 200)

neither the NullPointerexception, nor the suceeding
ArgumentNullPointerException is thrown.
(I'm pretty sure the object that is passed is not null)
(run.Name being null shouldn't be a problem, AFAIK)

Unfortunately I was so far unable to produce a simple reproduction for the
issue, so instead here's the relevant output from monodis showing the
svn-version:
-----------------------------------
[..]
    // method line 368
    .method public hidebysig  specialname  rtspecialname 
           instance default void '.ctor' (class EvoLab.Vis.EvoVis evovis, class
EvoLab.Vis.Model.Run run, class EvoLab.Vis.Gui.EvoVisWindow window)  cil
managed 
    {
        // Method begins at RVA 0x7804
        // Code size 392 (0x188)
        .maxstack 50
        .locals init (
                class
[System.Windows.Forms]System.Windows.Forms.TableLayoutPanel       V_0,
                class [System.Windows.Forms]System.Windows.Forms.Label  V_1,
                class [System.Windows.Forms]System.Windows.Forms.Button V_2,
                class
EvoLab.Vis.Gui.RunStartWindow/'<RunStartWindow>c__AnonStorey14'   V_3)
        IL_0000:  newobj instance void class
EvoLab.Vis.Gui.RunStartWindow/'<RunStartWindow>c__AnonStorey14'::'.ctor'()
        IL_0005:  stloc.3 
        IL_0006:  ldarg.0 
        IL_0007:  newobj instance void class
[System.Windows.Forms]System.Windows.Forms.CheckBox::'.ctor'()
        IL_000c:  stfld class
[System.Windows.Forms]System.Windows.Forms.CheckBox
EvoLab.Vis.Gui.RunStartWindow::doStartCheckBox
        IL_0011:  ldarg.0 
        IL_0012:  ldstr "Lauf '"
        IL_0017:  ldloc.3 
        IL_0018:  ldfld class EvoLab.Vis.Model.Run
EvoLab.Vis.Gui.RunStartWindow/'<RunStartWindow>c__AnonStorey14'::run
        IL_001d:  callvirt instance string class
EvoLab.Vis.Model.Run::get_Name()
        IL_0022:  ldstr "'vorbereiten"
        IL_0027:  call string string::Concat(string, string, string)
        IL_002c:  ldc.i4 200
        IL_0031:  ldc.i4 200
        IL_0036:  call instance void class
EvoLab.Vis.Gui.ConfirmationWindow`1<class
[System.Windows.Forms]System.Windows.Forms.TableLayoutPanel>::'.ctor'(string,
int32, int32)
        IL_003b:  ldloc.3 
        IL_003c:  ldarg.1 
        IL_003d:  stfld class EvoLab.Vis.EvoVis
EvoLab.Vis.Gui.RunStartWindow/'<RunStartWindow>c__AnonStorey14'::evovis
        IL_0042:  ldloc.3 
        IL_0043:  ldarg.2 
[..]
----------------------------------------------
and from gmcs-1.9.1:
---------------------------------------------
[..]
    // method line 362
    .method public hidebysig  specialname  rtspecialname 
           instance default void '.ctor' (class EvoLab.Vis.EvoVis evovis, class
EvoLab.Vis.Model.Run run, class EvoLab.Vis.Gui.EvoVisWindow window)  cil
managed 
    {
        // Method begins at RVA 0x79e8
        // Code size 419 (0x1a3)
        .maxstack 50
        .locals init (
                class EvoLab.Vis.Gui.RunStartWindow/'<>c__CompilerGenerated19' 
V_0,
                class
[System.Windows.Forms]System.Windows.Forms.TableLayoutPanel       V_1,
                class [System.Windows.Forms]System.Windows.Forms.Label  V_2,
                class EvoLab.Vis.Gui.RunStartWindow/'<>c__CompilerGenerated105'
V_3,
                class [System.Windows.Forms]System.Windows.Forms.Button V_4)
        IL_0000:  ldarg.0 
        IL_0001:  newobj instance void class
[System.Windows.Forms]System.Windows.Forms.CheckBox::'.ctor'()
        IL_0006:  stfld class
[System.Windows.Forms]System.Windows.Forms.CheckBox
EvoLab.Vis.Gui.RunStartWindow::doStartCheckBox
        IL_000b:  nop 
        IL_000c:  ldc.i4 24
        IL_0011:  pop 
        IL_0012:  nop 
        IL_0013:  ldarg.0 
        IL_0014:  newobj instance void class
EvoLab.Vis.Gui.RunStartWindow/'<>c__CompilerGenerated19'::'.ctor'(class
EvoLab.Vis.Gui.RunStartWindow)
        IL_0019:  stloc.0 
        IL_001a:  ldloc.0 
        IL_001b:  ldarg.1 
        IL_001c:  stfld class EvoLab.Vis.EvoVis
EvoLab.Vis.Gui.RunStartWindow/'<>c__CompilerGenerated19'::'<20:evovis>'
        IL_0021:  ldloc.0 
        IL_0022:  ldarg.3 
        IL_0023:  stfld class EvoLab.Vis.Gui.EvoVisWindow
EvoLab.Vis.Gui.RunStartWindow/'<>c__CompilerGenerated19'::'<20:window>'
        IL_0028:  ldloc.0 
        IL_0029:  ldarg.2 
        IL_002a:  stfld class EvoLab.Vis.Model.Run
EvoLab.Vis.Gui.RunStartWindow/'<>c__CompilerGenerated19'::'<20:run>'
        IL_002f:  ldarg.0 
        IL_0030:  ldstr "Lauf '"
        IL_0035:  ldloc.0 
        IL_0036:  ldfld class EvoLab.Vis.Model.Run
EvoLab.Vis.Gui.RunStartWindow/'<>c__CompilerGenerated19'::'<20:run>'
        IL_003b:  callvirt instance string class
EvoLab.Vis.Model.Run::get_Name()
        IL_0040:  ldstr "'vorbereiten"
        IL_0045:  call string string::Concat(string, string, string)
[..]
--------------------------------------------------

I don't really know cil, so I've got no idea, whether this might help, but
judging only from the symptom I'd say, there might be some error in the first
IL-sequence.
If this information isn't sufficient, I might try further producing a suitable
testcase, or finding out, which was my previous svn-version with which it still
worked.


-- 
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