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

SegFault in latest main.c::change_winsize #41

Closed
apedev7 opened this issue Apr 6, 2019 · 5 comments
Closed

SegFault in latest main.c::change_winsize #41

apedev7 opened this issue Apr 6, 2019 · 5 comments
Labels

Comments

@apedev7
Copy link

apedev7 commented Apr 6, 2019

The function main.c::change_winsize segfault, caused by NULL tty.

This is easily reproducible by symlink /bin/login to a shell script that exits immediately without doing anything.

The underlaying sequence appears to be

  1. SIGCHLD queued,
  2. The window size message queued
  3. SIGCHLD processed to destroy the SID
  4. change_winsize is called with the destroyed SID.
  5. tty pointer thus is null
@zhaojh329 zhaojh329 added the bug label Apr 11, 2019
@zhaojh329
Copy link
Owner

Thanks.

@zhaojh329
Copy link
Owner

zhaojh329 commented Apr 11, 2019

Need to check the value of tty, if it is NULL, return directly.

@zhaojh329
Copy link
Owner

image

@zhaojh329
Copy link
Owner

Can you make a PR to fix it?

@apedev7
Copy link
Author

apedev7 commented Apr 11, 2019

I tested your fix, and it works fine.

I'm fine with your pushing the fix into the repo directly; I don't need the credit.

zhaojh329 pushed a commit that referenced this issue Apr 12, 2019
Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
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

2 participants