Commit Graph

2 Commits

Author SHA1 Message Date
Andrey Mazo
46343764d5 unix: fix uv_fs_event_stop() from fs_event_cb
The following changeset
442b8a5a84 "unix: use QUEUE_MOVE when iterating over lists"
introduced a new assert failure:
`queue_foreach_delete` failed: exit code 6
Output from process `queue_foreach_delete`:
run-tests: src/unix/linux-inotify.c:244: uv_fs_event_stop: Assertion `w != ((void *)0)' failed.

Simplest test case for this:
1. create and start two uv_fs_event_t for the same path;
2. in the callback for the first one, call uv_close() on it;
3. assert/segfault while accessing the second uv_fs_event_t from uv__inotify_read().

PR-URL: https://github.com/libuv/libuv/pull/621
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-12-08 10:03:01 +01:00
Andrey Mazo
6060841edc test: test that uv_close() doesn't corrupt QUEUE
The test adds all types of handles, that were known to be affected by
QUEUE_REMOVE()-within-QUEUE_FOREACH() bug, to a loop.
It then calls uv_close() to trigger QUEUE_REMOVE()-within-QUEUE_FOREACH() case
and checks whether a particular QUEUE is corrupted or not.

Restrict the test to Linux only for now as it fails on other platforms
for various reasons.

PR-URL: https://github.com/libuv/libuv/pull/621
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-12-08 10:02:25 +01:00