Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 620938 - Improve feedback of emerge after being killed because of oom
Summary: Improve feedback of emerge after being killed because of oom
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-05 16:50 UTC by Kalle Richter
Modified: 2017-06-10 20:12 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kalle Richter 2017-06-05 16:50:14 UTC
After `emerge` is killed because of out-of-memory (oom) by the kernel, the output is in the form of (e.g. for `sys-kernel/gentoo-sources`)

```
>>> Installing (1 of 1) sys-kernel/gentoo-sources-4.9.16::gentoo

>>> Failed to install sys-kernel/gentoo-sources-4.9.16, Log file:

>>>  '/var/tmp/portage/sys-kernel/gentoo-sources-4.9.16/temp/build.log'

 * GNU info directory index is up-to-date.

 * IMPORTANT: 8 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.
```

The referenced log file doesn't contain different information. The user can't figure out why the merging failed easily. Only `dmesg` reveals

```
[15712.020923] Out of memory: Kill process 27569 (emerge) score 570 or sacrifice child
[15712.020932] Killed process 27569 (emerge) total-vm:163840kB, anon-rss:148724kB, file-rss:72kB
```

It'd be nice if `emerge` would inform the user that it was killed by OOM if that's possible or if it would otherwise consider the possibility in the failure output.
Comment 1 Zac Medico gentoo-dev 2017-06-10 20:02:08 UTC
We can check which signal it was killed by, and SIGKILL usually means the OOM killer did it.
Comment 2 Fabian Groffen gentoo-dev 2017-06-10 20:08:32 UTC
SIGKILL is never received by the application, is it?
Comment 3 Zac Medico gentoo-dev 2017-06-10 20:12:57 UTC
The parent process can use WTERMSIG to see if the child process got killed by SIGKILL.