25 ms·
I sent a friend xanderjanz's TL;DR and a link, and he replied: > I have to admit I don't know much about stocks, but the grammar of those sentences hints that
by SonOfLilit 11y ago
I sent a friend xanderjanz's TL;DR and a link, and he replied:
> I have to admit I don't know much about stocks, but the grammar of those sentences hints that this was a C++ problem of misusing pointers :)
My response below, with a warning that if you're not a low level programming geek you should probably not even try to read it:
Actually, it's more like a C# problem of misusing non-pinned-pointers, where the generational garbage collector isn't aware that some invoked C library holds a pointer to something and happily moves it around in memory, and then the C library segfaults.
This is the full story:
Some laws were written under the assumption that owning stock is like calling VirtualAlloc(), but in the 70s there was a paperwork crisis (too many calls to allocate and free pages, the system grinded to a halt) and the US government wrote an stdlib malloc(), which everyone's been using.
There are legacy libraries (laws) written under the assumption that "owning memory" means that the OS page table marks this page as yours, but it's silly because now all pages are marked as malloc()'s. There is case law (bugfix patches) to try and make some sense of it, but in this case malloc() had to free() most of a large allocation but keep some of it allocated and a legacy library that remembers and compares page region base pointers (changed, because most of the large region was free()d) and doesn't look at the malloc() allocation lists (where there was no change in ownership) decided that this memory no longer refers to the same stuff and declined to provide services to it (specifically, a service called "appealing appraisal" that would net the owner of that memory a lot of money).
The CPU (the judge) said he knows this code is buggy and it's not what the user OR the programmer wanted, but he's only the CPU and all he can do is execute the buggy code, and someone please call a programmer (Congress) to fix this code.