-
Notifications
You must be signed in to change notification settings - Fork 658
Description
Not sure where the problem is - if it is GitVersion, or stuff in Mono, or LibCurl that is the problem.
If anything, I think LIBCURL is most likely the problem.
Steps to reproduce:
a) MACHINE
Ubuntu 18 - 64bit clean machine
sudo apt-get install mono-complete
Download your V4.0.0 Release package zip file.
(you may have some other things installed via apt-get)
b) install libcurl4
apt-get install libcurl4
This removes any libcurl3 and installs libcurl4. At this point you have a symbolic link that points: 'libcurl.so.4" -> libcurl(for-real-version-4)
c) Run GitVersion
cd to some git directory and type: mono /path/to/GitVersion.exe
Result: CRASH - obviously not expected.
d) Remove libcurl4, and install libcurl3
apt-get install libcurl3
This removes the libcurl4, and installs libcurl3
Weird - it's a PITA - should be able to have both installed
(it does other nasty things too - the whole thing is screwball)
e) Run GitVersion
mono /path/to/GitVersion.exe
- result: does not crash. Great Success!
Root Cause
You'll see this if you use strace -o FILE mono /path/to/GitVersion.exe
then examine the TRACE file
On the surface it looks like a "libcurl4" vrs "libcurl3" problem and the problem is very much so centered around libcurl3 and libcurl4 - See the discussion here:
https://bugs.launchpad.net/ubuntu/+source/curl/+bug/1754686
For some reason "mono GitVersion.exe" - is linked against what IT THINKS is libcurl4 - but is really linked against some version of libcurl3
I don't know enough to point my finger at the correct offending party. But it is a show stopper for Ubuntu18.
Somebody screwed up the symbolic links here, and wrongly had "4 point to 3" - because it is more then just this application, it effects multiple other applications.
WORKAROUND
You cannot just create "libcurl.so.3" - because the "combination of mono + GitVersion.exe" has the name: 'libcurl.so.4' hard coded somewhere. The linker does this during the link phase when setting up shared libraries. You can only fix it if you re-link the offending application and/or libs that use libcurl
Step a) Create a private copy of the borked libcurl.so.4
Install libcurl3 via: apt-get install libcurl3
- then copy the apt-get install libcurl3
version of "libcurl.so.4" somewhere safe a private directory not in your normal LD_LIBRARY_PATH
Example: /lib/LIB_CURL3_FIX/libcur.so.4
Step b) You can now install libcurl4
ie: apt-get install libcurl4
Step C) For every app effected by this problem
And GitVersion.exe is one of those apps.
Create a shell script wrapper that uses "LD_PRELOAD=/path/to/libcurl.so.4 (which came from apt-get install libcurl3) to force load the broken/borked version of the library.
My script is simple:
#! /bin/bash
export LD_PRELOAD=/path/to/my/private/libcurl.so.4
exec mono /path/to/GitVersion.exe $@
You can then do the same thing for all other 'libcurl3' victim applications. I'm just documenting it for this app here.
RESULT
It works!!!! I have several other apps I need to fix/install with wrappers... Grrr this is a pain in the ass mistake.