Changes in libcfa/src/interpose.cfa [8bb46d2:43f29f6]
- File:
-
- 1 edited
-
libcfa/src/interpose.cfa (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/interpose.cfa
r8bb46d2 r43f29f6 10 10 // Created On : Wed Mar 29 16:10:31 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 2 13:56:26202313 // Update Count : 1 9112 // Last Modified On : Thu Feb 23 22:50:01 2023 13 // Update Count : 185 14 14 // 15 15 … … 53 53 54 54 static generic_fptr_t interpose_symbol( const char symbol[], const char version[] ) { 55 void * library; 56 #if defined( RTLD_NEXT ) 57 library = RTLD_NEXT; 58 #else 59 library = dlopen( "libc.so.6", RTLD_LAZY ); 55 static void * library; 56 static void * pthread_library; 57 60 58 if ( ! library ) { 59 library = dlopen( "libc.so.6", RTLD_LAZY ); 61 60 const char * error = dlerror(); 62 61 if ( error ) { … … 64 63 } // if 65 64 } // if 66 #endif 65 if ( ! pthread_library ) { 66 pthread_library = dlopen( "libpthread.so", RTLD_LAZY ); 67 const char * error = dlerror(); 68 if ( error ) { 69 abort( "interpose_symbol : failed to open libpthread, %s\n", error ); 70 } // if 71 } // if 67 72 68 73 return do_interpose_symbol(library, symbol, version); … … 103 108 104 109 if(__cfathreadabi_interpose_startup) __cfathreadabi_interpose_startup( do_interpose_symbol ); 105 106 // SKULLDUGGERY: In Ubuntu 22.04, someone augmented signal.h to allow SIGSTKSZ to be "sysconf(_SC_SIGSTKSZ)" in107 // sigstksz.h, as well as 8192 in sigstack.h. HOWEVER, they forgot to provide a mechanism to tell signal.h to108 // use sigstack.h rather than sigstksz.h. (I'm not happy.) By undefining _GNU_SOURCE before signal.h and109 // redefining it afterwards, you can get 8192, but then nothing works correctly inside of signal.h without110 // _GNU_SOURCE defined. So what is needed is a way to get signal.h to use sigstack.h WITH _GNU_SOURCE defined.111 // Basically something is wrong with features.h and its use in signal.h.112 113 #undef SIGSTKSZ114 #define SIGSTKSZ 8192115 110 116 111 // As a precaution (and necessity), errors that result in termination are delivered on a separate stack because … … 278 273 va_start( args, fmt ); 279 274 __abort( false, fmt, args ); 280 // CONTROL NEVER REACHES HERE!275 // CONTROL NEVER REACHES HERE! 281 276 va_end( args ); 282 277 } 283 278 284 279 void abort( bool signalAbort, const char fmt[], ... ) { 285 va_list args;286 va_start( args, fmt );287 __abort( signalAbort, fmt, args );288 // CONTROL NEVER REACHES HERE!289 va_end( args );280 va_list args; 281 va_start( args, fmt ); 282 __abort( signalAbort, fmt, args ); 283 // CONTROL NEVER REACHES HERE! 284 va_end( args ); 290 285 } 291 286
Note:
See TracChangeset
for help on using the changeset viewer.