none
Access violation issues - usbser RRS feed

  • Question

  • Hi

    I am using usbser in my design and am intermittently, I am observing some intermittent "access violation" issues. It seems to me that within the driver, occasionally it ends up calculating an address which it is not supposed to access. Currently, I am not sure how to debug further and fix this problem.

    My platform is x86 running WinCE 6.0 R3.

    For reference, I am copying the relavant code below from usbse:

    BOOL SerialDataIn::ReceiveInterruptHandler(PUCHAR pRxBuffer,ULONG *pBufflen)
    {
    ...
    ...
    ...
    
          if (m_dwSegDataOffset[m_dwCurIndex] < m_dwSegDataDataLen[m_dwCurIndex] ){ // We have Extra.
            DWORD dwCopyLen = min (dwBufferSize, m_dwSegDataDataLen[m_dwCurIndex] - m_dwSegDataOffset[m_dwCurIndex]) ;
    
    //
    // THE ACCESS VIOLATION ISSUE OCCURS HERE
    //
            memcpy(pRxBuffer,m_VirtualAddress + (m_dwSegmentSize*m_dwCurIndex + m_dwSegDataOffset[m_dwCurIndex]) ,dwCopyLen);
            *pBufflen = dwCopyLen;
            m_dwSegDataOffset[m_dwCurIndex] += m_dwSegDataOffset[m_dwCurIndex];
            bReturn = TRUE;
          }
    
    }

    I would appreciate if somebody could give some pointers on what could be happening here.

    Thanks,

    Shani

     

    Thursday, June 17, 2010 4:49 PM

All replies

  • Just for reference, the source code for this driver is here:

    C:\WINCE600\PUBLIC\COMMON\OAK\DRIVERS\USB\CLASS\USBSER

     

    Thanks,

    Shani

    Friday, June 18, 2010 8:28 AM