Bug 223296

Summary: zen-installer throws exception when filtering types
Product: [openSUSE] openSUSE 10.2 Reporter: JP Rosevear <jpr>
Component: ZenworksAssignee: Jinu Mathew Joy <jjoy>
Status: RESOLVED FIXED QA Contact: Jawaad Tariq <jtariq>
Severity: Blocker    
Priority: P5 - None CC: aj, federico, guruprasad.s, mc, sbrabec
Version: RC 1   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description JP Rosevear 2006-11-22 17:45:04 UTC
Using the packages available via bug 217326 If I click "patterns" or "packages" for types in the UI, I get an exception:

Unhandled Exception: System.NullReferenceException: A null value was found where an object instance was required.
  at Novell.Zenworks.Gui.ZenWindow+<>c__CompilerGenerated9.<>c__AnonymousMethod28 (System.Object sender, Gtk.ButtonPressEventArgs e) [0x00000] 
  at (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_ButtonPressEventArgs (object,Gtk.ButtonPressEventArgs)
  at Gtk.Widget.ButtonPressEventSignalCallback (IntPtr arg0, IntPtr arg1, IntPtr gch) [0x00000] 
  at (wrapper native-to-managed) Gtk.Widget:ButtonPressEventSignalCallback (intptr,intptr,intptr)
  at <0x00000> <unknown method>
  at (wrapper managed-to-native) Gtk.Application:gtk_main ()
  at Gtk.Application.Run () [0x00000] 
  at Novell.Zenworks.Gui.ZenInstaller.Main (System.String[] args) [0x00000] 

Even though I'm using those packages, I suspect its unrelated to that bug.

AJ, I've made this a blocker until you assess
Comment 1 Andreas Jaeger 2006-11-22 17:56:11 UTC
Can you reproduce this?  That's really bad...
Comment 2 JP Rosevear 2006-11-22 18:51:32 UTC
Yes, every time.
Comment 3 JP Rosevear 2006-11-22 18:56:19 UTC
Looks like I'm not quite RC1 (beta2 plus factory), so I justtried with  zen-updater-7.1.100-29, last changelog entry is:

jpr@square:~> rpm -q --changelog zen-updater | more
* Tue Nov 07 2006 - ro@suse.de
- fix manpage permissions

Still fails there, but it should be tested on a full RC1 install still (I'm still downloading).

Comment 5 Stanislav Visnovsky 2006-11-23 09:52:54 UTC
I can confirm the bug using openSUSE 10.2 RC1.
Comment 6 Jinu Mathew Joy 2006-11-23 11:56:16 UTC
This looks like a gtk library issue.

We could not find this issue when the binary (ZenInstaller.exe) was built on 
a suse 9.3 setup. However when we try to build zen-updater on OpenSuSE 10.2
(I have Beta 2) we are able to see this issue.. 

We are trying to see what exactly is causing this problem.. 

Any clues???
Comment 10 JP Rosevear 2006-11-23 16:28:58 UTC
Fix submitted, see the patch included.  Try:
http://w3.suse.de/~jpr/zen-updater-7.1.100-31.i586.rpm


Issue seems to be in this code:
EventBox eb = new EventBox ();
eb.Add (l);

eb.ButtonPressEvent += delegate (object sender, ButtonPressEventArgs e) {
                    Label tl = eb.Child as Label;
                    filterType = (FilterType) Enum.Parse (typeof (FilterType), tl.Text);
                    this.GdkWindow.Cursor = normalCursor;
                    searchEntry.Text = String.Empty; 
                    filteredModel.Refilter ();
                    DisplayFilterLabels ();
};

The variable eb was null inside the delegate, I don't know if this is a compiler error not propogating eb into the delegate or a compiler error not erroring out because eb is out of scope.
Comment 11 JP Rosevear 2006-11-23 19:24:13 UTC
Miguel says compiler bug, adding him as a CC.
Comment 12 Andreas Jaeger 2006-11-24 08:15:54 UTC
What do you need from me?
Comment 15 Stanislav Visnovsky 2006-11-24 12:30:11 UTC
*** Bug 223579 has been marked as a duplicate of this bug. ***
Comment 16 Martin Baulig 2006-11-24 13:50:34 UTC
Just had a look at this and I can't reproduce this in the compiler.  This is the test case I used:

====
using System;

public class EventBox
{
        public event EventHandler ButtonPressEvent;

        public void ButtonPressed (EventArgs args)
        {
                if (ButtonPressEvent != null)
                        ButtonPressEvent (this, args);
        }

        public void Test ()
        { }
}

class X
{
        static void Main ()
        {
                EventBox eb = new EventBox ();
                eb.Test ();

                eb.ButtonPressEvent += delegate (object sender, EventArgs e) {
                        Console.WriteLine (eb != null);
                };

                eb.ButtonPressed (null);
        }
}
====

That works with all three versions of mcs/gmcs I have (1.2, latest SVN and my development tree).
Comment 17 JP Rosevear 2006-11-24 14:49:11 UTC
Martin, we're shipping 1.1.18 on 10.2 still.

I'm not sure 1.2 is viable because extended attribute support is broken (which is bad for beagle).
Comment 18 Miguel de Icaza 2006-11-24 22:38:11 UTC
Mono 1.2.1 fixed that issue.
Comment 19 Andreas Jaeger 2006-11-25 06:19:01 UTC
Miguel, do you have a fix for 1.1.8?
Comment 20 Miguel de Icaza 2006-11-25 15:39:08 UTC
Hello,

We could backport the compiler, but we are aware that it contains a number of regressions on anonymous methods.  Martin is working full time (weekends included) to get these issues fixed.

Miguel.
Comment 21 Andreas Jaeger 2006-11-26 11:06:27 UTC
So, there's no easy fix for this in the compiler?

We're using 1.1.8 and what can we do to fix zen-updater?
Comment 22 Miguel de Icaza 2006-11-26 16:16:17 UTC
Hello Andreas,

Let me provide all the information that I have:
* JP said they already provided a patch/workaround.
* Neither Martin or myself were able to reproduce the problem with a small program on either 1.1.18 or 1.2, so we suspect the sample is not complete.
* We know that 1.1.18 shipped with a large refactoring of the code for anonymous methods that closed about 20 anonymous method bugs.
* The refactoring contained a number of corner case bugs, so we started work immediately when we discovered those (the test suite was not complete enough to have caught those).
* We are currently working on the refactoring and have it almost ready.
* We were hoping we would have this ready before December 4th, which was one of the deadlines we were given (I forget for what it was though, SLED SP1 or OpenSUSE 10.2 or 10.3).

All we could think of was to ship an upgraded compiler due to the issues that we are aware of.
Comment 23 Andreas Jaeger 2006-11-26 16:22:13 UTC
Ah, it seems that I was confused by comment #11.  Thanks for the explanation.

I thought there was an additional compiler bug.  So, the workaround from #10 should fix the problem.
JP, correct?  In that case let's close this bug...

Miguel, don't know who gave you Dec 4th - that one would be too late for 10.2.
Comment 25 Andreas Jaeger 2006-11-28 11:33:04 UTC
JP, is this one fixed now?
Comment 26 Stanislav Visnovsky 2006-11-29 08:35:29 UTC
I was unable to reproduce with the patch applied.

Please, reopen if needed.
Comment 27 JP Rosevear 2006-11-29 14:16:50 UTC
We worked around the problem, but the compiler stills need to be checked.