Access violation read error

Discussion in 'C Programming' started by loumbut5, Nov 16, 2016.

  1. loumbut5

    loumbut5

    Joined:
    Oct 12, 2016
    Messages:
    2
    Likes Received:
    0
    Hi, I am trying to build a win32 dynamic library to use in my API but have encountered the following error during run time...

    Code (Text):
    Access violation read to 0x000032EA
    I have managed to trace the error back to the file verilated.cpp included in my VC++ 2015 project.

    The file was created as part of a Linux freeware called verilator which I have migrated to Windows.

    The error occurs in line 237 of the file and my VC++ generates the following warning when running code analysis...

    Code (Text):
    Warning    C6385    Reading invalid data from 'vn':  the readable size is '68' bytes, but '-8' bytes may be read.
    The exact code is...
    Code (Text):
    vluint64_t qhat = unw64 / (vluint64_t)(vn[vw-1]);
    The problem seems to stem from the term
    Code (Text):
    vn[vw-1]
    Please find the file attached and suggest a fix.

    Thanks.
     

    Attached Files:

    loumbut5, Nov 16, 2016
    #1
    1. Advertisements

  2. loumbut5

    loumbut5

    Joined:
    Oct 12, 2016
    Messages:
    2
    Likes Received:
    0
    Turns out all I had to do was include the line
    Code (Text):
    _assume(vw >= 2);
    After line 241 in the code and the warning is fixed.
     
    loumbut5, Nov 17, 2016
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.