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

ENOTTY when using embedded Linux Console Window #339

Closed
mqudsi opened this issue Sep 23, 2018 · 4 comments
Closed

ENOTTY when using embedded Linux Console Window #339

mqudsi opened this issue Sep 23, 2018 · 4 comments
Assignees
Labels

Comments

@mqudsi
Copy link

mqudsi commented Sep 23, 2018

Attempting to use VSLinux to debug applications that attempt to introspect stdin causes ENOTTY to be emitted by the remote linux kernel.

It should be reproducible with just this code sample:

#include <stdio.h>
#include <unistd.h>

int main(int argc, const char *argv[]) {
    int result = tcgetpgrp(STDIN_FILENO);
    printf("result: %d, errno: %d\n", result, errno);
}

The tcgetpgrp(3) call fails, errno is set to ENOTTY.

Is it possible to make debugging an application via the Linux Console Window transparent to such terminal-related kernel calls?

@lukka lukka self-assigned this Sep 24, 2018
@lukka lukka added the feature label Sep 24, 2018
@lukka
Copy link
Member

lukka commented Sep 24, 2018

@mqudsi thanks for the report. We need to investigate on why the remote process does not have an allocated tty. Currently, when debugging, VS redirects the output of the debuggee using gdb redirection to another shell create for that purpose only, which has a pty allocated. It might be we have to reconsider this choice.

@mqudsi
Copy link
Author

mqudsi commented Sep 24, 2018

Thanks, @lukka.

Personally, I wouldn't rely on gdb to get the pty. It should be fairly straightforward to create a launcher that waits for gdb to connect then execs the target, then VS can start an SSH session, run that launcher, and attach gdb (so all debugging would use gdb attach instead of having gdb launch the target). That way you're guaranteed a native pty for the app and don't have to trust gdb to do the right thing.

@mqudsi
Copy link
Author

mqudsi commented Jul 12, 2019

It seems to me that the functionality I described in my last comment is now possible with the newer features available in launch.json, but I haven't dug deep enough into it to figure it out. I see that it's possible to override the launch command and to separately specify that gdb should attach to a process, I think?

@benmcmorran
Copy link
Member

This issue is being closed because we are no longer tracking VS Linux issues on GitHub. If the issue still reproduces, bugs and new suggestions should be reported on the Developer Community forum. It is centralized, better equipped for group voting, and has more visibility.

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