Bugzilla – Bug 1116568
yast2 hostnames can freeze OS
Last modified: 2023-01-24 15:59:58 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
Created attachment 790165 [details] screenshot of htop showing yast process resource consumption
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.
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/
Tracking in YaST scrum board.
*** Bug 1066329 has been marked as a duplicate of this bug. ***
Should be better with yast2-network 4.1.27