Re: [Audacity-devel] Crash on launch
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
|
From: James C. <cr...@in...> - 2018-06-06 09:09:19
|
On 05/06/2018 23:37, Henric Jungheim wrote: > TL;DR: Parameter type mismatches in variadic functions can > cause trouble. > > As long as the size of the arguments match, and the numbers > are small, then yes. (Some pedants might point out that > this assumes more than the language standard guarantees. I > would ask them to point to an example of an actual > production CPU, that would otherwise be capable of running > Audacity, where that is not a valid assumption.) > > More serious problem can arise depending on the argument > passing conventions and the size of those arguments. A > little-endian number read as 32 bits when it really is 64 > bits should get the right output for that parameter, but may > cause future parameters to be misaligned (e.g., treating the > second 32-bits of the first number as part of the second > parameter). Getting things sufficiently wrong can cause > segfaults and other such fun. How bad things get can also > depend on if an argument is on the stack or in a register > (e.g., the first four parameters could be in registers, the > rest on the stack). > > Do any of the supported platforms have a 32-bit size_t but a > 64-bit long? Do any have a 64-bit size_t, but 4-byte stack > parameter alignment? Are there any with a 64-bit size_t and > a 32-bit long that are big endian? > > Windows on x86 should be okay because both size_t and long > are 32-bits. > > Since Windows on x64 and ARM64 is little-endian, it should > be okay as long as the actual value to be displayed is < > 2^31. The upper half of the register or stack location > would be ignored. Subsequent parameters would be fine, > assuming that the stack parameters are aligned to at least 8 > bytes (and, IIRC, they are). > > The cross product of MIPS, ARM, and [insert your favorite > obscure architecture here] with big-endian vs little-endian > might find certain combination where this is not be okay. > > BTW, will Audacity 2.3.0 officially support any non-Intel > architectures? This would only be relevant for Linux, > right? People do compile for Raspberry PI, but is that > officially supported or just "nice that it works"? 2.3.0 will only officially support Intel architecture. That it compiles on a Raspberry PI is a 'nice that it works'. > I did get Audacity to compile for Windows on ARM64 a while > back, but I'll wait for the second generation devices later > this year to see if it works (more likely, to see how it > fails, and then try to get it working); the $700 for a > first-gen Snapdragon 835 system exceeds my curiosity > threshold. > |