Bug 24605 - counters not enabled
Summary: counters not enabled
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Ludovic Henry
: 26522 ()
Depends on:
Reported: 2014-11-18 07:39 UTC by Marek Safar
Modified: 2015-02-10 08:39 UTC (History)
8 users (show)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Marek Safar 2014-11-18 07:39:39 UTC
Run peverify or monodis on any .exe and mono prints

counters not enabled
counters not enabled
counters not enabled
counters not enabled
counters not enabled
counters not enabled
counters not enabled
Comment 1 Rodrigo Kumpera 2014-11-18 11:11:36 UTC
Assigning to Ludovic as he owns the warning.
Comment 3 Robert Jordan 2014-11-28 06:42:25 UTC
I'm unsure if this is the right fix for this issue.

Patch https://github.com/mono/mono/commit/734b0e9d324881c8689ffba73583036629669189 is introducing mono_counters_init () which seems to be mandatory unless you can live with the cluttered console.

This means that every piece of code which embeds Mono would have to be changed to invoke mono_counters_init (). It's a kind of an API breakage.
Comment 4 Rodrigo Kumpera 2014-12-01 10:33:59 UTC
Hi Robert,

That's not the case. This fix will remove the warning for all embedders.

The problem with pedump is dunce to it not following standard initialization (which should be fixed).
Comment 5 Robert Jordan 2014-12-01 16:32:23 UTC

You can reproduce this with


It seems that mono_counters_init () isn't invoked by mono_jit_exec () or mono_jit_init (). It looks like it's only initialized in mono_main () which isn't usually called by embeders.
Comment 6 Rodrigo Kumpera 2014-12-03 11:46:40 UTC
Ludo, we can't break embedders, we'll need to move mono_counters_init somewhere else.
Comment 7 Ludovic Henry 2014-12-03 11:57:56 UTC
Ok, to move it anywhere. We can also call it multiple times, so where is the best place to put it ?
Comment 8 Robert Jordan 2014-12-04 23:10:34 UTC
mini.c:mini_init ()?
Comment 9 Zoltan Varga 2015-01-08 05:14:50 UTC
Fixed by 4f3b70d5110a454e918555f2bc5dbd3224493853.
Comment 10 pr0vieh 2015-02-06 17:49:48 UTC

i see this "counters not enabled" @currentmaster
when i used mkbundle with:
--static --deps --machine-config /usr/local/etc/mono/4.5/machine.config --config /usr/local/etc/mono/config
without this config stuff this is not present

greets Pr0vieH
Comment 11 João Matos 2015-02-09 11:34:40 UTC
I can confirm that certain mkbundle'd programs (mtouch being one of them) still show this problem.

Joaos-iMac:maccore joao$ tools/mtouch/mtouch-32
counters not enabled
counters not enabled
counters not enabled
counters not enabled
Comment 12 João Matos 2015-02-09 11:35:09 UTC
Related to bug https://bugzilla.xamarin.com/show_bug.cgi?id=26522
Comment 13 João Matos 2015-02-09 12:42:13 UTC
Should be fixed in https://github.com/mono/mono/commit/48b7a501b079081c86c1200632d1999f1c0aa3a8.
Comment 14 Rolf Bjarne Kvinge [MSFT] 2015-02-10 08:39:33 UTC
*** Bug 26522 has been marked as a duplicate of this bug. ***