-
Notifications
You must be signed in to change notification settings - Fork 91
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
crash #104
Comments
06-29 13:58:55.841 12102 12102 F DEBUG : pid: 12097, tid: 12097, name: entry >>> /data/local/tmp/entry <<< |
@enenH Thank you for reporting. My guess is that we need to close the FILE pointers (input_, output_, error_) as well before close the file descriptors directly in close_parent_fds function. Are you comfortable to try this and check again ? My valgrind with fd tracking did not give any issues on ubuntu. Thank you. |
void close_parent_fds() Same problem |
Thanks for trying it. Is the fdsan error exactly the same or is there any difference ? |
Line 1637 in 4025693
This code is causing the crash. The following code works fine. auto f=fdopen(err_rd_pipe, "r"); int read_bytes = util::read_atmost_n(f, err_buf, SP_MAX_ERR_BUF_SIZ); if (f) fclose( f); close(err_rd_pipe); If fdopen() is successful, you must use fclose() to close the stream and file |
Great! If you can open a PR I would be happy to merge it. |
On Android
int main(int argc, char** argv) {
auto obuf = check_output({"ls", "-l"});
printf( "obuf:%s\n", obuf.buf.data());
return 0;
}
fdsan: attempted to close file descriptor 5, expected to be unowned, actually owned by FILE* 0x75c06f90b0
The text was updated successfully, but these errors were encountered: