Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve early unlocking in FastMonitoringService [12.4.x] #38584

Merged
merged 2 commits into from Jul 4, 2022

Conversation

fwyzard
Copy link
Contributor

@fwyzard fwyzard commented Jul 2, 2022

PR description:

These changes attempt to fix a rare error that is only observed online during data taking:

cmsRun: ../nptl/pthread_mutex_lock.c:81: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.


A fatal system signal has occurred: abort signal
The following is the call stack containing the origin of the signal.

Sat Jul 2 01:52:36 CEST 2022
Thread 13 (Thread 0x7fd568bfd700 (LWP 2362148) "cmsRun"):
...
#4 <signal handler called>
#5 0x00007fd5f463d37f in raise () from /lib64/libc.so.6
#6 0x00007fd5f4627db5 in abort () from /lib64/libc.so.6
#7 0x00007fd5f4627c89 in __assert_fail_base.cold.0 () from /lib64/libc.so.6
#8 0x00007fd5f4635a76 in __assert_fail () from /lib64/libc.so.6
#9 0x00007fd5f49d7c61 in pthread_mutex_lock () from /lib64/libpthread.so.0
#10 0x00007fd5e94ed1bf in evf::FastMonitoringService::preStreamEndLumi(edm::StreamContext const&) () from /opt/offline/el8_amd64_gcc10/cms/cmssw/CMSSW_12_3_6/lib/el8_amd64_gcc10/libEventFilterUtilities.so
#11 0x00007fd5f70944df in edm::StreamSchedule::processOneStreamAsync<edm::OccurrenceTraits(edm::WaitingTaskHolder, edm::OccurrenceTraits::TransitionInfoType&, edm::ServiceToken const&, bool)::{lambda()#2}::operator()() () from /opt/offline/el8_amd64_gcc10/cms/cmssw/CMSSW_12_3_6/lib/el8_amd64_gcc10/libFWCoreFramework.so
...

The current code locks a mutex with std::lock_guard, but unlocks it explicitly under some circumstances, causing to a double unlock and leading to undefined behaviour.

This change replaces the use of std::lock_guard with std::unique_lock, that can be safely released and unlocked before going out of scope.

A second minor change should avoid a few memory copies when emitting a LogInfo message.

PR validation:

Tested with CMSSW 12.3.x running a recent HLT menu in DAQ-like mode.

If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:

Backport of #38583 for data taking.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 2, 2022

A new Pull Request was created by @fwyzard (Andrea Bocci) for CMSSW_12_4_X.

It involves the following packages:

  • EventFilter/Utilities (daq)

@cmsbuild, @emeschi, @smorovic can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @missirol this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@fwyzard fwyzard changed the title Fast monitoring service mutex Improve early unlocking in FastMonitoringService [12.4.x] Jul 2, 2022
@fwyzard
Copy link
Contributor Author

fwyzard commented Jul 2, 2022

type bugfix

@fwyzard
Copy link
Contributor Author

fwyzard commented Jul 2, 2022

backport #38583

@fwyzard
Copy link
Contributor Author

fwyzard commented Jul 2, 2022

please test

@smorovic
Copy link
Contributor

smorovic commented Jul 2, 2022

+1

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 2, 2022

This pull request is fully signed and it will be integrated in one of the next CMSSW_12_4_X IBs after it passes the integration tests and once validation in the development release cycle CMSSW_12_5_X is complete. This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 2, 2022

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-5d6ae4/25949/summary.html
COMMIT: c6c93a8
CMSSW: CMSSW_12_4_X_2022-07-02-1100/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/38584/25949/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 50
  • DQMHistoTests: Total histograms compared: 3675663
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3675639
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 49 files compared)
  • Checked 208 log files, 45 edm output root files, 50 DQM output files
  • TriggerResults: no differences found

@perrotta
Copy link
Contributor

perrotta commented Jul 4, 2022

+1

@cmsbuild cmsbuild merged commit 27f837e into cms-sw:CMSSW_12_4_X Jul 4, 2022
@fwyzard fwyzard deleted the FastMonitoringService_mutex branch July 31, 2022 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants