Bug 1733663 - cppcheck killed after memory usage explodes
Summary: cppcheck killed after memory usage explodes
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: cppcheck
Version: rawhide
Hardware: All
OS: All
unspecified
high
Target Milestone: ---
Assignee: Susi Lehtola
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-27 02:48 UTC by Scott K Logan
Modified: 2019-08-13 03:07 UTC (History)
3 users (show)

Fixed In Version: cppcheck-1.88-3.fc30 cppcheck-1.88-3.fc29 cppcheck-1.88-3.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-06 01:18:41 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Scott K Logan 2019-07-27 02:48:55 UTC
Description of problem:
cppcheck consumers all of the system's memory and is eventually killed by the kernel.


Version-Release number of selected component (if applicable): cppcheck-1.88-1.fc30.x86_64


How reproducible: 100%



Steps to Reproduce:
1. Create C++ source which requires complex template simplification [1]
2. Run cppcheck on it

Actual results:
From dmesg:
oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/user,task=cppcheck,pid=1585,uid=1000
Out of memory: Killed process 1585 (cppcheck) total-vm:27857440kB, anon-rss:15142504kB, file-rss:4kB, shmem-rss:0kB
oom_reaper: reaped process 1585 (cppcheck), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB


Expected results:
cppcheck does not consume all of my system's memory, and runs to completion.


Additional info:
We first started seeing this manifest as test failures a few days ago on CentOS 7, so the EPEL package is affected as well. Since EPEL doesn't have a separate repository for updates, there isn't an older version to fall back to.

It appears that a fix has been applied for this upstream, but I'm not completely confident I've found the commit with the proper fix, though applying this[2] patch resolves the issue for me, and I haven't observed any other fallout.

Given the potentially destructive nature of consuming all of the system's memory and the release cadence that upstream has taken in the past, I think this bug is worth patching until the next release comes along.

[1] https://github.com/ros2/rclcpp/blob/9aacc6d89523e8fc27769f9b7f31ed97ceec54b1/rclcpp/include/rclcpp/subscription_traits.hpp#L76-L92
[2] https://github.com/danmar/cppcheck/pull/1939

Comment 1 Fedora Update System 2019-07-28 10:02:39 UTC
FEDORA-EPEL-2019-7492840e06 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-7492840e06

Comment 2 Fedora Update System 2019-07-28 10:02:42 UTC
FEDORA-2019-f9f7e46824 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-f9f7e46824

Comment 3 Fedora Update System 2019-07-29 01:14:23 UTC
cppcheck-1.88-3.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-f9f7e46824

Comment 4 Fedora Update System 2019-07-29 04:41:47 UTC
cppcheck-1.88-3.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-a4be77a649

Comment 5 Fedora Update System 2019-07-29 04:49:08 UTC
cppcheck-1.88-3.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-7492840e06

Comment 6 Scott K Logan 2019-07-29 05:11:15 UTC
Thanks for taking action on this.

It appears that I was mistaken that there were no ill-effects from this patch. Even though cppcheck now exits successfully, I noticed the following message in the logs:

[src/ros2/rclcpp/rclcpp/test/test_subscription_traits.cpp:125]: (error) syntax error

I believe that the patch[1] which fixes this issue is also applied upstream. My apologies for not testing more thoroughly before making noise.

[1] https://github.com/danmar/cppcheck/pull/1943

Comment 7 Fedora Update System 2019-08-06 01:18:41 UTC
cppcheck-1.88-3.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2019-08-06 01:55:26 UTC
cppcheck-1.88-3.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2019-08-13 03:07:07 UTC
cppcheck-1.88-3.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.