Bug 971 - "mono --profile log" option causes programs to fail on 64bit systems (testcase provided).
Summary: "mono --profile log" option causes programs to fail on 64bit systems (testcas...
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-09-21 14:22 UTC by Сковорода Никита
Modified: 2011-09-27 15:00 UTC (History)
3 users (show)

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


Attachments
This is the tescase. (2.85 KB, application/x-gzip)
2011-09-21 14:22 UTC, Сковорода Никита
Details
Testcase, version 3 (658 bytes, application/x-gzip)
2011-09-21 17:00 UTC, Сковорода Никита
Details
Testcase, version 4. (567 bytes, application/x-gzip)
2011-09-24 12:34 UTC, Сковорода Никита
Details


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 Сковорода Никита 2011-09-21 14:22:55 UTC
Created attachment 459 [details]
This is the tescase.

This is a very wierd bug (as it looks to me).

Commenting out some lines (in the test solutions) that are doing nothing cause bug to dissapear.

I am not sure where to place this bug report, but most probably this is caused by some jit errors (32bit looks ok, 64bit fails).

The testcase is pretty short and nailed down.

I have collected some test data on several systems and machines (this is why i assume that only 64bit systems are affected).

Steps to reproduce: download attached testcase, unpack, run "make".

All the code is in a single file: Program.cs (33 lines of code).

There are 4 tests, the last one fails on 64bit systems.
Other 3 tests are needed for reference only.

Also, see comments (two lines at the bottom).
Comment 1 Сковорода Никита 2011-09-21 14:26:33 UTC
Linux eeepc 3.0-ARCH #1 SMP PREEMPT Tue Aug 30 08:53:25 CEST 2011 x86_64 AMD C-50 Processor AuthenticAMD GNU/Linux
Mono JIT compiler version 2.10.5 (tarball Fri Sep  9 06:10:12 UTC 2011)
Starting tests...

mono Runner/bin/Debug/Example.exe
Case 0
Passed.
mono Runner/bin/Debug/Example.exe trigger
Case 1
Passed.
mono --profile=log Runner/bin/Debug/Example.exe
Case 0
Passed.
mono --profile=log Runner/bin/Debug/Example.exe trigger
Case 1
Failed!
Comment 2 Сковорода Никита 2011-09-21 14:26:56 UTC
Linux morgenstern 2.6.37.6-smp #1 SMP Sat Apr 9 14:01:14 CDT 2011 i686 AMD Athlon(tm) II P360 Dual-Core Processor AuthenticAMD GNU/Linux
Mono JIT compiler version 2.10.2 (tarball Вск Июн 26 16:31:11 EEST 2011)
Starting tests...

mono Runner/bin/Debug/Example.exe
Case 0
Passed.
mono Runner/bin/Debug/Example.exe trigger
Case 1
Passed.
mono --profile=log Runner/bin/Debug/Example.exe
Case 0
Passed.
mono --profile=log Runner/bin/Debug/Example.exe trigger
Case 1
Passed.
Comment 3 Сковорода Никита 2011-09-21 14:27:14 UTC
Linux laptop 3.0-ARCH #1 SMP PREEMPT Wed Aug 17 20:24:07 UTC 2011 i686 Genuine Intel(R) CPU U7300 @ 1.30GHz GenuineIntel GNU/Linux
Mono JIT compiler version 2.10.5 (tarball Fri Sep  9 06:34:36 UTC 2011)
Starting tests...

mono Runner/bin/Debug/Example.exe
Case 0
Passed.
mono Runner/bin/Debug/Example.exe trigger
Case 1
Passed.
mono --profile=log Runner/bin/Debug/Example.exe
Case 0
Passed.
mono --profile=log Runner/bin/Debug/Example.exe trigger
Case 1
Passed.
Comment 4 Сковорода Никита 2011-09-21 14:27:31 UTC
Linux pevzi-laptop 3.0-ARCH #1 SMP PREEMPT Tue Aug 30 07:32:23 UTC 2011 i686 Intel(R) Atom(TM) CPU N270 @ 1.60GHz GenuineIntel GNU/Linux
Mono JIT compiler version 2.10.5 (tarball Fri Sep  9 06:34:36 UTC 2011)
Starting tests...

mono Runner/bin/Debug/Example.exe
Case 0
Passed.
mono Runner/bin/Debug/Example.exe trigger
Case 1
Passed.
mono --profile=log Runner/bin/Debug/Example.exe
Case 0
Passed.
mono --profile=log Runner/bin/Debug/Example.exe trigger
Case 1
Passed.
Comment 5 Сковорода Никита 2011-09-21 14:27:55 UTC
Linux P1localhost 3.0.4-gentoo #2 SMP PREEMPT Fri Sep 2 07:51:28 MSK 2011 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 5200+ AuthenticAMD GNU/Linux
Mono JIT compiler version 2.10.5 (tarball Tue Sep 13 01:51:42 MSK 2011)
Starting tests...

mono Runner/bin/Debug/Example.exe
Case 0
Passed.
mono Runner/bin/Debug/Example.exe trigger
Case 1
Passed.
mono --profile=log Runner/bin/Debug/Example.exe
Case 0
Passed.
mono --profile=log Runner/bin/Debug/Example.exe trigger
Case 1
Failed!
Comment 6 Сковорода Никита 2011-09-21 14:28:10 UTC
Linux asus_laptop 3.0-ARCH #1 SMP PREEMPT Tue Aug 30 08:53:25 CEST 2011 x86_64 Intel(R) Pentium(R) Dual CPU T3200 @ 2.00GHz GenuineIntel GNU/Linux
Mono JIT compiler version 2.10.5 (tarball Fri Sep  9 06:10:12 UTC 2011)
Starting tests...

mono Runner/bin/Debug/Example.exe
Case 0
Passed.
mono Runner/bin/Debug/Example.exe trigger
Case 1
Passed.
mono --profile=log Runner/bin/Debug/Example.exe
Case 0
Passed.
mono --profile=log Runner/bin/Debug/Example.exe trigger
Case 1
Failed!
Comment 7 Сковорода Никита 2011-09-21 17:00:33 UTC
Created attachment 462 [details]
Testcase, version 3

This is a slimmed down version.

Not marking previous version obsolete because almost all the tests were performed with previous version.
Comment 8 Сковорода Никита 2011-09-21 17:06:17 UTC
Linux eeepc 3.0-ARCH #1 SMP PREEMPT Tue Aug 30 08:53:25 CEST 2011 x86_64 AMD C-50 Processor AuthenticAMD GNU/Linux
Mono JIT compiler version 2.10.5 (tarball Fri Sep  9 06:10:12 UTC 2011)
Starting tests...

mono Program.exe
Passed.
mono --profile=log Program.exe
Failed!
Comment 9 Сковорода Никита 2011-09-21 18:01:42 UTC
If compiled with MSVS 2010 under Windows, the behaviour is the same.

$ mono ConsoleApplication3.exe 
Passed.
$ mono --profile=log ConsoleApplication3.exe 
Failed!
Comment 10 Zoltan Varga 2011-09-22 21:37:19 UTC
I can reproduce this. As a workaround, try running with -O=-intrins.
Comment 11 Сковорода Никита 2011-09-24 07:34:24 UTC
Zoltan Varga, that works as workaround for this testcase, but not for initial example (quite big one, from which this testcase was made).

Shall i provide another testcase for which that workaround does not work?
Comment 12 Zoltan Varga 2011-09-24 11:12:26 UTC
No, I can reproduce it. Its pretty random, so it will be quite hard to track down.
Comment 13 Сковорода Никита 2011-09-24 12:34:05 UTC
Created attachment 486 [details]
Testcase, version 4.

2 lines only.

Breaks with „mono --profile=log“, „mono --profile=log -O=-intrins“, and with „mono --profile=log -O=-all“.
Comment 14 Сковорода Никита 2011-09-24 12:35:42 UTC
Zoltan Varga, this testcase is quite trivial. Hope that helps.
Comment 15 Сковорода Никита 2011-09-24 14:45:13 UTC
Here is a one-liner:

var a = Activator.CreateInstance((dynamic) typeof(int));
Comment 16 Сковорода Никита 2011-09-24 15:00:14 UTC
object a = Activator.CreateInstance((dynamic) typeof(int));

Is simplier. This is the best i could get, i think.
Comment 17 Zoltan Varga 2011-09-27 15:00:03 UTC
Fixed in HEAD/2.10 branch by 6ee6115b3b18332fc84946cf10233ee6f31ab960. Thanks for the testcase.