Fix some bugs

- addr2line backtrace should continue on eintr
- lua crashes if we try to iterate a non-table
This commit is contained in:
Justine Tunney 2022-04-27 20:18:34 -07:00
parent 6a145a9262
commit cc0d1ec076
3 changed files with 22 additions and 10 deletions

View file

@ -116,7 +116,17 @@ static int PrintBacktraceUsingAddr2line(int fd, const struct StackFrame *bp) {
_exit(127);
}
close(pipefds[1]);
while ((got = read(pipefds[0], buf, kBacktraceBufSize)) > 0) {
for (;;) {
got = read(pipefds[0], buf, kBacktraceBufSize);
if (!got) break;
if (got == -1 && errno == EINTR) {
errno = 0;
continue;
}
if (got == -1) {
kprintf("error reading backtrace %m\n");
break;
}
p1 = buf;
p3 = p1 + got;
/*