Bug 26346

Summary: Full AOT crash: Instructions.cpp:281: void llvm::CallInst::init(llvm::Value *, ArrayRef<llvm::Value *>, const llvm::Twine &): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"
Product: [Mono] Runtime Reporter: KaptOc6obnuCac0Bluc+bugzilla.xamarin.com
Component: GeneralAssignee: Bugzilla <bugzilla>
Status: RESOLVED FIXED    
Severity: normal CC: mono-bugs+mono, mono-bugs+runtime, ramc, vargaz
Priority: ---    
Version: 3.8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: Crashing dll
Crash log
F# Core (dependency)

Description KaptOc6obnuCac0Bluc+bugzilla.xamarin.com 2015-01-23 09:58:32 UTC
When I tried to `mono --llvm --aot=full FsCheck.dll` it crashes with

Mono Ahead of Time compiler - compiling assembly /tmp/FsCheck.dll
mono: Instructions.cpp:281: void llvm::CallInst::init(llvm::Value *, ArrayRef<llvm::Value *>, const llvm::Twine &): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed.

The dll and the stacktrace are attached.

Environment:
OS: Ubuntu 14.04 x86_64
Mono (rebuild from tpokorra repo using "./configure --prefix=/opt/mono --enable-llvm --with-llvm=/opt/mono --with-oprofile=/usr" in debian/rules and binary stripping also disabled):

Mono JIT compiler version 3.12.0 (tarball Tue Jan 20 14:22:39 CET 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	LLVM:          yes(3.4svn-mono-/)
	GC:            sgen
Comment 1 KaptOc6obnuCac0Bluc+bugzilla.xamarin.com 2015-01-23 10:00:16 UTC
Created attachment 9469 [details]
Crashing dll
Comment 2 KaptOc6obnuCac0Bluc+bugzilla.xamarin.com 2015-01-23 10:01:03 UTC
Created attachment 9470 [details]
Crash log
Comment 3 Zoltan Varga 2015-01-23 19:52:56 UTC
Please attach the FsCheck.dll dependencies as well. Also note that --aot=full is intented for use on environments which don't allow JITting, it doesn't make too much sense on amd64.
Comment 4 KaptOc6obnuCac0Bluc+bugzilla.xamarin.com 2015-01-23 20:11:32 UTC
Created attachment 9482 [details]
F# Core (dependency)

FSharp.Core.dll is attached. This is the only known dependency for FsCheck.

FsCheck are also available in binary form:
https://www.nuget.org/packages/FsCheck/

FsCheck are also available in source form:
https://github.com/fsharp/FsCheck
Comment 5 Zoltan Varga 2015-01-24 19:11:29 UTC
Fixed in mono master f342649f75bf13da8c1e14342a2dd69655add6e0.
Comment 7 Zoltan Varga 2015-02-19 11:01:03 UTC
The issue only happens with a 64 bit mono runtime, and we don't distribute that right now, so its kinda hard to reproduce without compiling one. I'd suggest treating this as verified.
Comment 8 KaptOc6obnuCac0Bluc+bugzilla.xamarin.com 2015-02-19 12:55:52 UTC
Well, the distribution about the 64bit mono runtime is more or less true - it would be good to have 64 bit runtime on 64 bit cpu.

Please note community builds are already available to everyone (it also support most linux distribution), and also listed on the Mono Project homepage.

Steps to reproduce on Ubuntu 14.04 x86_64:

1) Add tpokorra repo to your distribution, which is also available on Mono 
Project download page:

http://www.mono-project.com/download/#download-lin

"Community packages"
  "Mono Packages installed to /opt for CentOS, Fedora, Debian and Ubuntu"

2) Download Fsharp.Core.dll (if you don't have F# already installed) and FsCheck.dll from the issue.

3) Execute the following command:

source /opt/mono/env.sh
mono --llvm --aot=full FsCheck.dll