Bug 36443 - counter warning printed when two threads terminate with exceptions simultaneously
Summary: counter warning printed when two threads terminate with exceptions simultaneo...
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-12-01 20:34 UTC by Andi McClure
Modified: 2015-12-02 18:21 UTC (History)
3 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:

Minimal test. The name is not meaningful (1.01 KB, text/x-csrc)
2015-12-01 20:35 UTC, Andi McClure

Description Andi McClure 2015-12-01 20:34:28 UTC

Comment 1 Andi McClure 2015-12-01 20:35:54 UTC
Created attachment 14063 [details]
Minimal test. The name is not meaningful
Comment 2 Andi McClure 2015-12-01 20:47:41 UTC
While debugging something unrelated, I found that if I cause two threads to terminate with thrown exceptions at about the same time, I see a single message printed twice:

"you are registering twice the same counter address"

This is a g_warning in mono-counters.c.

To reproduce, I have attached a file "SignalTest.cs". I do not see the message every time, but if I run the test repeatedly I see it within a few iterations. I run it repeatedly with

while (mono SignalTest.exe; true); do :; done

If I modify mono-counters.c to print the name of the counter, I find the counter names are:

RGCTX template num allocted
RGCTX template bytes allocted

and, on VERY rare occasions:

RGCTX num lazy fetch trampolines
RGCTX unmanaged lookups

Expected behavior: I think g_warnings should not be triggered by anything that user code could reasonably do, and the included code is reasonable.
Comment 3 Zoltan Varga 2015-12-02 18:21:35 UTC
Fixed in master.

Note You need to log in before you can comment on or make changes to this bug.