-
Notifications
You must be signed in to change notification settings - Fork 254
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
LinuxLiveDataReader.GetVersionInfo does not produce the correct answer #306
Comments
It seems to somehow work for most instances of my application (all of them running from directories named as GUIDs), but not this one. Maybe it has to do with the order of |
Yeah that's pretty sketchy code. I should have reviewed that one closer when I merged it. I'll replace that with just a Regex after I confirm there's not a better way to get the version of .Net Core. |
It's a problem I've run into myself and I've been reading it from the .deps.json file for self-contained deployments. Here's the code I use to get the version of the running .NET Core app, which I think can be easily modified to work with arbitrary application paths:
|
I think we should just stop trying to parse the version on Linux, at least for now. On Windows we embed this information near the beginning of the dll. On linux this lives at a really deep offset. (For example search libcoreclr.so for the ascii string "@(#)", which is where the version is. In my local test environment the offset was I'm not sure of a faster way to look this information up other than searching the binary for it, but maybe there's a pointer I could look for. I'm also not sure this string would be placed into a mini coredump if generated through dotnet-dump. This would mean even if we fixed the live data target to search for and read it, we would get inconsistent results in a coredump case where libcoreclr.so wasn't available locally. I will probably circle back to this in the future. |
Isn't that going to break something else? Was the version not used for anything? |
Inside the library, it was used to make windows symbol server requests for I have two main thoughts here:
|
Searching for the version string seems viable. One "@(#)Version" string is located in the "nativeStringResourceTable_mscorrc_debug" table with an offset of about 2k bytes. The string resource table is in the library exports. |
@NextTurn Assuming that table goes into Mini dumps, yep that could be the fix here. The underlying problem is consistent behavior. If you do Inconsistent behavior isn't the end of the world here as long as we don't report the wrong version, but I'd like to understand where we are before diving into this. (Also I'm working on getting the codebase ready for v2, so this issue is taking a back seat for a bit. I'm happy with returning 0.0.0.0 for now.) |
Verified the string goes into "Heap"/"Mini" dumps from |
dotnet-dump/SOSHosting has C# code that searches for the @(#)Version for the "eeversion" SOS command. This code is only used for libcoreclr.so. https://github.com/dotnet/diagnostics/blob/7fef83c075965a10e25d3dec551ea6cca4ca8c83/src/SOS/SOS.Hosting/SOSHost.cs#L667 |
@mikem8361 FYI the use of Test results of
|
This comment has been minimized.
This comment has been minimized.
What would be the first version to contain this fix and when is it expected to be released, please? |
1.1.61812 seems to contain this fix. |
Thanks, I upgraded to that version and a process that caused the previous exception now throws a different one:
Not a very informative error. :) |
Hmm, interesting. I think the only place that would fail is here:
Unfortunately all of the linux core dump reading code is really, really hard to debug. It's on my todo list to clean up, but I haven't gotten to it yet. I think I'm going to try to tackle that today (but I can't promise I'll wrap that up today). |
Opened #528 |
Should I create a new issue about the new error? (Since this one is closed, but there is still a problem.) |
Didn't #528 fix the new problem? |
Just tested it now and yes, it did, thank you. (I wasn't following that PR.) |
ClrMd 1.1.46104 (also reproduces on latest master), .NET Core 2.1 on Linux x64 (Ubuntu 18.04)
This happens when using a self-contained deployment and the directory name is a GUID, separated with dashes, like "909B593B-4E9B-4294-AC28-FD5A369FA776".
Looking at what's happening in
LinuxLiveDataReader.GetVersionInfo
, it's trying to parse the directory name containing .so files as a version (and apparently accepts any hexadecimal numbers, too!) but this obviously doesn't work for self-contained deployments: the directory name may be a valid version, but not the CLR version.The text was updated successfully, but these errors were encountered: