binfmts is not working correctly with wine and mono-runtime

Bug #1176948 reported by i30817
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
binfmt-support (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I'm in ubuntu-gnome raring.

If i don't install nothing, i can only open non-C# exe files with fileroller.
If i install wine i *keep* opening non-C# exe with fileroller (wine appears on the 'Open with' submenu but doesn't appear on 'other applications' dialog, even if the exe is marked executable).
This is a horrible bug, but different.
edit: i resolved this other bug, by editing the file-roller desktop file and removing the application/x-ms-dos-executable association, but binfmt is still confused about both wine and mono-runtime installed)

If i install mono-runtime, then mono runtime suddenly is the default for both C# exe AND wine exe.
So the detection script for C# executables is not failing for non-C#, or is not running at all and the first is winning.
edit: actually... there are desktop files for both wine and mono-runtime too, and they both associate with application/x-ms-dos-executable... since that was a problem with file-roller *insisting* on opening before binfmt configs, likely the same thing is happening - for some reason GNOME3 is checking the desktop files for mimetypes associations first before checking binfmt associations and the 'first' wins the lexigraphic sort; file-roller < mono-runtime < wine

Looks like a major bug somewhere - why would the desktop files be checked first before something that can actually check for false positives?

This is the output of my current system installed binfmts supported packages:
update-binfmts --display
python3.3 (enabled):
     package = python3.3
        type = magic
      offset = 0
       magic = \x9e\x0c\x0d\x0a
        mask =
 interpreter = /usr/bin/python3.3
    detector =
python2.7 (enabled):
     package = python2.7
        type = magic
      offset = 0
       magic = \x03\xf3\x0d\x0a
        mask =
 interpreter = /usr/bin/python2.7
    detector =
cli (enabled):
     package = mono-runtime
        type = magic
      offset = 0
       magic = MZ
        mask =
 interpreter = /usr/bin/cli
    detector = /usr/lib/cli/binfmt-detector-cli
jar (enabled):
     package = openjdk-7
        type = magic
      offset = 0
       magic = PK\x03\x04
        mask =
 interpreter = /usr/bin/jexec
    detector =
wine (enabled):
     package = wine
        type = magic
      offset = 0
       magic = MZ
        mask =
 interpreter = /usr/bin/wine
    detector =

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: binfmt-support 2.0.13
ProcVersionSignature: Ubuntu 3.8.0-19.30-generic 3.8.8
Uname: Linux 3.8.0-19-generic x86_64
ApportVersion: 2.9.2-0ubuntu8
Architecture: amd64
Date: Mon May 6 15:38:44 2013
InstallationDate: Installed on 2013-04-22 (14 days ago)
InstallationMedia: Ubuntu-GNOME 13.04 "Raring Ringtail" - Release amd64 (20130421)
MarkForUpload: True
SourcePackage: binfmt-support
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
i30817 (i30817) wrote :
Revision history for this message
i30817 (i30817) wrote :

Also this is the output of cat /usr/share/applications/defaults.list | grep file-roller
application/x-ar=file-roller.desktop
application/x-arj=file-roller.desktop
application/x-bzip-compressed-tar=file-roller.desktop
application/x-bzip=file-roller.desktop
application/x-compressed-tar=file-roller.desktop
application/x-compress=file-roller.desktop
application/x-ear=file-roller.desktop
application/x-gtar=file-roller.desktop
application/x-gzip=file-roller.desktop
application/x-jar=file-roller.desktop
application/x-java-archive=file-roller.desktop
application/x-lha=file-roller.desktop
application/x-lhz=file-roller.desktop
application/x-lzop=file-roller.desktop
application/x-rar-compressed=file-roller.desktop
application/x-rar=file-roller.desktop
application/x-rpm=file-roller.desktop
application/x-tar=file-roller.desktop
application/x-war=file-roller.desktop
application/x-zip-compressed=file-roller.desktop
application/x-zip=file-roller.desktop
application/x-zoo=file-roller.desktop
application/zip=file-roller.desktop
multipart/x-zip=file-roller.desktop

Funny enough, there is no exe here so i don't know WTF is happening.

Revision history for this message
i30817 (i30817) wrote :

Well, i think the culprit maybe the file-roller.desktop file; which still has
application/x-ms-dos-executable on it's 'MimeType=' entry (

Revision history for this message
i30817 (i30817) wrote :

Well, it was part of the problem mono-runtime still gets confused about normal executables and tries to run them (ie: the detector for C# has false positives or is not working correctly at all and 'mono' because it's first on the list of binfmt)

i30817 (i30817)
description: updated
description: updated
description: updated
summary: - binfmts is not working correctly with wine
+ binfmts is not working correctly with wine and mono-runtime
description: updated
i30817 (i30817)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in binfmt-support (Ubuntu):
status: New → Confirmed
Revision history for this message
Damian Yerrick (tepples) wrote :

I'm still seeing it in bionic. If wine gets added after mono-runtime then any attempt to run a Mono executable without using `mono` from the terminal produces "002e:err:mscoree:CLRRuntimeInfo_GetRuntimeHost Wine Mono is not installed".

$ update-binfmts --display
python3.6 (enabled):
     package = python3.6
        type = magic
      offset = 0
       magic = \x33\x0d\x0d\x0a
        mask =
 interpreter = /usr/bin/python3.6
    detector =
python2.7 (enabled):
     package = python2.7
        type = magic
      offset = 0
       magic = \x03\xf3\x0d\x0a
        mask =
 interpreter = /usr/bin/python2.7
    detector =
cli (enabled):
     package = mono-runtime
        type = magic
      offset = 0
       magic = MZ
        mask =
 interpreter = /usr/bin/cli
    detector = /usr/lib/cli/binfmt-detector-cli
wine (enabled):
     package = wine
        type = magic
      offset = 0
       magic = MZ
        mask =
 interpreter = /usr/bin/wine
    detector =

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.