search for: pthread_rwlock_wrlock

Displaying 20 results from an estimated 21 matches for "pthread_rwlock_wrlock".

2019 Mar 18
2
[PATCH nbdkit] wrapper: Set MALLOC_CHECK=1 and MALLOC_PERTURB_ (randomly).
This is a cheap way to find some use-after-free and uninitialized read problems when using glibc. This in fact reveals a race during filter shutdown (which this commit does not fix): Thread 2 (Thread 0x7f1caaa5ffc0 (LWP 7223)): #0 0x00007f1cab0a05f8 in pthread_rwlock_wrlock () from /lib64/libpthread.so.0 #1 0x0000000000408842 in lock_unload () at locks.c:97 #2 0x00000000004066ff in filter_free (b=0x203c330) at filters.c:77 #3 0x000000000040a6f4 in main (argc=11, argv=0x7ffc1f4486e8) at main.c:649 Thread 1 (Thread 0x7f1caaa5e700 (LWP 7226)): #0 0x000000000040...
2019 Apr 24
0
[nbdkit PATCH 1/4] server: Check for pthread lock failures
...thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS) - pthread_mutex_unlock (&all_requests_lock); + if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS && + pthread_mutex_unlock (&all_requests_lock)) + abort (); } void lock_unload (void) { - pthread_rwlock_wrlock (&unload_prevention_lock); + if (pthread_rwlock_wrlock (&unload_prevention_lock)) + abort (); } void unlock_unload (void) { - pthread_rwlock_unlock (&unload_prevention_lock); + if (pthread_rwlock_unlock (&unload_prevention_lock)) + abort (); } -- 2.20.1
2018 Jan 17
0
[PATCH 1/9] plugins: Move locking to a new file.
..."); + pthread_mutex_unlock (connection_get_request_lock (conn)); + } + + if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS) { + debug ("release global request lock"); + pthread_mutex_unlock (&all_requests_lock); + } +} + +void +lock_unload (void) +{ + pthread_rwlock_wrlock (&unload_prevention_lock); +} + +void +unlock_unload (void) +{ + pthread_rwlock_unlock (&unload_prevention_lock); +} diff --git a/src/plugins.c b/src/plugins.c index 9b5d2d5..b7ab43d 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -46,10 +46,6 @@ #include "nbdkit-plugin.h" #i...
2018 Jan 16
0
[PATCH nbdkit 1/3] plugins: Move locking to a new file.
..."); + pthread_mutex_unlock (connection_get_request_lock (conn)); + } + + if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS) { + debug ("release global request lock"); + pthread_mutex_unlock (&all_requests_lock); + } +} + +void +lock_unload (void) +{ + pthread_rwlock_wrlock (&unload_prevention_lock); +} + +void +unlock_unload (void) +{ + pthread_rwlock_unlock (&unload_prevention_lock); +} diff --git a/src/plugins.c b/src/plugins.c index 9b5d2d5..b7ab43d 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -46,10 +46,6 @@ #include "nbdkit-plugin.h" #i...
2023 Feb 22
1
[PATCH nbdkit] curl: Try to share as much as possible between handles in the pool
...lock_cb (CURL *handle, curl_lock_data data, curl_lock_access access, + void *userptr) +{ + assert (data < ARRAY_SIZE (lockarray)); + + switch (access) { + case CURL_LOCK_ACCESS_SHARED: + pthread_rwlock_rdlock (&lockarray[data]); + break; + case CURL_LOCK_ACCESS_SINGLE: + pthread_rwlock_wrlock (&lockarray[data]); + break; + default: + /* CURL_LOCK_ACCESS_NONE is never used in the current libcurl code. */ + abort (); + } +} + +static void +unlock_cb (CURL *handle, curl_lock_data data, void *userptr) +{ + assert (data < ARRAY_SIZE (lockarray)); + + pthread_rwlock_unlock...
2019 Mar 18
0
Re: [PATCH nbdkit] wrapper: Set MALLOC_CHECK=1 and MALLOC_PERTURB_ (randomly).
...: > This is a cheap way to find some use-after-free and uninitialized read > problems when using glibc. > > This in fact reveals a race during filter shutdown (which this > commit does not fix): > > Thread 2 (Thread 0x7f1caaa5ffc0 (LWP 7223)): > #0 0x00007f1cab0a05f8 in pthread_rwlock_wrlock () from /lib64/libpthread.so.0 > #1 0x0000000000408842 in lock_unload () at locks.c:97 > #2 0x00000000004066ff in filter_free (b=0x203c330) at filters.c:77 Do we need some sort of pthread_join() in filter_free() to allow... > #3 0x000000000040a6f4 in main (argc=11, argv=0x7ffc1f448...
2017 Nov 14
0
[PATCH 2/3] Avoid race conditions when nbdkit exits.
..._RWLOCK_INITIALIZER; /* Maximum read or write request that we will handle. */ #define MAX_REQUEST_SIZE (64 * 1024 * 1024) @@ -155,6 +156,11 @@ void plugin_cleanup (void) { if (dl) { + /* Acquiring this lock prevents any plugin callbacks from running + * simultaneously. + */ + pthread_rwlock_wrlock (&unload_prevention_lock); + debug ("%s: unload", filename); if (plugin.unload) plugin.unload (); @@ -163,6 +169,8 @@ plugin_cleanup (void) dl = NULL; free (filename); filename = NULL; + + pthread_rwlock_unlock (&unload_prevention_lock); } }...
2023 Feb 22
2
[PATCH nbdkit] curl: Try to share as much as possible between handles in the pool
I'm mainly posting this to the list as a back-up. It does work, it does _not_ improve performance in any noticable way. However I'm having lots of trouble getting HTTP/2 to work (with or without this patch) and that's stopping me from testing anything properly. Rich.
2023 Feb 22
1
[PATCH nbdkit] curl: Try to share as much as possible between handles in the pool
...ock_access access, > + void *userptr) > +{ > + assert (data < ARRAY_SIZE (lockarray)); > + > + switch (access) { > + case CURL_LOCK_ACCESS_SHARED: > + pthread_rwlock_rdlock (&lockarray[data]); > + break; > + case CURL_LOCK_ACCESS_SINGLE: > + pthread_rwlock_wrlock (&lockarray[data]); > + break; we could at least assert the return values > + default: > + /* CURL_LOCK_ACCESS_NONE is never used in the current libcurl code. */ > + abort (); > + } > +} > + > +static void > +unlock_cb (CURL *handle, curl_lock_data data,...
2019 Apr 24
7
[nbdkit PATCH 0/4] More mutex sanity checking
I do have a question about whether patch 2 is right, or whether I've exposed a bigger problem in the truncate (and possibly other) filter, but the rest seem fairly straightforward. Eric Blake (4): server: Check for pthread lock failures truncate: Factor out reading real_size under mutex plugins: Check for mutex failures filters: Check for mutex failures filters/cache/cache.c
2017 Nov 14
7
[PATCH 0/3] Alternate way to avoid race conditions when nbdkit exits.
This fixes the race conditions for me, using the test described here: https://www.redhat.com/archives/libguestfs/2017-September/msg00226.html Rich.
2012 Sep 24
0
[LLVMdev] llvm-config!
Reza Sheykhi <hajishey at msu.edu> writes: > I got the following answers: > > which perl > /usr/bin/perl > > which llvm-config > /usr/local/bin/llvm-config > > which llvm-as > /usr/local/bin/llvm-as > > /usr/bin/llvm-confing --version > bash: /usr/bin/llvm-confing: No such file or directory Uh, there is a typo on the command above, it should be
2012 Sep 24
2
[LLVMdev] llvm-config!
I got the following answers: which perl /usr/bin/perl which llvm-config /usr/local/bin/llvm-config which llvm-as /usr/local/bin/llvm-as /usr/bin/llvm-confing --version bash: /usr/bin/llvm-confing: No such file or directory /usr/local/bin/llvm-config --version 2.8 Quoting Óscar Fuentes <ofv at wanadoo.es>: > Reza Sheykhi <hajishey at msu.edu> writes: > >> Thank you
2018 Jan 16
4
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend
v1 -> v2: - Fixed everything mentioned in the review. Rich.
2018 Jan 16
6
[PATCH nbdkit 0/3] Refactor plugin_* functions into a backend struct.
Somewhat invasive but mostly mechanical change to how plugins are called. This patch is in preparation for adding a second backend subtype for filters. Rich.
2017 Jan 23
2
undefined symbols during linking LLDB 4.0 RC1
...e _ZNSt3__115__get_classnameEPKcb 0000000000000000 DF *UND* 0000000000000030 GLIBC_2.2.5 toupper 0000000000000000 DF *UND* 000000000000000f Base _ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev 0000000000000000 DF *UND* 00000000000000af GLIBC_2.2.5 pthread_rwlock_wrlock 0000000000000000 DF *UND* 000000000000000a GLIBC_2.2.5 pthread_self 0000000000000000 DF *UND* 000000000000001f Base _ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev 0000000000000000 DF *UND* 00000000000000e5 Base _ZNSt3__113basic_ostreamIcNS_11char_traitsI...
2017 Jan 19
2
undefined symbols during linking LLDB 4.0 RC1
Hello, I update my building scripts to build LLVM 4.0 RC1 (with clang, lldb, libc++, libc++abi, lld) on CentOS 6 and I got a lot of undefined symbols during linking LLDB. I'm using clang-3.9 and this configuration: -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++
2018 Jan 17
14
[PATCH 0/9] Add filters to nbdkit.
The first three patches are identical to: https://www.redhat.com/archives/libguestfs/2018-January/msg00079.html "[PATCH nbdkit v2 0/3] Refactor plugin_* functions into a backend" The rest of the patches add filters using the new filter API previously described here: https://www.redhat.com/archives/libguestfs/2018-January/msg00073.html This needs a lot more testing -- and tests --
2017 Aug 01
2
[RFC] Profile guided section layout
...elf13OutputSection10addSectionEPNS0_12InputSectionE res_thread_freeres 108 _ZN3lld3elf13OutputSection10addSectionEPNS0_12InputSectionE _ZdlPv 106 _ZN4llvm12PassRegistryD2Ev _ZdlPv 105 _ZN4llvm3sys11RWMutexImpl14writer_releaseEv __pthread_rwlock_unlock 105 _ZN4llvm3sys11RWMutexImpl14writer_acquireEv pthread_rwlock_wrlock 104 _ZN4llvm12PassRegistryD2Ev __cfree 104 __pthread_once_slow __once_proxy 104 __pthread_once_slow _pthread_cleanup_pop 104 __pthread_once_slow _pthread_cleanup_push 104 __pthread_once __pthread_once_slow 104 _ZNK4llvm12DenseMapBaseINS_8DenseMapINS_9StringRefENS_6detail13DenseSetEmptyENS_12DenseMa...
2017 Jul 31
2
[RFC] Profile guided section layout
A rebased version of the lld patch is attached. Cheers, Rafael On 31 July 2017 at 15:11, Rafael Avila de Espindola <rafael.espindola at gmail.com> wrote: > Tobias Edler von Koch <tobias at codeaurora.org> writes: > >> Hi Rafael, >> >> On 07/31/2017 04:20 PM, Rafael Avila de Espindola via llvm-dev wrote: >>> However, do we need to start with