Bug 10879 - Use of mono-sgen causes mono path detection fallback
Summary: Use of mono-sgen causes mono path detection fallback
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Tools ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-03-04 10:39 UTC by Chris Ball
Modified: 2013-03-04 12:02 UTC (History)
3 users (show)

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

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 Chris Ball 2013-03-04 10:39:21 UTC
OS: Linux (RHEL 5)
Versions: 2.10.9 & 3.0.4
Built via tarball

./configure --prefix=/tmp/build
make
make install
mv /tmp/build /tmp/renamed
export MONO_GAC_PREFIX=/tmp/renamed
export PATH=$PATH:/tmp/renamed/bin
export MONO_GAC_PREFIX=/tmp/renamed
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/renamed/lib

# this prints "help" details, as expected
/tmp/renamed/bin/mono /tmp/renamed/lib/mono/4.5/sn.exe -h
# this produces an error
/tmp/renamed/bin/mono-sgen /tmp/renamed/lib/mono/4.5/sn.exe -h

The first command succeeds (prints out the usage). The second command fails, producing:

  The assembly mscorlib.dll was not found or could not be loaded.
  It should have been installed in the `/tmp/build/lib/mono/4.5/mscorlib.dll' directory.

I have traced the issue to mono/metadata/assembly.c:compute_base:

  /* Not a well known Mono executable, we are embedded, cant guess the base */
  if (strcmp (p, "/mono") && strcmp (p, "/monodis") && strcmp (p, "/mint") && strcmp (p, "/monodiet"))
    return NULL;

By changing this as follows, the behavior is corrected:

  /* Not a well known Mono executable, we are embedded, cant guess the base */
  if (strcmp (p, "/mono") && strcmp (p, "/mono-sgen") && strcmp (p, "/pedump") && strcmp (p, "/monodis") && strcmp (p, "/mint") && strcmp (p, "/monodiet"))
    return NULL;
Comment 1 Rodrigo Kumpera 2013-03-04 12:02:21 UTC
Merged both fixes into mono.

Thanks for working on this.