On Tue, Dec 22, 2020 at 9:43 AM David Gow davidgow@google.com wrote:
On Tue, Dec 22, 2020 at 4:02 AM Andy Shevchenko andriy.shevchenko@linux.intel.com wrote:
On Mon, Dec 21, 2020 at 09:40:08PM +0200, Andy Shevchenko wrote:
+Cc people from culprit commit
Guys, revert helps. I am open to test any solution you may propose, thanks!
...
# first bad commit: [757055ae8dedf5333af17b3b5b4b70ba9bc9da4e] init/console: Use ttynull as a fallback when there is no console
--
+CC linux-um
There appear to be two problems here:
- UML now no longer has console output by default (which KUnit needs
to get results) 2. UML now seems to crash on startup when ttynull is used (which is now default)
Whoops. I was wrong about number 2 here (thanks Johannes for pointing that out). The segfault in n_tty_open() actually happens normally as part of UML startup, and it's recovered from perfectly.
So the only real issue is that this is changing the default console output to ttynull, and hence hiding the output.
This can be worked around for KUnit by passing console=tty to the kernel. I don't think this is a "correct" fix, as UML seems to be crashing out-of-the-box anyway (see below), but it may be worth us forcing this as we require the console output as well.
In any case, this patch fixes it in kunit_tool for now. I may submit this as a proper patch anyway, but that won't fix UML in general:
diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py index 57c1724b7e5d..698358c9c0d6 100644 --- a/tools/testing/kunit/kunit_kernel.py +++ b/tools/testing/kunit/kunit_kernel.py @@ -198,7 +198,7 @@ class LinuxSourceTree(object): return self.validate_config(build_dir)
def run_kernel(self, args=[], build_dir='', timeout=None):
args.extend(['mem=1G'])
args.extend(['mem=1G', 'console=tty']) self._ops.linux_bin(args, timeout, build_dir) outfile = get_outfile_path(build_dir) subprocess.call(['stty', 'sane'])
I'll send this out properly as a patch to kunit_tool: while I still think that the default console on UML shouldn't change, it probably makes sense for KUnit to not rely on the default.
Cheers, -- David