search for: check_sockets_and_quit_fd

Displaying 7 results from an estimated 7 matches for "check_sockets_and_quit_fd".

2019 Nov 04
3
[PATCH nbdkit 0/3] server: Fix crash on close.
...x7f12b820fa40 (LWP 231456)): #0 0x00007f12b8783a1f in __GI___poll (fds=0x55771f18c550, nfds=nfds at entry=2, timeout=timeout at entry=-1) at ../sysdeps/unix/sysv/linux/poll.c:29 #1 0x00005577156b9646 in poll (__timeout=-1, __nfds=2, __fds=<optimized out>) at /usr/include/bits/poll2.h:46 #2 check_sockets_and_quit_fd (nr_socks=1, socks=0x55771f18c2e0) at sockets.c:466 #3 accept_incoming_connections (socks=0x55771f18c2e0, nr_socks=1) at sockets.c:494 #4 0x00005577156ac6ac in start_serving () at main.c:914 #5 main (argc=<optimized out>, argv=0x7ffd0bcb15d8) at main.c:685 Thread 1 (Thread 0x7f12b820e700...
2019 Sep 05
2
[PATCH nbdkit] Ban use of stack Variable Length Arrays (VLAs).
...(asprintf (&cmd, "rm -rf %s", tmpdir) >= 0) + system (cmd); free (script); } diff --git a/server/sockets.c b/server/sockets.c index 26d65c6..dfaa3ea 100644 --- a/server/sockets.c +++ b/server/sockets.c @@ -366,10 +366,16 @@ accept_connection (int listen_sock) static void check_sockets_and_quit_fd (int *socks, size_t nr_socks) { - struct pollfd fds[nr_socks + 1]; size_t i; int r; + CLEANUP_FREE struct pollfd *fds = + malloc (sizeof (struct pollfd) * (nr_socks+1)); + if (fds == NULL) { + perror ("malloc"); + exit (EXIT_FAILURE); + } + for (i = 0; i < nr_s...
2019 Sep 05
0
Re: [PATCH nbdkit] Ban use of stack Variable Length Arrays (VLAs).
...we ever decided to honor $TMPDIR (that is, creating $TMPDIR/nbdkitshXXXXXX instead of /tmp/nbdkitshXXXXXX), then we'd need shell quoting here. But doesn't change this patch. > +++ b/server/sockets.c > @@ -366,10 +366,16 @@ accept_connection (int listen_sock) > static void > check_sockets_and_quit_fd (int *socks, size_t nr_socks) > { > - struct pollfd fds[nr_socks + 1]; > size_t i; > int r; > > + CLEANUP_FREE struct pollfd *fds = > + malloc (sizeof (struct pollfd) * (nr_socks+1)); This is indeed safer, but adds a malloc() in a loop. Thankfully, the loop of a...
2019 Jan 14
6
[PATCH nbdkit incomplete 0/5] Port to Windows.
This is an incomplete port to Windows. Currently the server compiles and starts up successfully, but goes into an infinite loop when you connect to it. Nevertheless I think the approach is ready for feedback. This being Windows the changes go quite deep. Rich.
2020 Aug 05
5
[PATCH NOT WORKING nbdkit 0/3] python: Allow thread model to be set from Python plugins.
..._thread (datav=0x9ee9b10) at sockets.c:337 #4 0x00007fc4b9d293f9 in start_thread () from /lib64/libpthread.so.0 #5 0x00007fc4b9c55b23 in clone () from /lib64/libc.so.6 Thread 6 (Thread 0x7fc4b96bb200 (LWP 109858)): #0 0x00007fc4b9c4aa2f in poll () from /lib64/libc.so.6 #1 0x0000000000418af3 in check_sockets_and_quit_fd (socks=0x7ffe7d9b3b80) at sockets.c:447 #2 0x0000000000418bd7 in accept_incoming_connections (socks=0x7ffe7d9b3b80) at sockets.c:475 #3 0x000000000040f6c9 in start_serving () at main.c:974 #4 0x000000000040ef8b in main (argc=9, argv=0x7ffe7d9b3de8) at main.c:736 Thread 5 (Thread 0x7fc4a921d640...
2020 Aug 18
15
[PATCH nbdkit 0/9] Port to Windows.
Also available here: https://github.com/rwmjones/nbdkit/tree/2020-windows-mingw This is the port to Windows using native Windows APIs (not MSYS or Cygwin). This patch series is at the point where it basically now works. I can run the server with the memory plugin, and access it remotely using guestfish, creating filesystems and so on without any apparent problems. Nevertheless there are many
2020 Aug 20
15
[PATCH nbdkit 0/13] Port to Windows without using a separate library.
Also available here: https://github.com/rwmjones/nbdkit/tree/2020-windows-mingw-nolib After a lot of work I have made the port to Windows work without using a separate library. Instead, on Windows only, we build an "import library" (library of stubs) which resolves references to nbdkit_* functions in the main program and fixes up the plugin, basically the first technique outlined in