mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 15:28:30 +00:00
Fix ZipOS deadlock/segfault (#1011)
This change adds a new stress test for ZipOS which helped us improve the locking semantics in open() and close().
This commit is contained in:
parent
897fa6ac00
commit
8a10ccf9c4
4 changed files with 76 additions and 6 deletions
|
@ -58,6 +58,7 @@ static ssize_t __zipos_read_impl(struct ZiposHandle *h, const struct iovec *iov,
|
|||
if (b) memcpy(iov[i].iov_base, h->mem + y, b);
|
||||
}
|
||||
if (opt_offset == -1) {
|
||||
unassert(y != SIZE_MAX);
|
||||
atomic_store_explicit(&h->pos, y, memory_order_release);
|
||||
}
|
||||
return y - x;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue