Subject: XF430 debugging advice needed
To: None <tech-x11@netbsd.org>
From: David Hopper <dhop@nwlink.com>
List: tech-x11
Date: 03/02/2003 14:13:12
Hi all,

I've patched up alpha_video.c to build, but I've hit a snag in the new scanpci 
code in XFree86 4.3.0 on Alpha.  Even just a nudge in the right direction 
would be appreciated:

Program received signal SIGSEGV, Segmentation fault.
0x12026a1b0 in pciReadLong (tag=0, offset=0) at Pci.c:282
282       if ((bus >= 0) && ((bus < pciNumBuses) || inProbe) && pciBusInfo[bus] &&
(gdb) bt
#0  0x12026a1b0 in pciReadLong (tag=0, offset=0) at Pci.c:282
#1  0x12026af2c in pciGenFindNext () at Pci.c:717
#2  0x12026b160 in pciGenFindFirst () at Pci.c:804
#3  0x12026a0c8 in pciFindFirst (id=0, mask=0) at Pci.c:258
#4  0x12026b3f0 in xf86scanpci (flags=0) at Pci.c:938
#5  0x1202213bc in FindPCIVideoInfo () at xf86pciBus.c:164
#6  0x120225804 in xf86PciProbe () at xf86pciBus.c:1666
#7  0x12021afd8 in xf86BusProbe () at xf86Bus.c:88
#8  0x120215ee8 in InitOutput (pScreenInfo=0x120909180, argc=1,
     argv=0x1fffff680) at xf86Init.c:353
#9  0x1202ccf84 in main (argc=1, argv=0x1fffff680, envp=0x1fffff378)
     at main.c:361

Variables are as follows:

bus = 0
pciNumBuses = 1
inProbe = 1
pciBusInfo[bus] = (pciBusInfo_t *) 0x120849d70

(gdb) display pciBusInfo[bus]->funcs->pciReadLong
5:  pciBusInfo[bus]->funcs->pciReadLong = (CARD32 (*)()) Error accessing 
memory address 0x0: Invalid argument.
Disabling display 5 to avoid infinite recursion.

---xsrc/xfree/xc/programs/Xserver/hw/xfree86/scanpci/Pci.c:

pciReadLong(PCITAG tag, int offset)
{
   int bus = PCI_BUS_FROM_TAG(tag);

#ifdef DEBUGPCI
   ErrorF("pciReadLong(0x%lx, %d)\n", tag, offset);
#endif
   pciInit();

   if ((bus >= 0) && ((bus < pciNumBuses) || inProbe) && pciBusInfo[bus] &&
         pciBusInfo[bus]->funcs->pciReadLong) {
     CARD32 rv = (*pciBusInfo[bus]->funcs->pciReadLong)(tag, offset);

     PCITRACE(1, ("pciReadLong: tag=0x%x [b=%d,d=%d,f=%d] returns 0x%08x\n",
                  tag, bus, PCI_DEV_FROM_TAG(tag), PCI_FUNC_FROM_TAG(tag), rv));
     return(rv);
    }

   return(PCI_NOT_FOUND);
}

---

Thanks v.v. much,
Dave