Bug 58990 - Profiler broken for mcs/class/System automated tests
Summary: Profiler broken for mcs/class/System automated tests
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Profiler ()
Version: master
Hardware: PC Linux
: Normal normal
Target Milestone: Future Cycle (TBD)
Assignee: Alex Rønne Petersen
URL:
Depends on:
Blocks:
 
Reported: 2017-08-23 23:19 UTC by Katelyn Gadd
Modified: 2017-08-24 17:29 UTC (History)
4 users (show)

Tags:
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:
Status:
RESOLVED FIXED

Description Katelyn Gadd 2017-08-23 23:19:58 UTC
If I run mcs/class/System's automated tests with the logging profiler turned on, the profiler doesn't work right and the test suite hangs at the end. 

Example invocation (this is what the regular run-tests does on my config, with the profile arg added):

~/Projects/mono/mcs/class/System$
PATH="/home/kate/Projects/mono/runtime/_tmpinst/bin:/home/kate/.mono/bin:/home/kate/bin:/home/kate/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" MONO_REGISTRY_PATH="/home/kate/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" MONO_PATH="./:./../../class/lib/net_4_x-linux::$MONO_PATH" /home/kate/Projects/mono/runtime/mono-wrapper --profile=log:report,calls --debug   ./../../class/lib/net_4_x-linux/nunit-lite-console.exe  net_4_x_System_test.dll    -exclude=NotWorking,CAS  -format:nunit2 -result:TestResult-net_4_x.xml  || ok=false; if [ ! -f "TestResult-net_4_x.xml" ]; then echo "<?xml version='1.0' encoding='utf-8'?><test-results failures='1' total='1' not-run='0' name='bcl-tests' date='$(date +%F)' time='$(date +%T)'><test-suite name='net_4_x_System_test.dll' success='False' time='0'><results><test-case name='crash' executed='True' success='False' time='0'><failure><message>The test runner didn't produce a test result XML, probably due to a crash of the runtime. Check the log for more details.</message><stack-trace></stack-trace></failure></test-case></results></test-suite></test-results>" > TestResult-net_4_x.xml; fi; 

You get lots of errors about unmatched leaves:

NUnitLite 1.0.0 (.NET 4.5 Debug)
Copyright 2013, Charlie Poole

Runtime Environment -
    OS Version: Unix 4.8.0.58
  Mono Version: 4.0.30319.42000

..............unmatched leave at stack pos: 22 for method System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
unmatched leave at stack pos: 22 for method System.Reflection.MethodBase:Invoke (object,object[])
............................unmatched leave at stack pos: 22 for method System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
unmatched leave at stack pos: 22 for method System.Reflection.MethodBase:Invoke (object,object[])
....................unmatched leave at stack pos: 22 for method System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
unmatched leave at stack pos: 22 for method System.Reflection.MethodBase:Invoke (object,object[])
..unmatched leave at stack pos: 22 for method System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
unmatched leave at stack pos: 22 for method System.Reflection.MethodBase:Invoke (object,object[])
unmatched leave at stack pos: 22 for method System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
unmatched leave at stack pos: 22 for method System.Reflection.MethodBase:Invoke (object,object[])

If set up to just write to a file (--profile=log:calls), the test usually completes and there are no 'unmatched leave' errors, but using the report generator produces the same unmatched leave errors and it hangs, or sometimes it succeeds but produces an empty report as if it didn't get any data out of the profile recording.
Comment 1 Alex Rønne Petersen 2017-08-24 15:23:42 UTC
https://github.com/mono/mono/pull/5439