[ 
https://issues.apache.org/jira/browse/TS-3156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryo Okubo updated TS-3156:
--------------------------
    Attachment: fix-MutexLock.patch

The cause of above issue is probably calling pthread_mutex_lock()  for 
destroyed mutex lock.

If a variable of ProxyMutex* is passed to MUTEX_LOCK(), it's destroyed when 
leaving that scope. For example, pthread_mutex_destroy() is called in 
MakeHttpProxyAcceptor():
{noformat}
(gdb) bt
#0  0x00007ffff7830e70 in pthread_mutex_destroy () from /lib64/libpthread.so.0
#1  0x00000000004e03da in ink_mutex_destroy (m=0xac7890) at 
../lib/ts/ink_mutex.h:87
#2  0x00000000004e15c2 in ProxyMutex::free (this=0xac7880) at 
../iocore/eventsystem/I_Lock.h:543
#3  0x00000000004e2f39 in Ptr<ProxyMutex>::~Ptr (this=0x7fffffffe3b0, 
__in_chrg=<value optimized out>) at ../lib/ts/Ptr.h:393
#4  0x0000000000520f17 in MutexLock::~MutexLock (this=0x7fffffffe3b0, 
__in_chrg=<value optimized out>) at ../iocore/eventsystem/I_Lock.h:465
#5  0x00000000005cea60 in MakeHttpProxyAcceptor (acceptor=..., port=..., 
nthreads=1) at HttpProxyServerMain.cc:230
#6  0x00000000005cec45 in init_HttpProxyServer (n_accept_threads=1) at 
HttpProxyServerMain.cc:270
#7  0x000000000052aded in main (argv=0x7fffffffe7a8) at Main.cc:1554
{noformat}

I tried to replace ProxyMutex* with Ptr<ProxyMutex>. It looks to work fine. 
@Powell, what do you think about fix-MutexLock.patch?

> Mutex[Try]Lock bool() operator change and unused API removal
> ------------------------------------------------------------
>
>                 Key: TS-3156
>                 URL: https://issues.apache.org/jira/browse/TS-3156
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Powell Molleti
>            Assignee: James Peach
>            Priority: Minor
>              Labels: review
>             Fix For: 5.2.0
>
>         Attachments: MutexLock-ats.patch, MutexLock-ats.patch, 
> fix-MutexLock.patch
>
>
> Removed unused constructor in MutexLock along with set_and_take() method, had 
> to change FORCE_PLUGIN_MUTEX() for that. Removed release() method.
> default bool and ! operator from both MutexLock and MutexTryLock with 
> is_locked() API. Changes if (lock) to if (lock.is_locked()) across the code 
> base.
> Ran make test will be performing more system testing. Posted before for early 
> comments / feedback.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to