Hi folks,
 
I've just compiled 4.3.99.902  on my PC runing NetBSD-current. As with previous versions of XFree86 I found that the VIA driver still crashes due to a problem with the VIAFindModeUseBIOSTable() function in via_bios.c. This function uses a field that is not initialized:
 
   /* Default settings have not been loaded, they must be
       obtained from the BIOS */
    pBIOSInfo->pUTUSERSETTING->DefaultSetting = FALSE;
 
When I try to start X the value of pBIOSInfo->pUTUSERSETTING is NULL. This causes a segmentation fault. I can't find any initialization at all of this field in the code, so I tried to allocate memory to the field:
 
*** via_driver.c.org    Sat Dec 20 14:43:24 2003
--- via_driver.c        Sat Dec 20 14:16:49 2003
***************
*** 449,454 ****
--- 449,456 ----
          xnfcalloc(sizeof(VIABIOSInfoRec), 1);
      ((VIARec *)(pScrn->driverPrivate))->pBIOSInfo->pModeTable =
          xnfcalloc(sizeof(VIAModeTableRec), 1);
+     ((VIARec *)(pScrn->driverPrivate))->pBIOSInfo->pUTUSERSETTING =
+         xnfcalloc(sizeof(UTUSERSETTING), 1);
 
      /* initial value in VIARec */
      ((VIARec *)(pScrn->driverPrivate))->SavedReg.mode = 0xFF;
 
With this, the Xserver starts and it seems to work. OK, I still have some problems when exiting X.
 
I don't know if this is the right way to solve this problem, but it is easy to understand that the server crashes without some form of initialization of this field.
 
- Jan


Reply via email to