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

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.
Similar Threads
  1. news
    Replies:
    0
    Views:
    633
  2. F. Prefect
    Replies:
    5
    Views:
    1,521
    Steven Cheng[MSFT]
    Oct 10, 2004
  3. Boogie El Aceitoso
    Replies:
    5
    Views:
    651
    Josh Sebastian
    Oct 1, 2003
  4. muser

    Access violation error

    muser, Oct 27, 2003, in forum: C++
    Replies:
    10
    Views:
    786
    lilburne
    Nov 7, 2003
  5. Bit byte

    Memory (read) access violation handling in C

    Bit byte, Jun 18, 2006, in forum: C Programming
    Replies:
    4
    Views:
    872
    Dave Thompson
    Jun 26, 2006
  6. marvind
    Replies:
    4
    Views:
    654
    Paul Groke
    Jul 14, 2005
  7. DH
    Replies:
    1
    Views:
    671
    Dave Angel
    Aug 6, 2009
  8. HighBeliever
    Replies:
    0
    Views:
    289
    HighBeliever
    Jul 4, 2013
Loading...