https://bugzilla.novell.com/show_bug.cgi?id=637115 https://bugzilla.novell.com/show_bug.cgi?id=637115#c0 Summary: unixodbc unlocks mutexes it did not lock Classification: openSUSE Product: openSUSE 11.4 Version: Factory Platform: x86-64 OS/Version: SLES 11 Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: vandrove@vc.cvut.cz QAContact: qa@suse.de Found By: --- Blocker: --- Created an attachment (id=387572) --> (http://bugzilla.novell.com/attachment.cgi?id=387572) Patch to fix unbalanced locking in 2.2.12 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.127 Safari/533.4 There is couple of places where unixodbc unlocks mutex it did not lock. That causes random hangs, and crashes (assert in pthread_mutex_lock in libc). One symptom is that when multithreaded application using unixODBC is inspected in gdb, mutex_env lock has nusers as a negative number. Reproducible: Always Steps to Reproduce: 1. Run multithreaded app which gets SQL_WITH_INFO error, or calls one of affected APIs and API fails. Actual Results: Observe that nusers is negative. Other threads are not prevented from using protected resource. Expected Results: nusers should be zero. Other threads should not be allowed to use ODBC handle until call hitting error/SQL_SUCCESS_WITH_INFO ends using it. (gdb) print /x *(__pthread_mutex_s *)&mutex_env $4 = {__lock = 0x2, __count = 0x0, __owner = 0x2d3e, __nusers = 0xffffff6c, __kind = 0x0, __spins = 0x0, __list = {__prev = 0x0, __next = 0x0}} (gdb) bt #0 0x00007fea30061645 in raise () from /home/petr/vc/libc.so.6 #1 0x00007fea30062c33 in abort () from /home/petr/vc/libc.so.6 #2 0x00007fea3005a329 in __assert_fail () from /home/petr/vc/libc.so.6 #3 0x00007fea3714cc16 in pthread_mutex_lock () from /home/petr/vc/libpthread.so.0 #4 0x00007fea3772aa41 in SQLEndTran (handle_type=<value optimized out>, handle=0x7fea08ffbb50, completion_type=0) at SQLEndTran.c:421 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.