-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
dotnet restore segfaults on Debian 9.0/stretch Testing #17443
Comments
also hapenning on my tests here |
Is this Jessie or some other version? |
I just realized that "testing" in the title means you're talking about "stretch" instead of a general "I'm testing stuff on Debian". We haven't run on Debian testing, I expect there will be a few issues we'll have to look into, mainly around the fact that the native libraries binaries we ship may not be compatible out of the box with what's in Stretch. For 1.0 we are just targeting Jessie, but we hope to document the process of bootstrapping the CLI from source for other distros within the next week few weeks. |
I get the Segmentation faults in the official latest Docker image during a dotnet restore. |
I did some tests and the official Docker images (jessie-based) work only if the kernel is old enough (3.16) but segfault if run on a system with a new kernel (4.5 or 4.6 for example): docker isolates the user space, true, but runs on the same kernel of the host. The same is true for the official jessie packages on a jessie machine: "dotnet new" (when populating the initial cache) and "dotnet restore" segfault on newer kernels. |
I've been experiencing this bug for a long time now too, using Debian Sid ("unstable"). @karelz, how can I help resolve the issue? For now, I'm developing inside of a virtual machine, but that is exactly what I am trying to get away from and looking at .NET Core to begin with... |
|
Exactly same stack trace here. It is possible to include the debug symbols in the .deb packages or in the tarball? That would produce a much better trace. |
I was unable to get |
We definitely need callstack with symbols. The raw stack numbers are in general not helpful. |
I don't know how; wouldn't GDB dump them if they were available? If you're asking me to compile things w/ the symbols ("debugging enabled"), I'll need help; I can't even get the built versions of things work, so that's probably not going to happen. If it's an option I can pass to |
@ellismg who can help here? |
Would it make sense to e.g. change the To be honest, it's rather confusing not being able to see what versions of packages are available on MyGet, or which feeds/channels are obsolete and which type of build each one is (and even, what each one is, sometimes); given that both the tooling and run-time are in development, and that the tooling is built on the same run-time, new users are easily confused! When things like I appreciate the help; I'm very excited to play with the awesome things everyone's been working so hard to get out the door. |
I'm not sure why this bug is in the When using the
Crash logs and dumps from Debian Sid -- debian.sid.crash.gdb.log.txt |
@nmschulte Just to be clear, the contents of |
@ellismg precisely;
The |
@nmschulte dotnet runs fine on Jessie as long as you use the 3.16 kernel.Switch to a new one and you get the same libcrypt-related bug. |
That's the bug I assume this story is here to address, though, right? There are no v3 kernels packaged for Debian Sid or Debian Testing (next stable; freezes 2017-02-05). Booting a custom built kernel isn't something I want to have to support (myself individually, or as part of the community) in order to use .NET Core. |
@nmschulte Yes. Sorry, I didn't explain myself too well. I just wanted to emphasize that everything runs OK on Jessie as long as you don't upgrade the kernel, else everything breaks on Jessie too. |
Yes, there have been releases since May: https://www.microsoft.com/net/download/core |
This is a known issue that was fixed on June 26 2016. See https://github.com/dotnet/coreclr/issues/6016 and dotnet/coreclr#6027 |
I did my testing well after May and June; so while the issues are resolved in the src, at the time (and maybe still now), there's no way to use it on these systems as there was (is?) no release (CoreCLR 1.0.4 has the fix) w/ it available. So many moving parts w/ disparate versionings, all brand new (v1.0.0/preview1...), it's confusing and easy to get lost. A webpage showing the dependencies (as a graph or nested structure) w/ current version numbers/names might go a long way (for the various releases at least). I guess this issue can be closed, though. Thank you for taking the time! |
@nmschulte the tarballs available at https://github.com/dotnet/cli all contain that fix. The packages that you can download from http://dot.net site also have that fix. |
Closing as dupe of the issues mentioned above: https://github.com/dotnet/corefx/issues/8951#issuecomment-267572781 |
I am using Debian 9 (Stretch) and I have the same issue of dotnet segfaulting when using
|
Isn't this the usual problem with libcurl? Just downgrade curl and libcurl3 to version 7.38.0-4+deb8u5 and the last tarball works correctly on Stretch. |
@fogzot Oh it actually worked ! I used Jessie's version of libcurl 3 and I managed to create, restore and run the app ! I don't really understand why but I won't complain ! Any way to make a wiki or something to explain all steps needed to be able to use .NET Core on Debian Stretch ? I had to look several issues to know I had to download several packages and so on. Thanks ! EDIT : I created a markdown file here to explain the step to follow to make it work on Stretch. I tried on a brand new Stretch VM and it works great. |
BTW: I linked your workaround above from OS Supported Versions If you want to move your how-to to CoreFX wiki, you can - it is writeable for everyone. We can figure out how to incorporate it into other the docs. |
Sorry to revive this, but I couldn’t find anything and am not linux savvy enough to know if this has been fixed by now or if the workaround is still required since Debian 9 is officially released? |
@marce155 Are you able to try out .NET Core 2.0? It should work without a workaround, I believe. |
Unfortunately no, it still doesn't work. I just tried .NET Core 2.0 preview 2 with curl/libcurl 7.52.1-5 from Debian stable and |
Some additional information. Some parts of dotnet explicitly link with libcurl and libssl1.0.0. In Debian 9 libcurl links to libssl1.0.2 so dotnet ends loading both libraries at the same time. I guess the problem would go away if MS release a build of dotnet that uses the same SSL as libcurl, i.e., 1.0.0 for Debian 8 and 1.0.2 for Debian 9. |
Yet another bump to this, preview2 doesn't work OOB and depends on oldstable libcurl. Can we do anything with that? Stretch went stable a while ago and not supporting it without workarounds feel wrong. |
Could you post a bit more information about your system set-up? I created a Debian 9.0 docker container and was able to run with the latest "Linux x64" bits from https://github.com/dotnet/cli. I have this version of curl and ssl installed:
I'm able to run I'm using a docker container, so obviously this environment might not match what you guys are using. I can set up a real VM, but that will take a bit more time. |
@danmosemsft @karelz We might want to re-open this and double-check that things are working as expected. I think it was closed previously because a workaround existed, but we should support this scenario by default with 2.0. |
Correct output:
Bad output:
In
Installed is oldstable version that works properly. Candidate is the version that doesn't work and causes segfault.
|
Hm. Your repro works for me (it prints out "OK" and then exits), and I have this installed:
You are saying that when you update it to my version, |
It may also help narrow things down if you try the latest version from the master branch of CLI, as well as the release/2.0.0 branch. |
I just did some extensive tests using a clean Debian 9 docker image. On a clean install, adding curl and libcurl 7.52.1-5 is not a problem, everything works well. The problem pops up when upgrading an old Debian to version 9 or when using the Ubuntu .deb packages on Debian 9. In both cases libssl1.0.0 gets pulled in and BOOM, segfault. Note that this is NOT libssl1.0.2, the Debian 9 default but an older library with a different soname. Apparently dotnet tries to load any available libssl at runtime and when both libcurl 7.52.1-5 (that pulls libssl1.0.2) and libssl1.0.0 are present it chooses to load the older one resulting in a segfault. TL;DR: don't use Ubuntu packages on Debian 9 and remove libssl1.0.0 after upgrading from an older Debian to the latest stable. |
What @fogzot explained above very likely is the correct culprit, since I couldn't reproduce the bug on clean Debian 9 either, while my faulty machine had these:
I removed So yes, like fogzot said above:
This is correct. Which also means that you can easily reproduce my segfault if you do Whether this is worth it to investigate and fix dotnet to try to load newest |
I have some more information. Looking at a standard install of 1.0.x + 1.1.x runtime and 2.0 preview 2 runtime+sdk I can find only 3
Note that the dependencies where found using This means that older frameworks won't run on Debian 9 because of missing shared libraries (is this a problem?) Trying to compile and run a
Here's a little summary: .NET Core 1.0.x
.NET Core 1.1.x
.NET Core 2.0 preview 2
|
I've got GitLab installed on my Debian 9 server and dotnet new is segfaulting because it is somehow picking up libcrypto.so.1.0.0 in /opt/gitlab/embedded/lib/. If I rename this it no longer segfaults. Does anybody have any idea how dotnet is picking up this library and whether I can make it ignore it? |
@benscobie check /etc/ld.so.conf and you environment for LD_LIBRARY_PATH and LD_PRELOAD. I don't see any other way for a console app to pickup a library in |
The Debian 9 uses libssl.so.1.0.2 and libcrypto.so.1.0.2 instead of the 1.0.0 versions. When I have added support for the 1.0.2 version, I have not anticipated issues when both versions are installed. But obviously the presence of the 1.0.0 version is causing problems on Debian 9. .NET Core tries to load the version 1.0.0 first and only if the OS doesn't find it, it tries to load the 1.0.2. As @fogzot has mentioned, you probably have the /opt/gitlab/embedded/lib in one of the three places and the system looks into that location first. |
In desperation, I had stupidly symlinked libssl.so.1.0.0 in /lib/x86_64-linux-gnu/ to /opt/gitlab/embedded/lib/libssl.so.1.0.0 when I was originally fighting this issue. I've removed that and problem solved! |
I had this issue on debian stretch, gdb showed a segfault in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0.
After |
I understand that debian 9.4 (stretch) is not supported. |
@leecow for that |
The standard, default project.json files cause 'dotnet restore' to segfault on Debian Testing.
csharp_proj.zip
The text was updated successfully, but these errors were encountered: