Commit Graph

3 Commits

Author SHA1 Message Date
Nhan Khong
faa800605e
test: fix gcc 8 warnings for tests
In test-ipc.c, remove unnecessarily casting uv_stream_s to
uv_pipe_s that makes gcc complain about stric-aliasing
(-Wstrict-aliasing).

In test-queue-foreach-delete.c, using C99 variadic macros
to fix a gcc 8 warnings (-Wcast-function-type).

PR-URL: https://github.com/libuv/libuv/pull/2344
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-08-06 12:01:15 -04:00
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