public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.5.26 broken on headless boxes
@ 2002-07-17 15:55 Matthew Wilcox
  2002-07-18  1:06 ` William Lee Irwin III
  0 siblings, 1 reply; 20+ messages in thread
From: Matthew Wilcox @ 2002-07-17 15:55 UTC (permalink / raw)
  To: linux-kernel


On a headless box with both CONFIG_VT_CONSOLE and CONFIG_SERIAL_CONSOLE
defined, I get:

Freeing unused kernel memory: 452k freed
visual_init: sw = 00000000, conswitchp = 00000000, currcons = 0, init = 1
Unable to handle kernel NULL pointer dereference at virtual address 00000000
 printing eip:
c01b775f
*pde = 37868001
*pte = 00000000
Oops: 0000
CPU:    0
EIP:    0010:[<c01b775f>]    Not tainted
EFLAGS: 00010286
eax: 00000000   ebx: c03dc9a0   ecx: 00000001   edx: c02f2cb0
esi: 00000000   edi: 00000000   ebp: 00000000   esp: c3d45e9c
ds: 0018   es: 0018   ss: 0018
Process init (pid: 1, threadinfo=c3d44000 task=c3d4f300)
Stack: 00000000 f784a000 00000000 f78518f0 f7907600 c01baa05 00000000 00000000 
       00000001 c01ac03c f784a000 f7871da0 c3d44000 f7871da0 00000000 f78518f0 
       f786da20 01021e80 f784a000 f7910160 c0145a93 f786da20 c3d45f80 f7a06000 
Call Trace: [<c01baa05>] [<c01ac03c>] [<c0145a93>] [<c0144ee7>] [<c0146383>] 
   [<c013c34a>] [<c013b011>] [<c013af26>] [<c013b317>] [<c0108893>] 

Code: 83 38 00 75 09 57 e8 36 ed ff ff 83 c4 04 8b 86 00 cc 3d c0 
 <0>Kernel panic: Attempted to kill init!

I put an `if (!sw) return;' in visual_init and the panic persists, so
it's not entirely obvious to me what's going on.  Someone more intimate
with the console system want to comment?

-- 
Revolutions do not require corporate support.

^ permalink raw reply	[flat|nested] 20+ messages in thread
[parent not found: <20020717165538.D13352@parcelfarce.linux.theplanet.co.uk.suse.lists.linux.kernel>]
* Re: 2.5.26 broken on headless boxes
@ 2002-07-18 21:04 Petr Vandrovec
  2002-07-18 21:18 ` Matthew Wilcox
  0 siblings, 1 reply; 20+ messages in thread
From: Petr Vandrovec @ 2002-07-18 21:04 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: jsimmons, linux-kernel

On 18 Jul 02 at 21:32, Matthew Wilcox wrote:
> On Thu, Jul 18, 2002 at 01:18:57PM -0700, William Lee Irwin III wrote:
> > On Thu, Jul 18, 2002 at 02:29:46PM +0100, Matthew Wilcox wrote:
> > >>>EIP; c01b7695 <visual_init+85/e0>   <=====
> > >>>edx; f7906600 <END_OF_CODE+37502e5c/????>
> > >>>edi; c03dcc00 <vc_cons+0/fc>
> > >>>esp; c3d45e7c <END_OF_CODE+39426d8/????>
> > > Trace; c01b7773 <vc_allocate+83/140>
> > > Trace; c01baa25 <con_open+19/88>
> > > Trace; c01ac08c <tty_open+20c/394>
> > > Trace; c0145a83 <link_path_walk+683/874>
> > > Trace; c0144ed7 <permission+27/2c>
> > > Trace; c0146373 <may_open+5f/2ac>
> > > Trace; c013c33a <chrdev_open+66/98>
> > > Trace; c013b001 <dentry_open+e1/1b0>
> > > Trace; c013af16 <filp_open+52/5c>
> > > Trace; c013b307 <sys_open+37/74>
> > > Trace; c0108893 <syscall_call+7/b>
> > 
> > This is the 4th one of these I've seen in the last two days. Any chance
> > of being able to compile with -g and get an addr2line on the EIP? I've
> > tried to reproduce it myself, but haven't gotten it to happen yet.
> 
> seems fairly obvious what's happening with a couple of printks...
> 
>     printk("visual_init: sw = %p, conswitchp = %p, currcons = %d, init = %d\n",
>                     sw, conswitchp, currcons, init);
> 
> gets me the interesting fact that sw & conswitchp are both NULL.
> later on, we call:
>     sw->con_init(vc_cons[currcons].d, init);
> which seems like it would be the exact cause, no?
> 
> now whether putting a:
> 
>     if (!sw)
>         return;
> 
> call into visual_init or whether we should determine earlier never to
> call visual_init, I don't know.  The people who know about the console
> have been conspicuously silent so far...

You have enabled CONFIG_VT without CONFIG_VGA_CONSOLE and 
CONFIG_DUMMY_CONSOLE. It is illegal configuration.

To fix oopses, either enable 'Framebuffer devices' under 'Console
drivers' section (you do not have to enable any fbdev driver, just
check this option...), or disable CONFIG_VT. See arch/*/kernel/setup.c
for explanation, no code in VT subsystem kernel expects conswitchp == NULL,
but couple of architectures leaves sometime conswitchp uninitialized.

It would be possible to add error return path to visual_init, but
I think that adding

  conswitchp = &dummy_con;
+ #else
+ #error No console defined with CONFIG_VT enabled
  #endif
  #endif

at the end of setup.c will work same way, as open of /dev/tty* will
never suceed with your config with added error path anyway.
                                            Best regards,
                                                Petr Vandrovec
                                                vandrove@vc.cvut.cz
                                                

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: 2.5.26 broken on headless boxes
@ 2002-07-18 21:42 Petr Vandrovec
  2002-07-18 21:45 ` Matthew Wilcox
  0 siblings, 1 reply; 20+ messages in thread
From: Petr Vandrovec @ 2002-07-18 21:42 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: jsimmons, linux-kernel

On 18 Jul 02 at 22:18, Matthew Wilcox wrote:
> On Thu, Jul 18, 2002 at 11:04:54PM +0200, Petr Vandrovec wrote:
> > You have enabled CONFIG_VT without CONFIG_VGA_CONSOLE and 
> > CONFIG_DUMMY_CONSOLE. It is illegal configuration.
> 
> Huh.  So CONFIG_VT_CONSOLE is not enough any more?  I really do think
> this should be documented in Config.help.

CONFIG_VT_CONSOLE works other way around. If you set CONFIG_VT_CONSOLE,
/dev/console can be displayed on your VTs (on your screen).

CONFIG_VGA_CONSOLE/CONFIG_DUMMY_CONSOLE determines whether your VT can
be created at all - maybe _CONSOLE suffix is misleading - without
having at least one displaying device virtual terminals cannot be build.
I always thought that CONFIG_DUMMY_CONSOLE cannot be unset, but
apparently it can...

And BTW, when such configuration worked for you last time? It does not
look to me like that it should ever work.

> > To fix oopses, either enable 'Framebuffer devices' under 'Console
> > drivers' section (you do not have to enable any fbdev driver, just
> > check this option...), or disable CONFIG_VT. See arch/*/kernel/setup.c
> > for explanation, no code in VT subsystem kernel expects conswitchp == NULL,
> > but couple of architectures leaves sometime conswitchp uninitialized.
> 
> well, this is on x86 ...
                                                    Petr Vandrovec
                                                    vandrove@vc.cvut.cz
                                                    

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: 2.5.26 broken on headless boxes
@ 2002-07-18 22:16 Petr Vandrovec
  2002-07-18 22:20 ` Arnaldo Carvalho de Melo
  2002-07-18 23:01 ` James Simmons
  0 siblings, 2 replies; 20+ messages in thread
From: Petr Vandrovec @ 2002-07-18 22:16 UTC (permalink / raw)
  To: willy; +Cc: jsimmons, linux-kernel

On 18 Jul 02 at 22:45, Matthew Wilcox wrote:
> On Thu, Jul 18, 2002 at 11:42:18PM +0200, Petr Vandrovec wrote:
> > CONFIG_VGA_CONSOLE/CONFIG_DUMMY_CONSOLE determines whether your VT can
> > be created at all - maybe _CONSOLE suffix is misleading - without
> > having at least one displaying device virtual terminals cannot be build.
> > I always thought that CONFIG_DUMMY_CONSOLE cannot be unset, but
> > apparently it can...
> > 
> > And BTW, when such configuration worked for you last time? It does not
> > look to me like that it should ever work.
> 
> erm, 2.5.25 worked, and i didn't change the .config between 2.5.25 and
> 2.5.26 (just ran make oldconfig).

Got it. It was introduced in console.c:1.13 change from jsimmons. Before
this change we did not registered tty driver:

con_init says:
  const char* display_desc = NULL;
  if (conswitchp) display_desc = conswitchp->con_startup();
  if (!display_desc) {
     fg_console = 0;
     return;
  }
  ...
  if (tty_register_driver(&console_driver)) ...

so we did not registered VT subsystem and panic did not happened:
instead of that you got 'cannot open initial console' or something
like that...

But after change tty_register_driver is invoked (through vty_init)
unconditionally from tty_io.c, where it depends only on CONFIG_VT.

So quick untested fix is 

--- a/drivers/char/console.c	Tue Jul 16 01:22:31 2002
+++ b/drivers/char/console.c	Fri Jul 19 00:12:01 2002
@@ -2487,6 +2487,9 @@
 
 int __init vty_init(void)
 {
+	if (!conswitchp) {
+		return 0;
+	}
 	memset(&console_driver, 0, sizeof(struct tty_driver));
 	console_driver.magic = TTY_DRIVER_MAGIC;
 	console_driver.name = "vc/%d";

But I'll leave final decision at James, maybe he want to support 
VT without underlying console, and testing almost same condition
on two places looks suspicious to me. Either we need blank timer
and console, or do not. But registering one half in vty_init,
and second half in con_init?
                                            Best regards,
                                                Petr Vandrovec
                                                  

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2002-07-19  9:42 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-17 15:55 2.5.26 broken on headless boxes Matthew Wilcox
2002-07-18  1:06 ` William Lee Irwin III
2002-07-18  9:48   ` Re[3]: " Tobias Rittweiler
2002-07-18 10:46     ` William Lee Irwin III
2002-07-18 12:29       ` Re[2]: " Tobias Rittweiler
2002-07-18 20:17         ` William Lee Irwin III
2002-07-18 13:29   ` Matthew Wilcox
2002-07-18 20:18     ` William Lee Irwin III
2002-07-18 20:32       ` Matthew Wilcox
2002-07-18 20:37         ` William Lee Irwin III
     [not found] <20020717165538.D13352@parcelfarce.linux.theplanet.co.uk.suse.lists.linux.kernel>
2002-07-18 12:45 ` Andi Kleen
2002-07-18 23:07   ` James Simmons
2002-07-19  9:45     ` Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2002-07-18 21:04 Petr Vandrovec
2002-07-18 21:18 ` Matthew Wilcox
2002-07-18 21:42 Petr Vandrovec
2002-07-18 21:45 ` Matthew Wilcox
2002-07-18 22:16 Petr Vandrovec
2002-07-18 22:20 ` Arnaldo Carvalho de Melo
2002-07-18 23:01 ` James Simmons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox