Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5990667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:16:37+00:00 2026-05-22T23:16:37+00:00

What tips can you share to help locate and fix access violations when writing

  • 0

What tips can you share to help locate and fix access violations when writing applications in Delphi?

I believe access violations are usually caused by trying to access something in memory that has not yet been created such as an Object etc?

I find it hard to identify what triggers the access violations and then where to make the required changes to try and stop/fix them.

A example is a personal project I am working on now. I am storing in TTreeView Node.Data property some data for each node. Nodes can be multiple selected and exported (the export iterates through each selected node and saves specific data to a text file – the information saved to the text file is what is stored in the nodes.data). Files can also be imported into the Treeview (saving the contents of the text files into the node.data).

The issue in that example is if I import files into the Treeview and then export them, it works perfect. However if I add a node at runtime and export them I get:

“Access Violation at address 00405772 in module ‘Project1.exe’. Read of address 00000388.”

My thoughts on that must be the way I am assigning the data to created nodes, maybe differently to the way I assign it when they are imported, but it all looks ok to me. The access violation only shows up when exporting, and this never happens with imported files.

I am NOT looking for a fix to the above example, but mainly advice/tips how to find and fix such type of errors. I don’t often get access violations, but when I do they are really hard to track down and fix.

So advice and tips would be very useful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:16:38+00:00Added an answer on May 22, 2026 at 11:16 pm

    It means your code is accessing some part of the memory it isn’t allowed to. That usually means you have a pointer or object reference pointing to the wrong memory. Maybe because it is not initialized or is already released.

    Use a debugger, like Delphi. It will tell you on what line of code the AV occurred. From there figure out your problem by looking at the callstack and local variables etc. Sometimes it also helps if you compile with Debug DCUs.

    If you don’t have a debugger because it only happens on a client side, you might want to use MadExcept or JclDebug to log the exception with callstack and have it send to you. It gives you less details but might point you in the right direction.

    There are some tools that might be able to find these kind of problems earlier by checking more aggressively. The FastMM memory manager has such options.

    EDIT

    “Access Violation at address 00405772
    in module ‘Project1.exe’. Read of
    address 00000388.”

    So your problem results in a AV at addresss 00405772 in module ‘Project1.exe’. The Delphi debugger will bring you to the right line of code (or use Find Error).

    It is trying to read memory at address 00000388. That is pretty close to 00000000 (nil), so that would probably mean accessing some pointer/reference to an array or dynamic array that is nil. If it was an array of bytes, it would be item 388. Or it could be a field of a rather large object or record with lots of fields. The object or record pointer/reference would be nil.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What tips can you give a person who is looking to write a programming
Can you suggest some ways/tips to decrease Resharper memory usage in VS 2008. Working
Does anyone have any tips or gotcha moments to look out for when trying
Greetings all, In my application,user can open several QWindows which share the same data.(save
I am trying to create a unique slug in Django so that I can
I'm trying to capture a video demo of my iPhone app so I can
Does anyone have any tips for dealing with ConstraintExceptions thrown by XSD datasets? This
What are some general tips to make sure I don't leak memory in C++
Do you have any tips for effective profiling using Netbeans? The profiler is quite
Does someone have any tips/advice on database design for a web application? The kind

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.