I wanted to report a bug to Xojo, but I am working with Xojo 2017.2.1, whereas the bug reporter requires at least 2017.3. So I have to report it here I think.
When quitting my application on Mac, I got an EXC_BAD_ACCESS. I think the error happened at the following level:
0 XojoFramework 0x0000000105ae1928 RuntimeControlInvalidate + 31
The application first triggers a timer which calls a method. The method calls another method which makes some queries. At the end of this method there is a Canvas.Invalidate instruction, and I guess that the application crashed at that point. The crash happened only once until now. The timer runs every 2 seconds.
The exception code which I get is EXC_I386_GPFLT, which apparently means General Protection Fault, and it seems to be related to the way my application is built, which is 64-bit.
In a forum I read the following explanation:
[i]If it is a 64-bit system, a plausible scenario is that your code is using a “non-canonical pointer” - meaning that a 64-bit address is formed in such a way that the upper 16 bits of the address aren’t all copies of the top of the lower 48 bits (in other words, the top 16 bits of an address should all be 0 or all 1, based on the bit just below 16 bits). This rule is in place to guarantee that the architecture can “safely expand the number of valid bits in the address range”. This would indicate that the code is either overwriting some pointer data with other stuff, or going out of bounds when reading some pointer value.
Another likely cause is unaligned access with an SSE register - in other words, reading a 16-byte SSE register from an address that isn’t 16-byte aligned.
There are, as I said, many other possible reasons, but most of those involve things that “normal” code wouldn’t be doing in a 32- or 64-bit OS (such as loading segment registers with invalid selector index or writing to MSR’s (model specific registers)).[/i]