Bug 30394 - Many F# 64-bit tests failing when LLVM enabled
Summary: Many F# 64-bit tests failing when LLVM enabled
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: 4.0.0
Hardware: PC Linux
: Normal blocker
Target Milestone: ---
Assignee: Zoltan Varga
Depends on:
Reported: 2015-05-24 23:14 UTC by donsyme
Modified: 2015-06-01 07:52 UTC (History)
4 users (show)

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

testcase exe file (15.50 KB, application/x-ms-dos-executable)
2015-05-27 23:22 UTC, igouy2
FSharp.Core.dll (1.32 MB, application/x-msdos-program)
2015-05-27 23:34 UTC, igouy2

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 donsyme 2015-05-24 23:14:27 UTC
Isaac Gouy recently rebuilt the benchmarks game for Mono 4.1.0 and recompiled the F# benchmarks,  Many of them now fail on LLVM 64-bit.

"I just rebuilt Mono for 4.1.0 and recompiled F#. On x86 all seems fine, but on x64 there are many F# program failures, any idea what might be going wrong? http://benchmarksgame.alioth.debian.org/u64/measurements.php?lang=fsharp best wishes, Isaac"

One of the failures is shown below, they all seem to have the same root cause. I've asked Isaac to try removing the LLVM option, so by the time you follow the link above the full set of problems may have gone, so I've captured one in a gist.

1. Recompile this source: https://gist.github.com/dsyme/699443054cfb1d479df1 using

/usr/local/bin/fsharpc --target:exe --platform:x64 -O  -o fannkuchredux.fsharp_run.exe fannkuchredux.fs
/usr/local/bin/mono --llvm fannkuchredux.fsharp_run.exe 10

EXPECTED: program runs successfully

ACTUAL: program fails at runtime, see below.


mono: /usr/local/src/llvm/include/llvm/IR/Instructions.h:999: void llvm::ICmpInst::AssertOK(): Assertion `getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to ICmp instruction are not of the same type!"' failed.



  at <unknown> <0xffffffff>

  at Microsoft.FSharp.Core.PrintfModule.PrintFormatToTextWriter<T_REF> (System.IO.TextWriter,Microsoft.FSharp.Core.PrintfFormat`4<T_REF, System.IO.TextWriter, Microsoft.FSharp.Core.Unit, Microsoft.FSharp.Core.Unit>) <0x00047>

  at <StartupCode$fannkuchredux-fsharp_run>.$Fannkuchredux.main@ () <0x000f7>

  at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>


Native stacktrace:


	/usr/local/bin/mono() [0x61d0e0]

	/lib/x86_64-linux-gnu/libpthread.so.0(+0x10d10) [0x7f14adf72d10]

	/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7f14ad9b7267]

	/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7f14ad9b8eca]

	/lib/x86_64-linux-gnu/libc.so.6(+0x2e03d) [0x7f14ad9b003d]

	/lib/x86_64-linux-gnu/libc.so.6(+0x2e0f2) [0x7f14ad9b00f2]

	/usr/local/bin/mono() [0x7da6c6]

	/usr/local/bin/mono(LLVMBuildICmp+0x47) [0x112b6c7]

	/usr/local/bin/mono() [0x658617]

	/usr/local/bin/mono() [0x6922b9]

	/usr/local/bin/mono() [0x6930b7]

	/usr/local/bin/mono() [0x59ee7c]

	/usr/local/bin/mono() [0x59f4bb]

	/usr/local/bin/mono() [0x61e370]



Debug info from gdb:




Got a SIGABRT while executing native code. This usually indicates

a fatal error in the mono runtime or one of the native libraries 

used by your application.

Comment 1 Zoltan Varga 2015-05-25 11:49:29 UTC
Can't reproduce this with mono master.
Comment 2 donsyme 2015-05-27 03:02:26 UTC
Isaac Gouy says:

Unfortunately x64 quad-core also shows those failing programs:


>> Can't reproduce this with mono master. <<

Is that a different mono master than "master/435cc01 Wed May 20 22:58:47 PDT 2015" ?

Is that a different LLVM than "3.6.0svn-mono-master/ce4fcec" ?

The F# programs work fine on x86, with the same versions of Mono and LLVM that the F# programs fail with on x64.
Comment 3 donsyme 2015-05-27 16:27:02 UTC
(The original report said "Windows", as specified in the bug the problem actually only occurs on Linux)
Comment 4 Zoltan Varga 2015-05-27 16:31:57 UTC
Can somebody who can reproduce the problem attach the fsharp dll-s and the testcase exe file used ?
Comment 5 igouy2 2015-05-27 23:22:49 UTC
Created attachment 11365 [details]
testcase exe file
Comment 6 igouy2 2015-05-27 23:34:52 UTC
Created attachment 11366 [details]
Comment 7 igouy2 2015-05-27 23:36:59 UTC
Comment on attachment 11365 [details]
testcase exe file

/usr/local/bin/mono --llvm --gc=sgen nbody.fsharp_run.exe 500000

Comment 8 igouy2 2015-05-27 23:38:18 UTC
What other fsharp dll-s do you need?
Comment 9 Zoltan Varga 2015-05-29 12:25:10 UTC
Still can't reproduce this with:

Mono JIT compiler version 4.3.0 (master/4183c9c Fri May 29 12:08:39 EDT 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           normal
	SIGSEGV:       altstack
	Notification:  kqueue
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	LLVM:          yes(3.6.0svn-mono-master/cf9a0d7)
	GC:            sgen
Comment 10 igouy2 2015-05-31 23:51:46 UTC
Confirmed, close - no problem with Mono JIT compiler version 4.3.0 (master/54e8010 Sun May 31 13:36:15 PDT 2015)

Comment 11 Zoltan Varga 2015-06-01 07:52:58 UTC