Bug 60125 - mkbundle crashing in MakeBundle.QueueAssembly - null reference exception
Summary: mkbundle crashing in MakeBundle.QueueAssembly - null reference exception
Status: NEEDINFO
Alias: None
Product: Tools
Classification: Mono
Component: mkbundle ()
Version: 5.2 (2017-04)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-10-11 12:59 UTC by Joseph Humfrey
Modified: 2018-05-08 14:42 UTC (History)
4 users (show)

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


Attachments
Example files to bundle to reproduce error (184.55 KB, application/zip)
2017-10-31 09:27 UTC, Joseph Humfrey
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 for Bug 60125 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEEDINFO

Description Joseph Humfrey 2017-10-11 12:59:31 UTC
I have been trying to bundle our ink compiler (https://github.com/inkle/ink) using mkbundle. Here's how I run it:

mkbundle --static --sdk /Library/Frameworks/Mono.framework/Versions/Current --deps inklecate.exe ink-engine-runtime.dll -o inklecate_mac

...but I get crash with the following stack trace:

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at MakeBundle.QueueAssembly (System.Collections.Generic.List`1[T] files, System.String codebase) [0x000bc] in <984a17ca6b0b4a0286f5e4481cb18cc8>:0 
  at MakeBundle.QueueAssembly (System.Collections.Generic.List`1[T] files, System.String codebase) [0x000bc] in <984a17ca6b0b4a0286f5e4481cb18cc8>:0 
  at MakeBundle.Main (System.String[] args) [0x00d5f] in <984a17ca6b0b4a0286f5e4481cb18cc8>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
  at MakeBundle.QueueAssembly (System.Collections.Generic.List`1[T] files, System.String codebase) [0x000bc] in <984a17ca6b0b4a0286f5e4481cb18cc8>:0 
  at MakeBundle.QueueAssembly (System.Collections.Generic.List`1[T] files, System.String codebase) [0x000bc] in <984a17ca6b0b4a0286f5e4481cb18cc8>:0 
  at MakeBundle.Main (System.String[] args) [0x00d5f] in <984a17ca6b0b4a0286f5e4481cb18cc8>:0

It used to work fine... perhaps it's broken since I updated mono a little while back? I'm currently on version 5.2.0.224.

(If you want to reproduce on Mac, you should be able to grab the git repo I linked above, and run the build_for_inky.command script.)
Comment 1 Joseph Humfrey 2017-10-11 13:05:20 UTC
After uninstalling 5.2.0 and installing 4.8.1, I confirmed that it still works there.
Comment 2 Jens Eckervogt 2017-10-20 09:42:18 UTC
@Joseph, I can not appreciate your suggestion because you're still liar. ( But I am sure that .) Because I always tried no success.

"$ mkbundle Example.exe -o Output.exe
WARNING: Dynamically linking the Mono runtime on Windows is not a tested option.

Unhandled Exception:
System.IO.FileNotFoundException: C:\Program Files (x86)\Mono\lib\monosgen-2.0.lib
  at MakeBundle.LocateFile (System.String default_path) [0x0002b] in <7f48080a3b114b079f18a57679809965>:0
  at MakeBundle.GenerateBundles (System.Collections.Generic.List`1[T] files) [0x00885] in <7f48080a3b114b079f18a57679809965>:0
  at MakeBundle.Main (System.String[] args) [0x00ade] in <7f48080a3b114b079f18a57679809965>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: C:\Program Files (x86)\Mono\lib\monosgen-2.0.lib
  at MakeBundle.LocateFile (System.String default_path) [0x0002b] in <7f48080a3b114b079f18a57679809965>:0
  at MakeBundle.GenerateBundles (System.Collections.Generic.List`1[T] files) [0x00885] in <7f48080a3b114b079f18a57679809965>:0
  at MakeBundle.Main (System.String[] args) [0x00ade] in <7f48080a3b114b079f18a57679809965>:0"

What is it meaning? I already tried old version 2.10.8 no work because gcc 3 version doesn't exist. I try skipping and Version 5.4.0, 5.2.0, 5.0.0 and 4.8.0 no success because Mono crashed since compiling and generating.

How do I fix? I really need fucking mono runtime.
Comment 3 Marek Safar 2017-10-27 11:00:30 UTC
I could not reproduce it locally, could you attach your full folder with inky you want to mkbundle?
Comment 4 Joseph Humfrey 2017-10-31 09:27:44 UTC
Created attachment 25513 [details]
Example files to bundle to reproduce error

- bundle.sh contains the mkbundle line that we run
- inklecate.exe is the main binary executable to package
- ink-engine-runtime.dll is a dependency
- Also included .pdb files for both, and documentation XML for the runtime dll.

Note that with mkbundle in latest Mono (5.8.0.22) on Mac, I couldn't reproduce the original error, but instead see "ERROR: Unable to load assembly `System.Runtime' referenced by `/Users/phish/Desktop/mkbundle-test/ink-engine-runtime.dll'" However, when I go back and install 5.2.0.224 I do manage to reproduce the bug again.
Comment 5 Joseph Humfrey 2018-05-08 14:42:12 UTC
Update: I'm still getting this on version 5.10.1.47 (the above error, "Unable to load assembly System.Runtime").

I'd really like to be able to upgrade Mono permanently, I can't use Visual Studio for Mac with 4.8.1!