#851870 autopkgtest-virt-qemu: Hangs if test causes a kernel panic

#851870#5
Date:
2017-01-19 14:06:30 UTC
From:
To:
I was attempting to debug/fix LP: #1630578, so I wrote the attached
package to trigger a panic manually.

Seems that the qemu runner hangs when the panic happens. (Hopefully it's
going to timeout eventually.)

I thought about solving by slightly refactoring the auxverb use to use
asyncio when waiting for the command to exit, and then also for reading
from ttyS0 for occurrences of 'Kernel panic'.

Don't plan on working on this immediately (seems like a good train
task), so just RFC currently.

Cheers!

#851870#10
Date:
2017-01-19 14:10:43 UTC
From:
To:
argh
#851870#15
Date:
2017-01-21 10:09:17 UTC
From:
To:
Hello Iain,

Iain Lane [2017-01-19 14:06 +0000]:

It does time out:

| $ runner/autopkgtest -B /tmp/panic -d --timeout-test=60 --timeout-copy=10 -- qemu -d autopkgtest-zesty-amd64.img
| [...]
| autopkgtest [11:03:40]: test panic: [-----------------------
| [...]
| make[1]: Leaving directory '/usr/src/linux-headers-4.9.0-11-generic'
| autopkgtest [11:04:40]: ERROR: timed out on command [...]
| autopkgtest [11:04:41]: test panic: -----------------------]

it then tries to copy the results, which times out as well:

| autopkgtest-virt-qemu: DBG: executing copyup /tmp/autopkgtest.6i3fb7/panic-stdout /tmp/autopkgtest.output.e4e00v7l/panic-stdout
| autopkgtest: DBG: got reply from testbed: timeout
| autopkgtest: WARNING: Copying up test output timed out, ignoring
| autopkgtest [11:04:51]: test panic:  - - - - - - - - - - results - - - - - - - - - -
| panic                FAIL timed out

and exits with error 4 (i. e. test failure). So while this is certainly not
optimal, it is at least reasonable. So I don't think it's an urgent/critical
bug.

This should take care to not catch kernel warnings or oopses -- when these
happen, the machine should limp on normally, and package tests like kerneloops
even trigger them deliberately.

Thanks,

Martin

#851870#20
Date:
2017-01-21 15:02:41 UTC
From:
To:
Thanks for the feedback!
#851870#25
Date:
2017-02-06 10:55:01 UTC
From:
To:
Hmm.

It was fun learning a bit about asyncio to implement this on the train
back from FOSDEM. What I have currently is attached, but it's not fully
ready. I explained a problem in the commit message - if the machine is
dead due to a panic, how can we execute copyup and other commands that
autopkgtest wants to run after a failure?

Cheers,

#851870#30
Date:
2025-09-04 19:25:14 UTC
From:
To:
Hi,

On Thu, 19 Jan 2017 14:10:43 +0000 Iain Lane <iain@orangesquash.org.uk> wrote:

Unfortunately, the test of the panic package doesn't work anymore:


make -C /lib/modules/6.16.3+deb14-amd64/build
M=/tmp/autopkgtest.46gHjV/build.o6n/real-tree modules
make[1]: Entering directory '/usr/src/linux-headers-6.16.3+deb14-amd64'
make[2]: Entering directory '/tmp/autopkgtest.46gHjV/build.o6n/real-tree'
   CC [M]  kpanic.o
kpanic.o: error: objtool: init_module(): Magic init_module() function
name is deprecated, use module_init(fn) instead
make[4]: ***
[/usr/src/linux-headers-6.16.3+deb14-common/scripts/Makefile.build:292:
kpanic.o] Error 255
make[4]: *** Deleting file 'kpanic.o'
make[3]: *** [/usr/src/linux-headers-6.16.3+deb14-common/Makefile:2027:
.] Error 2
make[2]: *** [/usr/src/linux-headers-6.16.3+deb14-common/Makefile:260:
__sub-make] Error 2
make[1]: *** [/usr/src/linux-headers-6.16.3+deb14-common/Makefile:260:
__sub-make] Error 2
make: *** [Makefile:3: all] Error 2
make[2]: Leaving directory '/tmp/autopkgtest.46gHjV/build.o6n/real-tree'
make[1]: Leaving directory '/usr/src/linux-headers-6.16.3+deb14-amd64'
insmod: ERROR: could not load module
/tmp/autopkgtest.46gHjV/build.o6n/real-tree/kpanic.ko: No such file or
directory
/tmp/autopkgtest.46gHjV/wrapper.sh: checking for leaked background
processes...
/tmp/autopkgtest.46gHjV/wrapper.sh: waiting for tee/cat subprocesses...
/tmp/autopkgtest.46gHjV/wrapper.sh: cleaning up...
/tmp/autopkgtest.46gHjV/wrapper.sh: Exit status: 1