Project

General

Profile

Bug #18088

popen in LinuxProcMgr.cc causes a dead lock with an external profiler (Open|Speedshop)

Added by Soon Jun about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
10/31/2017
Due date:
% Done:

100%

Estimated time:
Spent time:
Occurs In:
Scope:
Internal
Experiment:
LArSoft
SSI Package:
art
Duration:

Description

The popen in Utilities/LinuxProcMgr.cc (line 105) causes a dead lock with an external profilier (Open|Speedshop version 2.2)
- see below for the top of the back-trace for the hanging process with rhe art version v2_08_03 and dunetpc v06_54_00.
A test modification resolves the problem.

From:
ost << "cat /proc/" << pid_ << "/status";
FILE* file = popen(ost.str().c_str(), "r");

TO:
ost << "/proc/" << getpid() << "/status";
if((fFile = open(ost.str().c_str(), O_RDONLY)) < 0)

// need all relevant modification to get the status information

Back-trace of the hanging process
(gdb) bt
#0 0x00000031cca0f6ab in raise () from /lib64/libpthread.so.0
#1 0x00007fd64786b9fe in monitor_signal_handler () from /g4/g4p/dune/krellroot_v2.2/lib64/libmonitor.so
#2 <signal handler called>
#3 0x00000031cc2acd2b in fork () from /lib64/libc.so.6
#4 0x00000031cc268467 in IO_proc_open@GLIBC_2.2.5 () from /lib64/libc.so.6
#5 0x00000031cc268759 in popen
@GLIBC_2.2.5 () from /lib64/libc.so.6
#6 0x00007fd641b70b48 in art::LinuxProcMgr::getStatusData
(this=Unhandled dwarf expression opcode 0xf3
) at /scratch/workspace/art-rel-bld/SLF6/prof/build/art/v2_08_03/src/art/Utilities/LinuxProcMgr.cc:105
#7 0x00007fd61c6e0545 in getVmPeak (this=0x804cc10) at /scratch/workspace/art-rel-bld/SLF6/prof/build/art/v2_08_03/src/art/Utilities/LinuxProcMgr.h:30
#8 art::MemoryTracker::recordPeakUsages_ (this=0x804cc10) at /scratch/workspace/art-rel-bld/SLF6/prof/build/art/v2_08_03/src/art/Framework/Services/Optional/MemoryTrackerLinux_service.cc:318
#9 0x00007fd61c6e13b1 in art::MemoryTracker::postEndJob (this=0x804cc10) at /scratch/workspace/art-rel-bld/SLF6/prof/build/art/v2_08_03/src/art/Framework/Services/Optional/MemoryTrackerLinux_service.cc:290

History

#1 Updated by Kyle Knoepfel about 2 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Resolved with commit art:95a077a.

#2 Updated by Kyle Knoepfel about 2 years ago

  • Target version set to 2.09.02

#3 Updated by Kyle Knoepfel about 2 years ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF