Bug 1116568 - yast2 hostnames can freeze OS
Summary: yast2 hostnames can freeze OS
Status: RESOLVED FIXED
: 1066329 (view as bug list)
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: YaST2 (show other bugs)
Version: Current
Hardware: Other Other
: P2 - High : Normal (vote)
Target Milestone: ---
Assignee: Michal Filka
QA Contact: Jiri Srain
URL: https://trello.com/c/mbJyRV1V
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-19 13:23 UTC by Alexander Graul
Modified: 2023-01-24 15:59 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
script to generate hosts files (871 bytes, text/x-python)
2018-11-19 13:23 UTC, Alexander Graul
Details
screenshot of htop showing yast process resource consumption (126.69 KB, image/png)
2018-11-19 13:24 UTC, Alexander Graul
Details
linewise profiling summary (15.60 KB, text/plain)
2018-11-19 14:12 UTC, Alexander Graul
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Graul 2018-11-19 13:23:02 UTC
Created attachment 790163 [details]
script to generate hosts files

## Summary
I've observed that the yast process' memory usage can grow to levels that stop the whole operating system from responding. Even "magic SysRq" key combinations are not handled correctly.

## What did I do?

I was looking into profiling `yast2 host` using rbspy. I already did so in a VM, but wanted to compare that result to one from laptop directly. You can see my laptop specs below. To see what takes time with parsing/displaying the hostname and IP-address combinations I used a /etc/hosts file with 10.000 lines. Each had one IP, one hostname and three aliases, generated by a python script (attached).
I monitored the process using htop, filtering for ruby (no other ruby process was running during the time) and attached rbspy to it (rbspy record --pid $PID_TAKEN_FROM_HTOP).


## What did I observe?

While the loading time of the 10.000 lines was already really long on the VM (~ 13min), after 30min the loading was not finished on my laptop. One CPU thread was at 100% whenever I checked it and memory usage grew. Before the laptop became unresponsive, I saw more than 12 GiB of memory used by ruby (non-swapped). My laptop started to take a long time for tasks like changing focus and the background music I had running started to stutter. I left the computer running for a few minutes, then realized it probably would not respond anytime soon. I tried the "magic SysRq" combination "REISUB", but that did not do anything I could observe, so I hard-reset the laptop.

## Laptop Specs
Dell Latitude 7480
RAM: 15.5 GiB
SWAP: 8 GiB
CPU: 4 × Intel® Core™ i7-6600U CPU @ 2.60GHz
OS: openSUSE Tumbleweed 20181112
Comment 1 Alexander Graul 2018-11-19 13:24:48 UTC
Created attachment 790165 [details]
screenshot of htop showing yast process resource consumption
Comment 2 Simon Schricker 2018-11-19 13:38:26 UTC
I reproduced the described behavior (using the attached script, also using 10k line `/etc/hosts`) on openSUSE Leap 15 with my workstation and can confirm the described behavior. I also had to hard-reset my system. I suspect my system froze before it ran out of swap space, but I can't provide hard evidence for that.
Comment 3 Alexander Graul 2018-11-19 14:12:16 UTC
Created attachment 790168 [details]
linewise profiling summary

This profiling result was taken on the VM and not when my laptop ran out of memory. Nonetheless, it shows what ruby methods were using CPU time during the runtime of the hostnames module.

Small explanation:

% self: percentage of time a stack frame was on top of call stack
% total: percentage of time a stack frame was visible on the call stack
% name: name of ruby method, filename and line that is observed on the call stack

More information about rbspy can be taken from https://rbspy.github.io/
Comment 4 Steffen Winterfeldt 2018-11-21 13:32:06 UTC
Tracking in YaST scrum board.
Comment 5 Lukas Ocilka 2018-12-06 09:48:49 UTC
*** Bug 1066329 has been marked as a duplicate of this bug. ***
Comment 7 Michal Filka 2019-01-04 10:35:21 UTC
Should be better with yast2-network 4.1.27