[Mono-list] Not all subscribers to event are being called...

Ryan Kirkpatrick ryan.kirkpatrick at inovonics.com
Tue Jul 7 13:23:11 EDT 2009

Mark Probst wrote:
> Ryan Kirkpatrick wrote:
>> I tried, but failed (again, short on brain cycles :), to understand how
>> this change was breaking my code. Apparently these delegate trampoline
>> optimizations and the events in my code do not mix well. I do not have a
>> test case I can provide, so if some one can resolve this issue based on
>> the above (and original problem description below), that would be great.
> Are there by any chance generic classes or generic methods involved in
> the code that breaks?

Yes, as a matter of fact there is. Both the class that is has the event 
(and is calling the event) and the class that is subscribing are based 
on generics. I have a base generic class that takes one type parameter:

abstract public class BasicClass<TKey> { ... }

And then both the class that has and calls the event, plus the class 
that subscribes to the event inherit from this class:

public class EventsCallers : BasicClass<string> { ... }
public class Subscribers : BasicClass<object> { ... }

> Have you tried running the app with generic sharing disabled (set the
> environment variable MONO_GENERIC_SHARING=none)?

Tried it with rev 123349 (on Linux) and 2.4.2 (on Windows), both did not 
work with my code.

> Could you please test whether your app works with r122085 (or earlier)?

During my search for what revision broke things I found:

Rev 126000 -> Did NOT work.
Rev 125000 -> Did NOT work.
Rev 124000 -> Did NOT work.
Rev 123000 -> Worked
Rev 122000 -> Mono failed to compile, skipped.
Rev 121000 -> Did NOT work.
Rev 120000 -> Did NOT work.

I took the first revision where it worked and starting moving forward 
until I found 123349 (first by 100 revision steps, then by 10, then by 
1). I did not investigate why it broke again in the earlier revs.


PS. The 'git bisect' command indeed looks cool! Looks like I better find 
time to learn about git. :)

Ryan Kirkpatrick <ryan.kirkpatrick at inovonics.com>, 303-209-7190
Senior Design Engineer
Inovonics Wireless Corporation

More information about the Mono-list mailing list