-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Segmentation fault when window is resized #4291
Comments
This issue occurs at least in OS X 10 and Ubuntu. |
hm this is what I'm getting in lldb:
It looks like |
uv__fs_buf_iter currently sets req->bufs to NULL after it is done, but if the operation fails with EINTR then it will be retried, at which point it expects the bufs to not be NULL, causing a seg fault as in nodejs/node#4291. uv__fs_buf_iter should not set req->bufs to NULL if the operation fails with EINTR. Also, when it sets req->bufs to NULL, it should set req->nbufs to 0 as well, so we don't have the messy situation of a positive nbufs with no actual bufs.
uv__fs_buf_iter currently sets req->bufs to NULL after it is done, but if the operation fails with EINTR then it will be retried, at which point it expects the bufs to not be NULL, causing a seg fault as in nodejs/node#4291. uv__fs_buf_iter should not set req->bufs to NULL if the operation fails with EINTR. Also, when it sets req->bufs to NULL, it should set req->nbufs to 0 as well, so we don't have the messy situation of a positive nbufs with no actual bufs.
uv__fs_buf_iter currently sets req->bufs to NULL after it is done, but if the operation fails with EINTR then it will be retried, at which point it expects the bufs to not be NULL, causing a seg fault as in nodejs/node#4291. uv__fs_buf_iter should not set req->bufs to NULL if the operation fails with EINTR. Also, when it sets req->bufs to NULL, it should set req->nbufs to 0 as well, so we don't have the messy situation of a positive nbufs with no actual bufs. Review followups -move the check for EINTR to before we free bufs -pass retry_on_eintr to uv__fs_buf_iter -add a first cut at a test
uv__fs_buf_iter currently sets req->bufs to NULL after it is done, but if the operation fails with EINTR then it will be retried, at which point it expects the bufs to not be NULL, causing a seg fault as in nodejs/node#4291. uv__fs_buf_iter should not set req->bufs to NULL if the operation fails with EINTR. Also, when it sets req->bufs to NULL, it should set req->nbufs to 0 as well, so we don't have the messy situation of a positive nbufs with no actual bufs. Review followups -move the check for EINTR to before we free bufs -pass retry_on_eintr to uv__fs_buf_iter -add a first cut at a test
uv__fs_buf_iter currently sets req->bufs to NULL after it is done, but if the operation fails with EINTR then it will be retried, at which point it expects the bufs to not be NULL, causing a seg fault as in nodejs/node#4291. uv__fs_buf_iter should not set req->bufs to NULL if the operation fails with EINTR. Also, when it sets req->bufs to NULL, it should set req->nbufs to 0 as well, so we don't have the messy situation of a positive nbufs with no actual bufs.
uv__fs_buf_iter currently sets req->bufs to NULL after it is done, but if the operation fails with EINTR then it will be retried, at which point it expects the bufs to not be NULL, causing a seg fault as in nodejs/node#4291. uv__fs_buf_iter should not set req->bufs to NULL if the operation fails with EINTR. Also, when it sets req->bufs to NULL, it should set req->nbufs to 0 as well, so we don't have the messy situation of a positive nbufs with no actual bufs.
uv__fs_buf_iter currently sets req->bufs to NULL after it is done, but if the operation fails with EINTR then it will be retried, at which point it expects the bufs to not be NULL, causing a seg fault as in nodejs/node#4291. uv__fs_buf_iter should not set req->bufs to NULL if the operation fails with EINTR. Also, when it sets req->bufs to NULL, it should set req->nbufs to 0 as well, so we don't have the messy situation of a positive nbufs with no actual bufs.
uv__fs_buf_iter currently sets req->bufs to NULL after it is done, but if the operation fails with EINTR then it will be retried, at which point it expects the bufs to not be NULL, causing a seg fault as in nodejs/node#4291. uv__fs_buf_iter should not set req->bufs to NULL if the operation fails with EINTR. Also, when it sets req->bufs to NULL, it should set req->nbufs to 0 as well, so we don't have the messy situation of a positive nbufs with no actual bufs. PR-URL: #661 Reviewed-By: Fedor Indutny <fedor@indutny.com>
I believe this should be fixed by libuv update. cc @saghul ;) |
Yeah, the next libuv upgrade includes a fix for this. |
@saghul @nodejs/lts should we backport the patch to LTS? |
I believe we should. |
I'll reserve final judgement until I see the libuv delta, if it's low-impact then that ought to be fine |
Agreed with @rvagg. Also, since we keep backwards API compatibility and a stable ABI, all libuv upgrades will end up on LTS, right? |
I think we had this discussion not long ago, didn't we? I'd lean toward not making a firm rule about it but in general ABI and API compat upgrades in libuv would end up in LTS. If there was a particularly big delta then that may be cause for concern. |
Fixes: nodejs#5737 Fixes: nodejs#4643 Fixes: nodejs#4291 Fixes: nodejs/node-v0.x-archive#8960 Refs: nodejs#3594 PR-URL: nodejs#5994
Fixes: nodejs#5737 Fixes: nodejs#4643 Fixes: nodejs#4291 Fixes: nodejs/node-v0.x-archive#8960 Refs: nodejs#3594 PR-URL: nodejs#5994 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
The process throws "Segmentation fault" if an user resize a window when a script is waiting for user input via TTY, after it accesses to
process.stdout
.For example:
This code above works fine without error.
But, if
process.stdout
is accessed:If a window is resized when the script is waiting for user input, it throws "Segmentation fault".
I tried this code in some versions, and it seems that this issue occurs in v3.3.0+.
v3.2.0 is OK.
v3.3.0 makes this issue occur.
Is this a problem of libuv v1.7.3 ?
The text was updated successfully, but these errors were encountered: