search for: pthread_setspecific

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

Did you mean: pthread_getspecific
2023 Mar 08
2
[libnbd PATCH v2] lib/errors.c: Fix assert fail in exit path in multi-threaded code
...id *vp) static struct last_error * allocate_last_error_on_demand (void) { - struct last_error *last_error = pthread_getspecific (errors_key); + struct last_error *last_error = NULL; - if (!last_error) { - last_error = calloc (1, sizeof *last_error); - if (last_error) { - int err = pthread_setspecific (errors_key, last_error); - if (err != 0) { - /* This is not supposed to happen (XXX). */ - fprintf (stderr, "%s: %s: %s\n", "libnbd", "pthread_setspecific", - strerror (err)); + if (key_use_count) { + last_error = pthread_getspec...
2023 Mar 09
1
[PATCH libnbd v3] lib/errors.c: Fix assert fail in exit path in multi-threaded code
...(3) Another thread which is still running also encounters an error, > and inside libnbd the library calls set_error(). > > (4) The call to set_error() calls pthread_getspecific which returns > NULL (since the key has already been destroyed in step (2)), and this > causes us to call pthread_setspecific which returns EINVAL because > glibc is able to detect invalid use of a pthread_key_t after it has > been destroyed. In any case, the error message is lost, and any > subsequent call to nbd_get_error() will return NULL. > > (5) We enter the %DEAD state, where there is an assertion...
2023 Mar 08
2
[PATCH libnbd] lib/errors.c: Fix assert fail in exit path in multi-threaded code
...alls pthread_key_delete. (3) Another thread which is still running also encounters an error, and inside libnbd the library calls set_error(). (4) The call to set_error() calls pthread_getspecific which returns NULL (since the key has already been destroyed in step (2)), and this causes us to call pthread_setspecific which returns EINVAL because glibc is able to detect invalid use of a pthread_key_t after it has been destroyed. In any case, the error message is lost, and any subsequent call to nbd_get_error() will return NULL. (5) We enter the %DEAD state, where there is an assertion that nbd_get_error() is n...
2023 Mar 09
2
[PATCH libnbd v3] lib/errors.c: Fix assert fail in exit path in multi-threaded code
...alls pthread_key_delete. (3) Another thread which is still running also encounters an error, and inside libnbd the library calls set_error(). (4) The call to set_error() calls pthread_getspecific which returns NULL (since the key has already been destroyed in step (2)), and this causes us to call pthread_setspecific which returns EINVAL because glibc is able to detect invalid use of a pthread_key_t after it has been destroyed. In any case, the error message is lost, and any subsequent call to nbd_get_error() will return NULL. (5) We enter the %DEAD state, where there is an assertion that nbd_get_error() is n...
2008 May 22
0
[PATCH] stubdom: fix and clean pthread minimal support
...t; -typedef struct {} pthread_mutex_t, pthread_once_t; +typedef struct { + void *ptr; +} *pthread_key_t; +static inline int pthread_key_create(pthread_key_t *key, void (*destr_function)(void*)) +{ + *key = malloc(sizeof(**key)); + (*key)->ptr = NULL; + return 0; +} +static inline int pthread_setspecific(pthread_key_t key, const void *pointer) +{ + key->ptr = (void*) pointer; + return 0; +} +static inline void *pthread_getspecific(pthread_key_t key) +{ + return key->ptr; +} +static inline int pthread_key_delete(pthread_key_t key) +{ + free(key); + return 0; +} + + + +typedef st...
2007 Sep 17
2
Compiling mod_webauth on CentOS 5 - krb dependency failure
...no checking for library containing res_search... no checking for library containing __res_search... -lresolv checking for library containing crypt... -lcrypt checking for krb5_init_context in -lkrb5... no checking for krb5int_getspecific in -lkrb5support... no checking for library containing pthread_setspecific... -lpthread checking for krb5int_setspecific in -lkrb5support... no checking for krb5_cc_default in -lkrb5... no configure: error: cannot find usable Kerberos v5 library [root at localhost webauth-3.5.4]# However, when I search via rpm, I see: [root at localhost webauth-3.5.4]# rpm -q...
2023 Mar 09
1
[PATCH libnbd v4] lib/errors.c: Fix assert fail in exit path in multi-threaded code
...(3) Another thread which is still running also encounters an error, > and inside libnbd the library calls set_error(). > > (4) The call to set_error() calls pthread_getspecific which returns > NULL (since the key has already been destroyed in step (2)), and this > causes us to call pthread_setspecific which returns EINVAL because > glibc is able to detect invalid use of a pthread_key_t after it has > been destroyed. In any case, the error message is lost, and any > subsequent call to nbd_get_error() will return NULL. > > (5) We enter the %DEAD state, where there is an assertion...
2020 May 07
1
[PATCH nbdkit] vddk: Suppress errors in can_extents test (RHBZ#1709211).
...e thread-local error_suppression pointer is non-NULL (we don't + * care about the actual value) then we will suppress error messages + * from VDDK in this thread. + */ +static void +set_error_suppression (void) +{ + static const int one = 1; /* Something that gives us a non-NULL pointer. */ + pthread_setspecific (error_suppression, &one); +} + +static void +clear_error_suppression (void) +{ + pthread_setspecific (error_suppression, NULL); +} + +static bool +are_errors_suppressed (void) +{ + return pthread_getspecific (error_suppression) != NULL; +} + /* Turn error messages from the library into nbdk...
2023 Mar 09
1
[PATCH libnbd v4] lib/errors.c: Fix assert fail in exit path in multi-threaded code
...alls pthread_key_delete. (3) Another thread which is still running also encounters an error, and inside libnbd the library calls set_error(). (4) The call to set_error() calls pthread_getspecific which returns NULL (since the key has already been destroyed in step (2)), and this causes us to call pthread_setspecific which returns EINVAL because glibc is able to detect invalid use of a pthread_key_t after it has been destroyed. In any case, the error message is lost, and any subsequent call to nbd_get_error() will return NULL. (5) We enter the %DEAD state, where there is an assertion that nbd_get_error() is n...
2023 Mar 09
1
[PATCH libnbd v3] lib/errors.c: Fix assert fail in exit path in multi-threaded code
This version simply removes the call to pthread_key_destroy. It fixes the problem and allows us to leave the asserts alone so we can still catch real errors. Of course this leaks pthread_key_t in the case where you dlclose() the library. glibc has a limit of 128 thread-specific keys (and the first 32 are somehow "fast" in a way I could quite follow), so that's a thing. Rich.
2007 Jul 29
0
Asterisk 1.4.X support for Solaris 10?
...s + offset + 1; if (!(*buf = ast_realloc(*buf, (*buf)->len + sizeof(*(*buf))))) return AST_DYNSTR_BUILD_FAILED; if (append) (*buf)->str[offset] = '\0'; if (ts) { pthread_setspecific(ts->key, *buf); #if defined(DEBUG_THREADLOCALS) __ast_threadstorage_object_replace(old_buf, *buf, (*buf)->len + sizeof(*(*buf))); #endif /* defined(DEBUG_THREADLOCALS) */ } /* va_end() and va_start() must be done before calling...
2012 Sep 04
1
Repeated Asterisk 10.7.0 crashes
I'm getting cycles of repeated crashes which occur and then stop occurring. Looking at the dumps via gdb shows that something peculiar is happening that looks like memory corruption: Program terminated with signal 6, Aborted. #0 0x0000003686e30285 in raise () from /lib64/libc.so.6 (gdb) up #1 0x0000003686e31d30 in abort () from /lib64/libc.so.6 (gdb) up #2 0x0000003686e6971b in
2011 Jan 04
2
[LLVMdev] LLVM for ARM target
...__gthrw_pthread_once' ../../llvm-gcc/gcc/gthr-posix.h:93: error: `pthread_getspecific' undeclared here (not in a function) ../../llvm-gcc/gcc/gthr-posix.h:93: warning: type defaults to `int' in declarati on of `__gthrw_pthread_getspecific' ../../llvm-gcc/gcc/gthr-posix.h:94: error: `pthread_setspecific' undeclared here (not in a function) ../../llvm-gcc/gcc/gthr-posix.h:94: warning: type defaults to `int' in declarati on of `__gthrw_pthread_setspecific' ../../llvm-gcc/gcc/gthr-posix.h:95: error: `pthread_create' undeclared here (not in a function) ../../llvm-gcc/gcc/gthr-posix.h:9...
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
2011 Jan 02
0
[LLVMdev] LLVM for ARM target
On Jan 1, 2011, at 8:29 PM, akramul azim wrote: > Hi, > I am planning to follow the steps to install LLVM for the ARM-target (Processor: Xscale, Architecture: armv5te): > > 1. Install binutils-2.21 (downloaded from gnu.org) > > Steps: > > $ ./configure --target=arm-unknown-linux-gnueabi --program-prefix=arm- --prefix > =/llvm/arm
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
2011 Jan 02
3
[LLVMdev] LLVM for ARM target
Hi,     I am planning to follow the steps to install LLVM for the ARM-target (Processor: Xscale, Architecture: armv5te):   1. Install binutils-2.21 (downloaded from gnu.org)   Steps:   $ ./configure --target=arm-unknown-linux-gnueabi --program-prefix=arm- --prefix =/llvm/arm --with-sysroot=/llvm/arms/sys-root   $ make   $ make install   2. Install LLVM   Steps   $ ../llvm-src/configure
2017 Jan 23
2
undefined symbols during linking LLDB 4.0 RC1
...000000000006a GLIBC_2.2.5 srand 0000000000000000 DF *UND* 00000000000000cd Base tigetnum 0000000000000000 DF *UND* 0000000000000064 GLIBC_2.2.5 pread 0000000000000000 DF *UND* 0000000000000025 GLIBC_2.2.5 getpgid 0000000000000000 DF *UND* 00000000000000fc GLIBC_2.2.5 pthread_setspecific 0000000000000000 DF *UND* 0000000000000098 GLIBC_2.2.5 popen 0000000000000000 DF *UND* 0000000000000086 GLIBC_2.2.5 strsep 0000000000000000 DF *UND* 000000000000000f Base __cxa_pure_virtual 0000000000000000 DF *UND* 000000000000005e GLIBC_2.2.5 connect 000000000000000...
2014 Nov 03
8
[LLVMdev] [PATCH] Protection against stack-based memory corruption errors using SafeStack
...ly +#define __DECLARE_WRAPPER(fn) __typeof__(fn)* __d_ ## fn = NULL; + +__DECLARE_WRAPPER(pthread_attr_init) +__DECLARE_WRAPPER(pthread_attr_destroy) +__DECLARE_WRAPPER(pthread_attr_getstacksize) +__DECLARE_WRAPPER(pthread_attr_getguardsize) +__DECLARE_WRAPPER(pthread_key_create) +__DECLARE_WRAPPER(pthread_setspecific) + +// The unsafe stack pointer is stored in the TCB structure on these platforms +#if defined(__i386__) +# define MOVPTR "movl" +# ifdef __pic__ +# define IMM_MODE "nr" +# else +# define IMM_MODE "ir" +# endif +#elif defined(__x86_64__) +# define MOVPTR "movq&q...
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++