Skip to content

GitVersion on Ubuntu 18 64 with LibCurl 4 #1508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
duaneellissd opened this issue Oct 19, 2018 · 3 comments
Closed

GitVersion on Ubuntu 18 64 with LibCurl 4 #1508

duaneellissd opened this issue Oct 19, 2018 · 3 comments
Labels

Comments

@duaneellissd
Copy link

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.

@robvanpamel
Copy link

Is there already a real fix for this issue ? ( not the workaround )

@arturcic
Copy link
Member

There is a work in progress PR and you can try the suggestion from here #1660 (comment). It does not work on mono unfortunately.

@stale
Copy link

stale bot commented Aug 19, 2019

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 19, 2019
@stale stale bot closed this as completed Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants