-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Seg Fault on Ubuntu 22 (using OpenSSL3); Does not exist on Ubuntu 20 (using OpenSSL 1.1) and Windows #74345
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @dotnet/area-system-security, @vcsjones Issue DetailsIs there an existing issue for this?
Describe the bugSummary: Periodic (seemingly random) but frequent Segmentation Faults when running code on Ubuntu 22; code is fine on Ubuntu 20 and Windows. Details: After upgrading Ubuntu 22; dotnet application results in Segmentation Fault. A trace shows this appears to come immediately after a socket send message (sendmsg) command with Trace shows it could be related to MD5() StackTrace: #0 0x00007fff2c5786b0 in MD5_Update () from /lib/x86_64-linux-gnu/libcrypto.so.3 Possible cause: Similar bugs in other applications (e.g. FreeRADIUS/freeradius-server#4539) have been made because of an upgrade from OpenSSL1.1 to OpenSSL3 in Ubuntu 20 -> Ubuntu 22 Expected BehaviorNo Seg Fault. Steps To ReproduceNo response Exceptions (if any)No response .NET Version6.0.7 and 6.0.8 Anything else?DotNet was in installed both through
First install: dotnet --info
(Also happens after upgrade to 6.0.8)
|
As far as I can tell, .NET never directly calls Is your application P/Invoking into OpenSSL directly, or possibly using a library that does? Without a repro there's not going to be a lot we can do here. |
This issue has been marked |
I feared there would not be enough but thanks for reviewing. There is no security stuff/ssl at all in the one library I'm using, which is why I reported to DotNet. No includes etc either. I'll ask/report there anyway in case I missed it. Only functions are through System.Security.Cryptography (including CryptoStream, HMACMD5.ComputeHash(), MD5.ComputerHash(), AES.* etc). Please close if nothing obvious, and if I ever can create a repro solution I'll update. |
@bartonjs To bring this to an end; eventually tracked down that I was using MD5 as if thread safe, but it is not thread safe. Replaced with a static System.Security.Cryptography.MD5.HashData() (static, so can only be used on the one thread) and problem appears to have gone. Pure fluke it was Ubuntu 22 and not other OSes. This led to to the solution:
Thanks for responding. |
Is there an existing issue for this?
Describe the bug
Summary:
Periodic (seemingly random) but frequent Segmentation Faults when running code on Ubuntu 22; code is fine on Ubuntu 20 and Windows.
Details:
After upgrading Ubuntu 22; dotnet application results in Segmentation Fault.
A trace shows this appears to come immediately after a socket send message (sendmsg) command with
.NET ThreadPool[40301]: segfault at 10 ip 00007fefec22c6b0 sp 00007fefbf7f9f80 error 4 in libcrypto.so.3[7fefec11d000+25d000]
in the logs. Note: there are multiple prior successful sendmsg commands; so may more may not be related.Trace shows it could be related to MD5()
StackTrace:
Possible cause:
Similar bugs in other applications (e.g. FreeRADIUS/freeradius-server#4539) have been made because of an upgrade from OpenSSL1.1 to OpenSSL3 in Ubuntu 20 -> Ubuntu 22
Expected Behavior
No Seg Fault.
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
6.0.7 and 6.0.8
Anything else?
DotNet was in installed both through
First install:
dotnet --info
(Also happens after upgrade to 6.0.8)
The text was updated successfully, but these errors were encountered: