[Prev][Next][Index][Thread]

Possible bug in netboot



I have noticed that in somes circumstances, oskit_init_libc() in
liboskit_freebsd_c crashes netboot.

To reproduce the problem :
-------------------------
You need :
- oskit 0.97
- netboot compiled with all the ethernet drivers (no customization done in
linux_ethernet.h)
- a kernel witch is just :
  int main(int argc, char *argv[])
  {
  oskit_init_libc();
  }
  and is linked with liboskit_freebsd_c.a :
  (-loskit_kern -loskit_freebsd_c -loskit_com -loskit_kern -loskit_lmm )

Do the following :
1/ boot netboot
2/ launch the kernel from within netboot

The results:
- the kernel runs fine
- netboot regains control and begin to re-initialize
- then crashed somewhere in the middle of EISA_signature in de4x5.c

The beginning of an explanation
-------------------------------
oskit_init_libc() calls signals_init() which calls libc_sendsig_init()
which calls libc_sendsig_init() which calls oskit_sendsig_init() which does
set_b1(NULL, DR7_LEN_4, DR7_RW_DATA); 
The comments says :
/*
 * Set up the debug registers to catch null pointer references.
 */

This is where the problem lies. When regaining control, netboot runs with
the modified values of the debug registers and traps.

What I have done
----------------
1/ In the kernel, I have saved the debug register before oskit_init_libc()
and restored them just before exit. The problem disappeared.

2/ I have customized linux_ethernet.h to generate a version of netboot 
with only one ethernet driver (there is no longer de3x4.c)
Again the problem disappeared.

So, I am happy, but may be someone will want to investigate further.

-- 
Amicalement,

-------------------------------------------------------------------------------
Bernard Cassagne                 Laboratoire CLIPS - IMAG
Domaine Universitaire       BP 53         38041 Grenoble CEDEX 9         FRANCE
tel: 04.76.51.46.14     fax: 04.76.44.66.75     e-mail:Bernard.Cassagne@imag.fr