test_job_process can fail in test 'with environment of unnamed instance'
Bug #1086474 reported by
James Hunt
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart |
Fix Released
|
Undecided
|
Stéphane Graber |
Bug Description
Attempting to build lp:upstart in a PPA results consistently in the following test failure:
Testing job_process_run()
...with simple command
...with shell command
...with small script
...with small script and trailing newlines
...with script that will fail
...with environment of unnamed instance
BAD: wrong content in file 0x225e120 (output), expected 'UPSTART_INSTANCE=
' got 'PWD=/
'
at tests/test_
FAIL: test_job_process
The test in question is checking that every environment variable is as expected, but here, it complains since the PWD variable was found when it expected the UPSTART_INSTANCE variable.
Related branches
lp:upstart
- Daniël Sonck: Approve
-
Diff: 18561 lines (+11017/-1183) (has conflicts)73 files modified.bzrignore (+4/-0)
ChangeLog (+365/-0)
Makefile.am (+1/-1)
NEWS (+35/-1)
TESTING.sessions (+289/-0)
conf/rc-sysinit.conf (+2/-0)
configure.ac (+7/-3)
contrib/bash_completion/upstart (+96/-36)
contrib/vim/syntax/upstart.vim (+61/-27)
dbus/Upstart.conf (+6/-36)
dbus/com.ubuntu.Upstart.xml (+7/-0)
dbus/upstart.h (+1/-1)
extra/Makefile.am (+125/-0)
extra/conf/upstart-socket-bridge.conf (+16/-0)
extra/conf/upstart-udev-bridge.conf (+16/-0)
extra/man/socket-event.7 (+92/-0)
extra/man/upstart-socket-bridge.8 (+47/-0)
extra/man/upstart-udev-bridge.8 (+57/-0)
extra/upstart-socket-bridge.c (+644/-0)
extra/upstart-udev-bridge.c (+310/-0)
init/Makefile.am (+12/-0)
init/conf.c (+504/-55)
init/conf.h (+45/-2)
init/control.c (+111/-19)
init/control.h (+19/-1)
init/environ.c (+0/-1)
init/environ.h (+0/-1)
init/event.c (+22/-0)
init/event.h (+6/-1)
init/event_operator.c (+59/-0)
init/event_operator.h (+8/-0)
init/job.c (+47/-3)
init/job.h (+4/-1)
init/job_class.c (+115/-67)
init/job_class.h (+62/-2)
init/job_process.c (+122/-14)
init/job_process.h (+5/-3)
init/main.c (+297/-134)
init/man/init.5 (+236/-48)
init/man/init.8 (+32/-4)
init/parse_conf.c (+6/-0)
init/parse_job.c (+21/-7)
init/parse_job.h (+4/-2)
init/paths.h (+75/-2)
init/session.c (+320/-0)
init/session.h (+89/-0)
init/tests/test_blocked.c (+4/-1)
init/tests/test_conf.c (+1310/-15)
init/tests/test_control.c (+15/-11)
init/tests/test_environ.c (+3/-1)
init/tests/test_event.c (+28/-25)
init/tests/test_event_operator.c (+3/-0)
init/tests/test_job.c (+71/-76)
init/tests/test_job_class.c (+56/-65)
init/tests/test_job_process.c (+34/-30)
init/tests/test_parse_conf.c (+3/-0)
init/tests/test_parse_job.c (+302/-260)
init/tests/test_process.c (+3/-0)
init/tests/test_system.c (+3/-0)
po/POTFILES.in (+2/-0)
po/upstart.pot (+352/-155)
scripts/Makefile.am (+25/-0)
scripts/init-checkconf.sh (+248/-0)
scripts/initctl2dot.py (+571/-0)
scripts/man/init-checkconf.8 (+73/-0)
scripts/man/initctl2dot.8 (+87/-0)
util/Makefile.am (+1/-1)
util/initctl.c (+1014/-17)
util/initctl.h (+458/-0)
util/man/initctl.8 (+207/-34)
util/reboot.c (+0/-1)
util/tests/test_initctl.c (+1189/-19)
util/tests/test_user_sessions.sh (+553/-0)
lp:~stgraber/upstart/upstart-shell-paths
- James Hunt: Approve
-
Diff: 65 lines (+18/-3)2 files modifiedinit/job_process.c (+10/-3)
init/tests/test_job_process.c (+8/-0)
Changed in upstart: | |
assignee: | nobody → James Hunt (jamesodhunt) |
status: | New → In Progress |
Changed in upstart: | |
assignee: | James Hunt (jamesodhunt) → nobody |
Changed in upstart: | |
status: | In Progress → Fix Committed |
Changed in upstart: | |
assignee: | nobody → Stéphane Graber (stgraber) |
Changed in upstart: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
This test failure has so far only been seen when building lp:upstart in a PPA, using the lp:ubuntu/upstart packaging branch:
https:/ /code.launchpad .net/~jamesodhu nt/+recipe/ upstart- daily
The PPA builder is an Ubuntu hardy system with a Xen kernel. Changing to a non-virtualised PPA builder did not help:
https:/ /code.launchpad .net/~jamesodhu nt/+recipe/ upstart- daily-nonvirt
I have now managed to recreate a very similar issue whereby the same test as above is failing but in a different manner. To do this, I created a hardy (8.04.4) server install containing a precise schroot and ran the tests from there:
...with script that will fail job_process. c:675 (test_run).
...with environment of unnamed instance
BAD: wrong value for stat (filename, &statbuf), expected 0 got -1
at tests/test_
/bin/bash: line 5: 6538 Aborted ${dir}$tst
FAIL: test_job_process
Debugging reveals that in job_process_spawn() after the fork():
(1) the symbol 'environ' is NULL, which is surprising.
(2) After the assignment operation below, 'environ' is *still* NULL even though 'env' is perfectly valid:
640 /* Set the process environment from the function parameters. */
641 environ = (char **)env;
Here's what gdb in quantal says about the environ variable: _______ _______ _______ _______ _______ _______ ______
_______
(gdb) info var environ
All variables matching regular expression "environ":
File environ.c:
char **__environ;
char **_environ;
char **environ;
File setenv.c:
static char **last_environ;
File environ.c:
char **__environ;
char **_environ;
char **environ;
Non-debugging symbols: @GLIBC_ 2.0 _______ _______ _______ _______ _______ _______ ______
0x080bd5c0 __environ@
0x080bd5c0 environ@@GLIBC_2.0
(gdb)
_______
Whereas the equivalent in hardy shows: _______ _______ _______ _______ _______ _______ ______
_______
(gdb) info var environ
All variables matching regular expression "environ":
Non-debugging symbols: @GLIBC_ 2.0 _______ _______ _______ _______ _______ _______ ______
0x080bd5c0 __environ@
0x080bd5c0 environ@@GLIBC_2.0
0xb7f34e04 __environ
0xb7f34e04 _environ
(gdb)
_______