Skip to content
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

SIGABRT on Linux when their is a ptrace() failure #264

Closed
ayende opened this issue Jun 14, 2019 · 1 comment
Closed

SIGABRT on Linux when their is a ptrace() failure #264

ayende opened this issue Jun 14, 2019 · 1 comment

Comments

@ayende
Copy link

ayende commented Jun 14, 2019

Repro by the following code.
This will fail since the process doesn't have SYS_PTRACE, but the problem is that any error that is thrown there will cause an access violation and kill the process.
I believe that the issue is something with the way the code jumps between managed / native codes there that isn't ready to handle exceptions, but I'm not sure

try
{
    var dt = DataTarget.AttachToProcess(Process.GetCurrentProcess().Id, 1000, AttachFlag.Passive);
    var runtime = dt.ClrVersions[0].CreateRuntime();
    var st = runtime.Threads[0].EnumerateStackTrace().First();
    Console.WriteLine(st.DisplayString);
}
catch (Exception e)
{
    Console.WriteLine(e);
    Console.WriteLine("Error, died");
}
@leculver
Copy link
Contributor

How would I test this scenario? Let's say I have an Ubuntu 18 and I'm unwilling to install another package...is there a way I can remove SYS_PTRACE from my own process to be able to test this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants