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

Fix for bash's memory-leak #1879

Merged
merged 2 commits into from
Jul 28, 2018
Merged

Fix for bash's memory-leak #1879

merged 2 commits into from
Jul 28, 2018

Conversation

rodnymolina
Copy link
Contributor

Memory leak is observed during the execution of scripts that make use of bash-arrays. In scenarios where the offending script is executed on a regular basis (e.g. fancontrol), the leaking process may end up consuming most of the system resources.

In this PR i'm replacing bash in all the contexts where it executes (both host and dockers). The official patch for this issue is here: https://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-040

Memory leak is observed during the execution of scripts that make use of bash-arrays. In scenarios where the offending script is executed on a regular basis (e.g. fancontrol), the leaking process may end up consuming most of the system resources.

In this PR i'm replacing bash in all the contexts where it executes (both host and dockers). The official patch for this issue is here: https://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-040
@@ -227,6 +227,9 @@ RUN apt-get update && apt-get install -y \
python3-requests \
python3-pytest \
python3-colorama
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add \

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, i just fixed it, this one was a last-minute issue while merging my patch with latest github code...

@lguohan
Copy link
Collaborator

lguohan commented Jul 27, 2018

@rodnymolina , please fix build error.

Signed-off-by: Rodny Molina <rmolina@linkedin.com>
@lguohan
Copy link
Collaborator

lguohan commented Jul 27, 2018

@rodnymolina , still build failure, please investigate.

@rodnymolina
Copy link
Contributor Author

Thanks Gouhan, i'm aware of it, i'm re-building a github image locally to verify.

@lguohan lguohan merged commit c3c8f7f into sonic-net:master Jul 28, 2018
lguohan pushed a commit that referenced this pull request Jul 28, 2018
* Fix for bash's memory-leak

Memory leak is observed during the execution of scripts that make use of bash-arrays. In scenarios where the offending script is executed on a regular basis (e.g. fancontrol), the leaking process may end up consuming most of the system resources.

In this PR i'm replacing bash in all the contexts where it executes (both host and dockers). The official patch for this issue is here: https://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-040

* Fixing minor issue during code-merge

Signed-off-by: Rodny Molina <rmolina@linkedin.com>
Copy link
Collaborator

@kannankvs kannankvs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the debian stretch migration completed? can this patch be removed?

judyjoseph added a commit that referenced this pull request Oct 14, 2021
d2baedb Remove exec from platform_reboot_plugin call to handle any hang issue. (#1879)
c54da70 [fstrim] limit smartctl execution time to 30 seconds (#1850)
cccf845 [multi-asic][cli][chassis-db] Avoid connecting to chassis db for cli commands executed from linecard (#1707)
vdahiya12 added a commit to vdahiya12/sonic-buildimage that referenced this pull request Oct 20, 2021
8768089 (HEAD -> 202012, origin/202012) Remove exec from platform_reboot_plugin call to handle any hang issue. (sonic-net#1879)
ae5d90c Validate input of ```config mirror_session add``` (sonic-net#1825)
44d3a3b [show][config] fix the muxcable commands for interface naming mode (sonic-net#1862)
0a4933e [TH3] Skipp Control Plane Assist on WARM Reboot for TH3 HWSKUs (sonic-net#1861)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
lguohan pushed a commit that referenced this pull request Oct 24, 2021
8768089 (HEAD -> 202012, origin/202012) Remove exec from platform_reboot_plugin call to handle any hang issue. (#1879)
ae5d90c Validate input of ```config mirror_session add``` (#1825)
44d3a3b [show][config] fix the muxcable commands for interface naming mode (#1862)
0a4933e [TH3] Skipp Control Plane Assist on WARM Reboot for TH3 HWSKUs (#1861)

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
wen587 added a commit that referenced this pull request Oct 26, 2021
8ea834b [sonic_installer] Change sonic_installer check ASIC mismatch by platforms list (#1836)
9017d99 Fix the option missing in kernel config issue (#1888)
6595ad4 [mlag] fix log print sequence (#1730)
e600e1c CLI command to load config in Yang format (#1781)
00948d0 Fix the target db version of portchannel-key test (#1842)
6412fea [sonic-package-manager] remove make_python_identifier (#1801)
f738818 [sonic-package-manager] stop service explicitelly before uninstalling package (#1805)
d8ee5e9 Remove exec from platform_reboot_plugin call to handle any hang issue. (#1879)
827fcee [chassis][routecheck]filter out the chassis internal interfaces (#1798)
4d732c6 [generic_config_updater] Logging (#1864)
25bb184 [config]: Add loopback interfaces to interface name checker (#1869)
c950a55 Validate input of config mirror_session add (#1825)
9ab20fd [show][config] fix the muxcable commands for interface naming mode (#1862)
476b3a4 [multi-asic][cli][chassis-db] Avoid connecting to chassis db for cli commands executed from linecard (#1707)
taras-keryk pushed a commit to taras-keryk/sonic-buildimage that referenced this pull request Apr 28, 2022
sonic-net#1879)

What I did
Remove exec from the platform_reboot call to handle any hang issue during reboot

How I did it
Remove "exec" from " exec ${DEVPATH}/${PLATFORM}/${PLAT_REBOOT} $@"

How to verify it
Perform sudo reboot after DE initializing the platfom driver and see if the device gracefully reboots by /sbin/reboot after failing on platform_reboot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants