This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
In this code: #include <dlfcn.h> #include <stddef.h> #include <stdio.h> #include "sync.h" volatile clock_t sync_wait; #define ORIG(func) _orig_##func #define QUOTE(nm) #nm // dirty hack #define VOID1P , void* p1 #define VOID2P , void* p1, void* p2 #define INT2P , int p1, int* p2 #define ACTUAL1 , p1 #define ACTUAL2 , p1, p2 #define INSTRUMENT(func, param, actual) \ static int (* ORIG(func))(void* p param) = NULL; \ int func (void * p param) { \ clock_t t = clock(); \ int ret = ORIG(func) (p actual); \ t = clock() - t; \ if(t > 5000) \ sync_wait += t; \ return ret; \ } #define INIT(func) \ ORIG(func) = dlsym(hndl, QUOTE(__##func)) // <<<< hndl is used here INSTRUMENT(pthread_cond_wait, VOID1P, ACTUAL1) INSTRUMENT(pthread_cond_timedwait, VOID2P, ACTUAL2) INSTRUMENT(pthread_mutex_lock, , ) INSTRUMENT(pthread_mutex_setprioceiling, INT2P, ACTUAL2) INSTRUMENT(pthread_rwlock_rdlock, , ) INSTRUMENT(pthread_rwlock_wrlock, , ) int init_sync_tracing() { sync_wait = 0; void* hndl = dlopen("libpthread.so", RTLD_LAZY); // <<<< hndl is marked as unused INIT(pthread_cond_wait); INIT(pthread_cond_timedwait); INIT(pthread_mutex_lock); INIT(pthread_mutex_setprioceiling); INIT(pthread_rwlock_rdlock); INIT(pthread_rwlock_wrlock); return (_orig_pthread_mutex_lock != NULL); } hndl is marked as unused. However it is heavily used in INIT macro.
consider for the next release due to lack of resources
There was no activity on this issue for quite a long time. We apologize that the issue was not addressed so far due to lack of development resources. We might not have time in near future to fix this problem, so it is closed as WONTFIX. If the issue is still critical for you please do not hesitate to REOPEN it. Thank you for using our product and reporting bugs. We are really sorry that we were not able to fix this issue timely. Regards, CND team.