- Jan 23, 2015
-
-
Bryce Harrington authored
-
- Jan 14, 2015
-
-
Marek Chalupa authored
We didn't free the struct client that we got from client_connect() Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
Derek Foreman authored
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
-
Bill Spitzak authored
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
-
Marek Chalupa authored
When a thread is sleeping, waiting until another thread read from the display, it always returns 0. Even when an error occured. In documentation stands: "return 0 on success or -1 on error. In case of error errno will be set accordingly" So this is a fix for this. Along with the read_events, fix a test so that it now complies with this behaviour (and we have this tested) Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
Ryo Munakata authored
Signed-off-by: Ryo Munakata <ryomnktml@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
Carlos Olmedo Escobar authored
Signed-off-by: Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com> Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
-
Srivardhan Hebbar authored
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com> [Pekka Paalanen: minor re-wording.] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
Imran Zaman authored
Signed-off-by: Imran Zaman <imran.zaman@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
Philip Withnall authored
This happens on EOF if using a poll function such as select() or kqueue() which doesn’t distinguish EOF events. Currently execution should never reach the point where recvmsg() returns EOF (len == 0). Instead, epoll() will detect this and indicate EPOLLHUP, which is handled a few lines above, closing the connection. However, other event mechanisms may not be able to distinguish EOF from regular readability (in the case of select()) or inconsistently across platforms (in the case of POLLHUP). There is also the possibility of half-closed connections (shutdown(), POLLRDHUP), though this may not be an issue with Wayland. This will not cause problems if the FD polls as readable but actually is not — in that case, recvmsg() will return EAGAIN. Signed-off-by: Philip Withnall <philip at tecnocode.co.uk> Signed-off-by: Karsten Otto <ottoka at posteo.de> Reviewed-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
Philip Withnall authored
Signed-off-by: Philip Withnall <philip at tecnocode.co.uk> Signed-off-by: Karsten Otto <ottoka at posteo.de> Reviewed-by: David Fort <contact at hardening-consulting.com> Reviewed-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
Philip Withnall authored
It expects ((msg_controllen == 0) == (msg_control == NULL)), and returns EINVAL otherwise. It can't hurt to be tidy about things on other platforms either though. See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=99356#c5 Signed-off-by: Philip Withnall <philip at tecnocode.co.uk> Signed-off-by: Karsten Otto <ottoka at posteo.de> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
Daniel Stone authored
-
- Jan 12, 2015
-
-
Jonas Ådahl authored
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
-
Jonas Ådahl authored
Print the parse error and exit with a failure if expat can't parse the XML. Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
-
- Sep 19, 2014
-
-
Pekka Paalanen authored
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
- Sep 12, 2014
-
-
Pekka Paalanen authored
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
- Sep 11, 2014
-
-
-
Calling wl_display_read_events() after an error should be equivalent to wl_display_cancel_read(), so that display state is consistent. Thanks to Pekka Paalanen <pekka.paalanen@collabora.co.uk> for pointing that out. Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
If wl_connection_read returned EAGAIN, we must wake up sleeping threads. If we don't do this and the thread calling wl_connection_read won't call wl_display_read_events again, the sleeping threads will sleep indefinitely. Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
When wl_connection_read() in wl_display_read_events() returns with EAGAIN, we want the sleeping threads to be woken up. Test it! Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
- Sep 09, 2014
-
-
man usleep says that bahaviour of using usleep with SIGALRM signal is unspecified. So create our own usleep that calls nanosleep instead. Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
- Sep 05, 2014
-
-
Pekka Paalanen authored
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
The shell command for dist_man3_MANS gets invoked several times during the make process but before the man pages have been generated, which causes the following warnings when running `make`: find: `man/man3': No such file or directory find: `man/man3': No such file or directory find: `man/man3': No such file or directory GEN xml/client/index.xml Despite these error messages, the generated dist tarball contains the man3 pages as intended, both before and after this patch. $ make dist $ tar xxf wayland-1.5.90.tar.xz $ find wayland-1.5.90/doc/doxygen/man/man3 -name "wl_*.3" | wc -l 85 Signed-off-by: Bryce Harrington <b.harrington@samsung.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
- Sep 04, 2014
-
-
This function is used in one test only, but its functionality can be used in another tests to (create thread and wait until it is sleeping). We just need to pass the starting function for the thread as an argument. Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
This helper function wraps the always-repeated pattern: display->read_serial++; pthread_cond_broadcast(&display->reader_cond); [Pekka Paalanen: minor whitespace and comment fixes.] Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
Up until now, newly created wl_proxys (with proxy_create or wl_proxy_create_for_id) are not initialized properly after memory allocation. The wl_display object in contrast is. To prevent giving uninitialized data to the user (e.g. user_data) an appropriate memset has been added. Also, after a memset members don't have to be explicitly initialized with zero anymore. Signed-off-by: Nils Chr. Brause <nilschrbrause@googlemail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
- Sep 03, 2014
-
-
Traced down to the server/client target always rebuilding, causing a rebuild of everything else. Rework this so the target name is a file we actually produce and can check for a timestamp. Note: this also changes the generated file from the doxygen directory into the en-US publican path and renames it to (server|client)API.xml.tmp to avoid copying it into the xml output directory.
-
- Aug 22, 2014
-
-
Pekka Paalanen authored
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
This prevents from blocking shown in one display test. Also, it makes sense to not proceed further in the code of the function when an error ocurred. v2. set errno put note about the errno into wl_display_prepare_read doc check for error with mutex locked v3. set errno to display->last_error check for the error only in wl_display_read_events. It's sufficient as prevention for the hanging and programmer doesn't need to check if wl_display_prepare_read (that was previously covered by this patch too) returned an error or the queue just was not empty. Without the check, it could result in indefinite looping. Thanks to Pekka Paalanen <pekka.paalanen@collabora.co.uk> for constant reviewing and discussing this patch. Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
In previous commit we removed unused variables. One of them was pthread_cond_t that was formerly used when reading from display, but later was (erroneously) made unused. This patch fixes this error and is a fix for the failing test introduced few patches ago (tests: test if thread can block on error) Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
The wl_event_queue cond variable has been replaced by the wl_display reader_cond variable (commit 3c7e8bfb). This cond variable is never waited for anymore, just signaled/broadcasted, and thus can be safely removed. The wl_display event_queue_list and link from wl_event_queue can be removed as well, since it was only used to iterate over the event queue list in order to broadcast the now unused cond. No regression on queue unit tests. Signed-off-by: Olivier Blin <olivier.blin@softathome.com> v2: fixed and rebased after 886b09c9 added signed-off-by v3: removed link from wl_event_queue Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
This test shows that it's possible to successfully call wl_display_prepare_read and wl_display_read_events after an error occurred. That may lead to deadlock. When you call prepare read from two threads and then call read_events, one thread gets sleeping. The call from the other thread will return -1 and invokes display_fatal_error, but since we have display->last_error already set, the broadcast is not called and the sleeping thread sleeps indefinitely. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
Test if wl_display_cancel_read wakes up other threads. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
wl_display_read_events() can make a thread wait until some other thread ends reading. Normally it wakes up all threads after the reading is done. But there's a place when it does not get to waking up the threads - when an error occurs. This test reveals bug that can block programs. If a thread is waiting in wl_display_read_events() and another thread calls wl_display_read_events and the reading fails, then the sleeping thread is not woken up. This is because display_handle_error is using old pthread_cond instead of new display->reader_cond, that was added along with wl_display_read_events(). Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
Test posting errors to one and more clients. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
Most of the code of the queue-test is covered by the test compositor, so we can save few lines and use the test compositor instead. I think it's also more readable. This patch removes timeout from the test. We plan to add timeout to all tests later, though. v2. rebased to master Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
This patch introduces a set of functions that can create a display and clients for tests. On server side the user can use functions: display_create() display_destroy() create_client() display_run() display_resume() and on client side the user can use: client_connect() client_disconnect() stop_display() The stop_display() and display_resume() are functions that serve as a barrier and also allow the display to take some action after the display_run() was called, because after the display is stopped, it can run arbitrary code until it calls display_resume(). client_connect() function connects to wayland display and creates a proxy to test_compositor global object, so it can ask for stopping the display later using stop_display(). An example: void client_main() { /* or client can use wl_display_connect(NULL) * and do all the stuff manually */ struct client *c = client_connect(); /* do some stuff, ... */ /* stop the display so that it can * do some other stuff */ stop_display(c, 1); /* ... */ client_disconnect(c); } TEST(dummy_tst) { struct display *d = display_create(); /* set up the display */ wl_global_create(d->wl_display, ...); /* ... */ create_client(d, client_main); display_run(); /* if we are here, the display has been stopped * and we can do some code, i. e. create another global or so */ wl_global_create(d->wl_display, ...); /* ... */ display_resume(d); /* resume display and clients */ display_destroy(d); } v2: added/changed message in few asserts that were not clear fixed codying style issues and typo client_create_with_name: fixed a condition in an assert get_socket_name: use also pid check_error: fix errno -> err [Pekka Paalanen: added test-compositor.h to SOURCES, added WL_HIDE_DEPRECATED to get rid of deprecated defs and lots of warnings, fixed one unchecked return value from write().] Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
- Aug 21, 2014
-
-
display_thread variable is unused since 3c7e8bfb Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
Earlier, the wl_display_dispatch_pending were setting number of thread that can dispatch events. This behaviour was removed later, so now these lines are redundant. Related commits: 385fe30e 78cfa967 3c7e8bfb Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-