![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Programmer
Join Date: Feb 2006
Location: Ohio
Posts: 93
Rep Power: 3
![]() |
Re: Read Access Violation
Thanks
![]()
__________________
Neeley.org |
|
|
|
|
|
#12 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,223
Rep Power: 5
![]() |
Re: Read Access Violation
Quote:
Laying out a program out in memory so it is possible to detect invalid memory accesses is expensive: results in a program that uses more memory, runs slower, etc, etc. Compiler/linker writers tend to be pressured by developers to produce "efficient" code so they normally do things by assuming code does not do memory overruns. Since the difference, performance wise, can be orders of magnitude, there is a lot of pressure on compiler writers to err on the side of performance at the cost of failing to detect all potential errors. This means that the layout of variables (or structures or dynamically allocated memory) is not designed to detect overruns. Two unrelated variables A and B may be placed placed adjacent in memory because that happens to be the "optimal" way of laying things out. Code which does an overrun while working with variable A can therefore overwrite variable B, but this will not be detected. If some other code comes along and accesses variable B, it will do something unintended and (probably) write wrong data somewhere else. These things tend to bubble along, until some confused code tromps an area of critical memory -- at which point an invalid access is detected and an error reported (eg exception is thrown). Products like Electric Fence work by laying out memory and other things so invalid memory accesses are more likely to be detected. In practice, they increase the odds of detecting invalid operations, but do not guarantee they will be detected. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 1 line if code blocks; easier to read | G.I.Josh | Perl | 5 | Nov 6th, 2007 11:30 PM |
| read access violation | backstabber | C++ | 14 | Oct 13th, 2006 3:54 PM |
| Access to private files. | Jhaqen | Java | 2 | Nov 2nd, 2005 2:35 PM |
| How to connect with VB to an Access database on another computer | iown714 | Visual Basic | 5 | Aug 4th, 2005 10:23 AM |
| Access Violation Error | cornish_boy84 | Delphi | 1 | Mar 1st, 2005 4:12 PM |