Comment 1 for bug 1086474

Revision history for this message
James Hunt (jamesodhunt) wrote :

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/~jamesodhunt/+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/~jamesodhunt/+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
...with environment of unnamed instance
BAD: wrong value for stat (filename, &statbuf), expected 0 got -1
 at tests/test_job_process.c:675 (test_run).
/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:
0x080bd5c0 __environ@@GLIBC_2.0
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:
0x080bd5c0 __environ@@GLIBC_2.0
0x080bd5c0 environ@@GLIBC_2.0
0xb7f34e04 __environ
0xb7f34e04 _environ
(gdb)
_______________________________________________________