genksyms crashes on drivers/char/joystick/pcigame.c

Adam Lackorzynski (adam@os.inf.tu-dresden.de)
Tue, 1 Apr 2003 17:19:18 +0200


Hi,

when genksyms is used on drivers/char/joystick/pcigame.c during "make
dep" it segfaults. There isn't any joystick configuration in the kernel
(it's a plain "make oldconfig" from a fresh kernel copy).

/tmp/linux-2.4.20/drivers/char/joystick$ gcc -Wall -O2 -I/tmp/linux-2.4.20/include -E -D__GENKSYMS__ pcigame.c| genksyms -p smp_ -k 2.4.20
Segmentation fault

$ genksyms -V
genksyms version 2.4.25
...

It looks like the segfault is caused by the following line from the gcc
output above:

struct pcigame *((void *)0)
{
struct pcigame *pcigame;
int i;

which evaluates from

struct pcigame *pcigame_attach(struct pci_dev *dev, int type)
{
struct pcigame *pcigame;
int i;

pcigame_attach(a,b) is defined to NULL in include/linux/pci_gameport.h if
CONFIG_INPUT_PCIGAME{,_MODULE} isn't set (which is the case here).
Fixing this line makes genksyms work. Don't know who's at fault here but
segfaulting doesn't look good...

Adam

-- 
Adam                 adam@os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/