Modern operating systems have protected memory mechanisms where the CPU does special things depending on memory ranges (generally split up into coarse-grained blocks, such as 1k, 4k or 8k blocks).
-
-
Replying to @mcclure111 @lorenschmidt
In the most primitive of these cases (Mac OS 9, Windows 98) this took the form of "guard pages" where the OS designer predicted certain ranges a faulty memory access would be unusually likely to fall into (page 0, before/after a process space) and trigger a crash on read/write.
1 reply 0 retweets 7 likes -
Replying to @mcclure111 @lorenschmidt
In actually modern OSes, this takes the form of a "virtual memory" model where each process has an independent address space. The process-local address space is cut up into pages (1k, 4k, 8k blocks); each of these pages either maps to a real memory range, or…
1 reply 0 retweets 4 likes -
Replying to @mcclure111 @lorenschmidt
…is "paged out" to disk, meaning when it is accessed the OS halts the process, copies the page from disk into real memory and then maps it to the new real memory block; or it corresponds to nothing at all and the OS terminates the process.
1 reply 0 retweets 4 likes -
Replying to @mcclure111 @lorenschmidt
Certain choices in the C (or other OS) memory model can make it more likely an array overrun or underrun will result in early termination rather than bad behavior. Most programs have a single large contiguous block they allocate arrays out of. However, another option is to…
1 reply 0 retweets 2 likes -
Replying to @mcclure111 @lorenschmidt
…have each array have its own pages allocated (all modern OSes offer ways to do this) just for itself. If the array's length happens to be an exact multiple of the page length, effectively this array has "guard pages" & an overrun/underrun will trigger a virtual memory failure
1 reply 0 retweets 3 likes -
Replying to @mcclure111 @lorenschmidt
Some programming languages (such as C#) have an additional safety feature where if you read or write to an array, it specifically runs code to check the index is valid. This is slightly slower but the only real way to guarantee safety…
2 replies 0 retweets 3 likes -
Replying to @mcclure111 @lorenschmidt
…and in general it is easier to recover from than a virtual memory failure.
2 replies 0 retweets 4 likes -
Replying to @mcclure111 @lorenschmidt
So in general, if you are in that first category of halts, a good general term would be a protected memory violation, which encompasses UNIX "segmentation faults" or Windows "illegal operations" or "general protection faults".
1 reply 0 retweets 5 likes -
Replying to @mcclure111 @lorenschmidt
If you're in the latter, C#-y category, I'd use a phrase like an array bounds exception or an array bounds assert failure. In any of these cases, "out of bounds error", "array bounds error" or "array overrun"/"array underrun" well communicate whatever the important issues are.
2 replies 0 retweets 9 likes
I have a bs in comp sci and didn't know some of this stuff. Thanks for being so smart!
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.