Home > pthread mutex destroy error > pthread_mutex_destroy error code 16

Pthread_mutex_destroy Error Code 16

Contents

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about pthread_mutex_destroy example Stack Overflow the company Business Learn more about hiring developers or posting ads with pthread_mutex_destroy ebusy us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is pthread_mutex_destroy error 16 a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up pthread_mutex_destroy: why is it returning EBUSY? up vote 1 down vote favorite I'm pthread_mutex_destroy necessary stepping through some code in a third party library that our executable is linked to, specifically the "shutdown" code. I'm sending a SIGQUIT to our application, which shuts down the third party objects. For some reason, reliably a call that library is making to pthread_mutex_destroy fails and returns a 16: EBUSY. The documentation says this occurs when "the implementation has detected an attempt to destroy the object referenced by mutex

Pthread_cond_destroy

while it is locked or referenced (for example, while being used in a pthread_cond_timedwait() or pthread_cond_wait()) by another thread." I've put a breakpoint right where the pthread_mutex_destroy() gets called. a) I don't believe it is locked, since the mutex's state looks like this: $6 = {__data = {__lock = 0, __count = 0, __owner = 0, __nusers = 4294967293, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' "\375, \377\377\377", '\000' , __align = 0} And my guess is that __lock = 0 means "unlocked". However, I don't know what __nusers really represents. b) I don't see any evidence of pthread_cond_wait() or pthread_cond_timedwait(). I got backtraces of all threads running and none were waiting on this mutex. What could be going on here? c++ linux multithreading posix share|improve this question asked May 20 '14 at 2:44 vmayer 332211 1 I don't suppose you setup a signal-handling thread as opposed to the implementation just picking its own ? –WhozCraig May 20 '14 at 3:01 Yes, we do have a signal handling thread. I'm not following, though. Our signal handling thread is what prompts all of this shutdown logic to occur. Does this imply something about why I'm get

destroy and initialize a mutex SYNOPSIS [THR]

Pthread Mutex Example

src="../images/opt-start.gif" alt= "[Option Start]" border="0"> #include <pthread.h>

pthread_mutex_initializer vs pthread_mutex_init int pthread_mutex_destroy(pthread_mutex_t *
mutex);
int pthread_mutex_init(pthread_mutex_t *restrict
mutex,
const pthread_mutexattr_t *restrict
attr);
pthread_mutex_t
pthread_mutex_init example in c mutex = PTHREAD_MUTEX_INITIALIZER; [Option End] DESCRIPTION The pthread_mutex_destroy() function shall destroy the mutex object referenced by mutex; http://stackoverflow.com/questions/23750213/pthread-mutex-destroy-why-is-it-returning-ebusy the mutex object becomes, in effect, uninitialized. An implementation may cause pthread_mutex_destroy() to set the object referenced by mutex to an invalid value. A destroyed mutex object can be reinitialized using pthread_mutex_init(); the results of otherwise referencing the object after it has been http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_mutex_destroy.html destroyed are undefined. It shall be safe to destroy an initialized mutex that is unlocked. Attempting to destroy a locked mutex results in undefined behavior. The pthread_mutex_init() function shall initialize the mutex referenced by mutex with attributes specified by attr. If attr is NULL, the default mutex attributes are used; the effect shall be the same as passing the address of a default mutex attributes object. Upon successful initialization, the state of the mutex becomes initialized and unlocked. Only mutex itself may be used for performing synchronization. The result of referring to copies of mutex in calls to pthread_mutex_lock(), pthread_mutex_trylock(), pthread_mutex_unlock(), and pthread_mutex_destroy() is undefined. Attempting to initialize an already initialized mutex results in undefined behavior. In cases where default mutex attributes are appropriate, the macro PTHREAD_MUTEX_INITIALIZER can

Login: [x] Format For Printing -XML -Clone This Bug -Last Comment First https://bugzilla.redhat.com/show_bug.cgi?id=113588 Last Prev Next This bug is not in your last search results. Bug113588 - NPTL pthread_mutex_destroy return EBUSY even if mutex is not locked... Summary: NPTL http://tracker.firebirdsql.org/browse/CORE-2891 pthread_mutex_destroy return EBUSY even if mutex is not locked... Status: CLOSED NOTABUG Aliases: None Product: Red Hat Enterprise Linux 3 Classification: Red Hat Component: kernel (Show other pthread_mutex_destroy error bugs) Sub Component: --- Version: 3.0 Hardware: All Linux Priority medium Severity medium TargetMilestone: --- TargetRelease: --- Assigned To: Arjan van de Ven QA Contact: Brian Brock Docs Contact: URL: Whiteboard: Keywords: Depends On: Blocks: Show dependency tree /graph Reported: 2004-01-15 11:39 EST by Umesh R. Patil Modified: 2007-11-30 17:07 EST pthread_mutex_destroy error code (History) CC List: 5 users (show) drepper.fsp petrides riel roland upatil See Also: Fixed In Version: Doc Type: Bug Fix Doc Text: Story Points: --- Clone Of: Environment: Last Closed: 2004-01-15 12:55:37 EST Type: --- Regression: --- Mount Type: --- Documentation: --- CRM: Verified Versions: Category: --- oVirt Team: --- RHEL 7.3 requirements from Atomic Host: Cloudforms Team: --- Attachments (Terms of Use) Add an attachment (proposed patch, testcase, etc.) Groups: None (edit) Description Umesh R. Patil 2004-01-15 11:39:08 EST From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030922 Description of problem: pthread_mutex_destroy should return EBUSY if the mutex being destroyed is currently locked. If ptread_mutex_unlock is called without calling pthread_mutex_lock, pthread_mutex_destroy in NPTL returns EBUSY. This scenario can happen in cleanup handlers where a mutex is being unlocked when a thread exits. Version-Release number of selected component (if applicable): glibc-2.3.2-95.6, kernel-2.4.21-4.EL, RHE ES 3.0, gcc-3.2.3-20 How reproducible: Always Steps to Reproduce: 1. prog.c: #in

Watchers: 1 Operations If you were logged in you would be able to see more operations. Firebird Core Operating system call pthread_mutex_destroy failed. Error code 16 in Firebird.log Created: 26/Feb/10 11:52 AM Updated: 20/Aug/15 01:31 PM Component/s: Engine Affects Version/s: 2.5 RC2 Fix Version/s: None Environment: « Hide 64b linux redhat /2.6.18-164.el5 Show » 64b linux redhat /2.6.18-164.el5 Description « Hide Hi all, First , congrats on 2.5 getting ready for Release. 1) I must always ask a root user to install/deinstall in this case: "FirebirdCS-2.5.0.25920-ReleaseCandidate2.amd64.rpm" then all in "/opt/firebird/" was owned by root. (prev. version all was automatically owned by "firebird" accept SYSDBA.password file may some other stuff) so i had it changed to be used by user "firebird" then i could run as "firebird" user. 2) So far the database is working oke in terms of DSQL/PSQL. 3) Here is the problem: firebird.log shows strange errors eusdlsdbb024.logistics.corp Fri Feb 26 11:46:52 2010 Operating system call pthread_mutex_destroy failed. Error code 16 eusdlsdbb024.logistics.corp Fri Feb 26 11:46:52 2010 Fatal lock manager error: semop failed (release_shmem), errno: 11 eusdlsdbb024.logistics.corp Fri Feb 26 11:46:52 2010 Shutting down the server with 1 active connection(s) to 1 database(s), 0 active service(s) eusdlsdbb024.logistics.corp Fri Feb 26 11:46:57 2010 Firebird shutdown is still in progress after the specified timeout clearly someting is gooing wrong.. cheers, Derryck Description Hi all, First , congrats on 2.5 getting ready for Release. 1) I must always ask a root user to install/deinstall in this case: "FirebirdCS-2.5.0.25920-ReleaseCandidate2.amd64.rpm" then all in "/opt/firebird/" was owned by root. (prev. version all was automatically owned by "firebird" accep

 

Related content

pthread_mutex_destroy error

Pthread mutex destroy Error table id toc tbody tr td div id toctitle Contents div ul li a href Pthread mutex destroy Ebusy a li li a href Pthread cond destroy a li li a href Pthread mutex init Example In C a li ul td tr tbody table p destroy and relatedl initialize a mutex SYNOPSIS tt sup a href javascript open code 'THR' THR a sup pthread mutex destroy example img src images opt-start gif alt Option Start border include a p h id Pthread mutex destroy Ebusy p href basedefs pthread h html pthread h a br

pthread_mutex_destroy error codes

Pthread mutex destroy Error Codes table id toc tbody tr td div id toctitle Contents div ul li a href Pthread mutex destroy Example a li li a href Pthread mutex destroy Error a li li a href Pthread mutex initializer Vs Pthread mutex init a li li a href Pthread mutex t Mutex a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you relatedl might have Meta Discuss the workings and policies of p h id Pthread mutex destroy Example p this site About Us

pthread_mutex_destroy error 16

Pthread mutex destroy Error table id toc tbody tr td div id toctitle Contents div ul li a href Pthread mutex destroy Ebusy a li li a href Pthread cond destroy a li li a href Pthread mutex t Struct a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta relatedl Discuss the workings and policies of this site About pthread mutex destroy example Us Learn more about Stack Overflow the company Business Learn more about hiring p h id Pthread mutex destroy