assert() when no TERM or PATH from parent environment
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart |
Fix Released
|
Medium
|
Unassigned |
Bug Description
process_
{
char **env;
char *path, *term, *jobid;
nih_assert (job != NULL);
/* Inherit PATH and TERM from our parent's environment, everything
* else is often just overspill from initramfs.
*/
NIH_MUST (path = nih_strdup (NULL, getenv ("PATH")));
NIH_MUST (term = nih_strdup (NULL, getenv ("TERM")));
and then nih_strdup() has:
nih_assert (str != NULL);
which means that if there is no PATH or TERM then this happens:
Jul 23 13:31:58 fx init: string.c:143: Assertion failed in nih_strdup: str != NULL
Jul 23 13:31:58 fx init: rcS main process (4490) killed by ABRT signal
(it's upstart from hardy)
You could ask how it's possible to not have PATH or TERM in environment... it is reality when running ubuntu as guest in linux vserver.
Changed in upstart: | |
status: | Fix Committed → Fix Released |
The environment code in trunk is substantially different and not affected by this bug