Thread: Finding access violations in the source

  1. #1
    Normal vector Carlos's Avatar
    Join Date
    Sep 2001
    Location
    Budapest
    Posts
    463

    Finding access violations in the source

    Hi!
    I've got a problem here (what a surprise! ).

    Given an access violation (address logged), there must be a way to find out where the problem is in the source code, isn't it?

    Do you know a tool, which shows the function/method from where this access violation comes,given the corresponding dlls and pdbs, and, of course, the source code?

    Thank you in advance!

    Have a nice code,
    Carlos

  2. #2
    Me want cookie! Monster's Avatar
    Join Date
    Dec 2001
    Posts
    680
    You don't need a tool, just debug the code (with printf statements or just step through your program with the debugger).

    In most cases the Access Violation is because you are reading from or writing to memory which you didn't allocate.

  3. #3
    Normal vector Carlos's Avatar
    Join Date
    Sep 2001
    Location
    Budapest
    Posts
    463
    I *do* know, why access violations happen .

    It's not a case you could easily debug...it's not about a homework, is a huge project, with many dlls and ocx-es.
    On the other side, the problem is sporadic, reproducing it might take days (trying to get the error for 3 days, haven't succeed yet).
    All I have is the log-file from our customer.

    I hope I made myself clear now...

  4. #4
    Me want cookie! Monster's Avatar
    Join Date
    Dec 2001
    Posts
    680
    Yes you made yourself clear. I had a simular problem last year (sporadic reset of machines). It took us about 8 months to find out what the problem was.

    I don't think you can use the address of the Access Violation because this is just some un-allocated memory.

  5. #5
    Normal vector Carlos's Avatar
    Join Date
    Sep 2001
    Location
    Budapest
    Posts
    463
    I don't think you can use the address of the Access Violation because this is just some un-allocated memory.
    Actually is not the address of the un-allocated memory, but the address of the problem-code.
    Given the pdb file and the source, it is possible to track the source.

    By the way, we found an adequate tool, the CrashFinder. Seems to be very useful!
    You can find it here

    You can find information about CrashFinder (provided by the author) here
    Last edited by Carlos; 11-20-2002 at 04:26 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. compiling and finding the source
    By cs32 in forum C Programming
    Replies: 3
    Last Post: 03-02-2008, 12:54 PM
  2. Source file inclusion
    By sh3rpa in forum C++ Programming
    Replies: 7
    Last Post: 10-02-2007, 11:10 AM
  3. Class methods in header or source file?
    By TriKri in forum C++ Programming
    Replies: 13
    Last Post: 09-17-2007, 05:23 AM
  4. starting linux's source code and kernel
    By sawer in forum Linux Programming
    Replies: 9
    Last Post: 08-01-2006, 07:46 AM
  5. access violations
    By curtner in forum C++ Programming
    Replies: 2
    Last Post: 11-02-2001, 01:32 AM