[ 
https://issues.apache.org/jira/browse/MESOS-9134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16572291#comment-16572291
 ] 

Jie Yu commented on MESOS-9134:
-------------------------------

One way is to do an objdump on the method 
`mesos::internal::fs::MountTable::read`, and see if both code paths are 
compiled in or not

> fs::MountTable::read might not be thread safe.
> ----------------------------------------------
>
>                 Key: MESOS-9134
>                 URL: https://issues.apache.org/jira/browse/MESOS-9134
>             Project: Mesos
>          Issue Type: Bug
>    Affects Versions: 1.5.1
>            Reporter: Jie Yu
>            Priority: Major
>
> I observed the following stack trace for the mesos agent 1.5.1 on CoreOS.
> What I don't understand is that how is this possible. Both re-entrant and 
> non-reentrant version of the code are used in different threads.
> {noformat}Thread 6 (LWP 3022):
> #0  0x00007fd950a0034c in ?? () from target:/lib64/libpthread.so.0
> #1  0x00007fd9509f9cf5 in pthread_mutex_lock () from 
> target:/lib64/libpthread.so.0
> #2  0x00007fd9535028af in mesos::internal::fs::MountTable::read(std::string 
> const&) () from target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #3  0x00007fd9534dc416 in cgroups::subsystems(std::string const&) () from 
> target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #4  0x00007fd9534dd13f in cgroups::mounted(std::string const&, std::string 
> const&) () from target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #5  0x00007fd9534ddd98 in cgroups::verify(std::string const&, std::string 
> const&, std::string const&) () from 
> target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #6  0x00007fd9534df815 in cgroups::read(std::string const&, std::string 
> const&, std::string const&) () from 
> target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #7  0x00007fd9534e22b9 in cgroups::memory::usage_in_bytes(std::string const&, 
> std::string const&) () from target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #8  0x00007fd953557ca4 in 
> mesos::internal::slave::MemorySubsystemProcess::usage(mesos::ContainerID 
> const&, std::string const&) () from 
> target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #9  0x00007fd95354b91b in lambda::CallableOnce<void 
> (process::ProcessBase*)>::CallableFn<lambda::internal::Partial<process::Future<mesos::ResourceStatistics>
>  process::dispatch<mesos::ResourceStatistics, 
> mesos::internal::slave::SubsystemProcess, mesos::ContainerID const&, 
> std::string const&, mesos::ContainerID const&, std::string 
> const&>(process::PID<mesos::internal::slave::SubsystemProcess> const&, 
> process::Future<mesos::ResourceStatistics> 
> (mesos::internal::slave::SubsystemProcess::*)(mesos::ContainerID const&, 
> std::string const&), mesos::ContainerID const&, std::string 
> const&)::{lambda(std::unique_ptr<process::Promise<mesos::ResourceStatistics>, 
> std::default_delete<process::Promise<mesos::ResourceStatistics> > >, 
> mesos::ContainerID&&, std::string&&, process::ProcessBase*)#1}, 
> std::unique_ptr<process::Promise<mesos::ResourceStatistics>, 
> std::default_delete<process::Promise<mesos::ResourceStatistics> > >, 
> mesos::ContainerID, std::string, std::_Placeholder<1> > 
> >::operator()(process::ProcessBase*&&) && () from 
> target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #10 0x00007fd953d48331 in 
> process::ProcessBase::consume(process::DispatchEvent&&) () from 
> target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #11 0x00007fd953d5ed9c in 
> process::ProcessManager::resume(process::ProcessBase*) () from 
> target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #12 0x00007fd953d645a6 in 
> std::thread::_Impl<std::_Bind_simple<process::ProcessManager::init_threads()::{lambda()#1}
>  ()> >::_M_run() () from target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #13 0x00007fd950f13191 in ?? () from target:/lib64/libstdc++.so.6
> #14 0x00007fd9509f74f0 in ?? () from target:/lib64/libpthread.so.0
> #15 0x00007fd950737aed in clone () from target:/lib64/libc.so.6
> Thread 5 (LWP 3021):
> #0  0x00007fd9506bcff0 in _IO_file_read () from target:/lib64/libc.so.6
> #1  0x00007fd9506bdcd0 in _IO_file_underflow () from target:/lib64/libc.so.6
> #2  0x00007fd9506becc1 in _IO_default_uflow () from target:/lib64/libc.so.6
> #3  0x00007fd9506b21d2 in _IO_getline_info () from target:/lib64/libc.so.6
> #4  0x00007fd9506bbce6 in fgets_unlocked () from target:/lib64/libc.so.6
> #5  0x00007fd950730e9e in getmntent_r () from target:/lib64/libc.so.6
> #6  0x00007fd9535028c1 in mesos::internal::fs::MountTable::read(std::string 
> const&) () from target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #7  0x00007fd9534dc416 in cgroups::subsystems(std::string const&) () from 
> target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #8  0x00007fd9534dd13f in cgroups::mounted(std::string const&, std::string 
> const&) () from target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #9  0x00007fd9534ddd98 in cgroups::verify(std::string const&, std::string 
> const&, std::string const&) () from 
> target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #10 0x00007fd9534df815 in cgroups::read(std::string const&, std::string 
> const&, std::string const&) () from 
> target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #11 0x00007fd9534e2be7 in cgroups::blkio::readEntries(std::string const&, 
> std::string const&, std::string const&) () from 
> target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #12 0x00007fd9534e3a3d in cgroups::blkio::cfq::io_serviced(std::string 
> const&, std::string const&) () from 
> target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #13 0x00007fd95354ddff in 
> mesos::internal::slave::BlkioSubsystemProcess::usage(mesos::ContainerID 
> const&, std::string const&) () from 
> target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #14 0x00007fd95354b91b in lambda::CallableOnce<void 
> (process::ProcessBase*)>::CallableFn<lambda::internal::Partial<process::Future<mesos::ResourceStatistics>
>  process::dispatch<mesos::ResourceStatistics, 
> mesos::internal::slave::SubsystemProcess, mesos::ContainerID const&, 
> std::string const&, mesos::ContainerID const&, std::string 
> const&>(process::PID<mesos::internal::slave::SubsystemProcess> const&, 
> process::Future<mesos::ResourceStatistics> 
> (mesos::internal::slave::SubsystemProcess::*)(mesos::ContainerID const&, 
> std::string const&), mesos::ContainerID const&, std::string 
> const&)::{lambda(std::unique_ptr<process::Promise<mesos::ResourceStatistics>, 
> std::default_delete<process::Promise<mesos::ResourceStatistics> > >, 
> mesos::ContainerID&&, std::string&&, process::ProcessBase*)#1}, 
> std::unique_ptr<process::Promise<mesos::ResourceStatistics>, 
> std::default_delete<process::Promise<mesos::ResourceStatistics> > >, 
> mesos::ContainerID, std::string, std::_Placeholder<1> > 
> >::operator()(process::ProcessBase*&&) && () from 
> target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #15 0x00007fd953d48331 in 
> process::ProcessBase::consume(process::DispatchEvent&&) () from 
> target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #16 0x00007fd953d5ed9c in 
> process::ProcessManager::resume(process::ProcessBase*) () from 
> target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #17 0x00007fd953d645a6 in 
> std::thread::_Impl<std::_Bind_simple<process::ProcessManager::init_threads()::{lambda()#1}
>  ()> >::_M_run() () from target:/opt/mesosphere/lib/libmesos-1.5.1.so
> #18 0x00007fd950f13191 in ?? () from target:/lib64/libstdc++.so.6
> #19 0x00007fd9509f74f0 in ?? () from target:/lib64/libpthread.so.0
> #20 0x00007fd950737aed in clone () from target:/lib64/libc.so.6
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to