Opened 9 years ago

Closed 9 years ago

#17 closed defect (fixed)

Audio: Failed to attach to driver

Reported by: Valery V. Sedletski Owned by: Valery V. Sedletski
Priority: major Milestone: Enhanced
Component: Common Tasks Keywords:
Cc:

Description (last modified by Valery V. Sedletski)

When trying to start the VM with an audio driver enabled, got a trap in VBoxDD.dll (src\VBox\Devices\Audio\DrvAudio.cpp, line 1797, function drvAudioDestruct()):

        pThis->pHostDrvAudio->pfnControlIn(pThis->pHostDrvAudio, pHstStrmIn, PDMAUDIOSTREAMCMD_DISABLE);
        pThis->pHostDrvAudio->pfnFiniIn(pThis->pHostDrvAudio, pHstStrmIn);
    }

    if (pThis->pHostDrvAudio->pfnShutdown) // << ==== Access violation
        pThis->pHostDrvAudio->pfnShutdown(pThis->pHostDrvAudio);

    LogFlowFuncLeave();
}

This is because of pThis->pHostDrvAudio == NULL, then trying to dereference this pointer, without a check for validness.

This is after the drvAudioConstruct() failed in PDMDrvHlpAttach():

    /*
     * Attach driver below and query its connector interface.
     */
    PPDMIBASE pDownBase;
    int rc = PDMDrvHlpAttach(pDrvIns, fFlags, &pDownBase);
    if (RT_FAILURE(rc))
    {
        LogRel(("Audio: Failed to attach to driver %p below (flags=0x%x), rc=%Rrc\n",
                pDrvIns, fFlags, rc));
        return rc;
    }

The log piece:

....
00:00:53.733965 PIIX3 ATA: LUN#0: disk, PCHS=4161/16/63, total number of sectors 4194304
00:00:53.734224 DrvBlock: Flushes will be ignored
00:00:53.734231 DrvBlock: Async flushes will be passed to the disk
00:00:53.734637 VD: Opening the disk took 354601 ns
00:00:53.734870 PIIX3 ATA: LUN#1: CD/DVD, total number of sectors 141411, passthrough disabled
00:00:53.734974 PIIX3 ATA: LUN#2: no unit
00:00:53.734982 PIIX3 ATA: LUN#3: no unit
00:00:53.735797 PIIX3 ATA: Ctl#0: finished processing RESET
00:00:53.740468 PIIX3 ATA: Ctl#1: finished processing RESET
00:00:54.061154 Audio: Failed to attach to driver 0560c850 below (flags=0x0), rc=VERR_PDM_CFG_MISSING_DRIVER_NAME

The call stack:

 vmR3CreateU(UVM*, unsigned, int (*)(UVM*, VM*, void*), void*)
 vmR3InitRing3(VM*, UVM*)
 PDMR3Init
 pdmR3DevInit
 hdaConstruct(PDMDEVINS*, int, CFGMNODE*)
 hdaAttach(PDMDEVINS*, unsigned, unsigned)
 pdmR3DevHlp_DriverAttach(PDMDEVINS*, unsigned, PDMIBASE*, PDMIBASE**, char
 pdmR3DrvInstantiate
 pdmR3DrvDestroyChain
 drvAudioDestruct(PDMDRVINS*)

The driver appears to be MMPM2 (not sure if it is fully implemented, so disabled for now, then got the following error in the next ticket #18)

Change History (5)

comment:1 by Valery V. Sedletski, 9 years ago

Description: modified (diff)

comment:2 by Valery V. Sedletski, 9 years ago

The popuplog.os2 entry:

09-02-2015  20:14:57  SYS3175  PID 0099  TID 0008  Slot 00d2
L:\SRC\VBOX\OUT\OS2.X86\RELEASE\BIN\VBOXHEADLESS.EXE
c0000005
1cc63541
P1=00000001  P2=00000004  P3=XXXXXXXX  P4=XXXXXXXX
EAX=00000000  EBX=0560c930  ECX=0560c930  EDX=00000000
ESI=00000000  EDI=00000000
DS=0053  DSACC=f0f3  DSLIM=ffffffff
ES=0053  ESACC=f0f3  ESLIM=ffffffff
FS=150b  FSACC=00f3  FSLIM=00000030
GS=0000  GSACC=****  GSLIM=********
CS:EIP=005b:1cc63541  CSACC=f0df  CSLIM=ffffffff
SS:ESP=0053:02cffad0  SSACC=f0f3  SSLIM=ffffffff
EBP=02cffae8  FLG=00010246

VBOXDD.DLL 0001:000f3541

comment:3 by diver, 9 years ago

Milestone: VBox driverEnhanced

comment:4 by Valery V. Sedletski, 9 years ago

I changed the default audio driver from unimplemented MMPM driver to Null one, so the above trap is fixed for now (see r91). This is until we create a real OS/2 host side audio backend (based on libkai, probably).

Version 0, edited 9 years ago by Valery V. Sedletski (next)

comment:5 by Valery V. Sedletski, 9 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.