I’m using a 64-bit build of Sublime Text 3143 on Windows 7, and occasionally the editor hangs when connecting to my desktop session through Windows Remote Desktop. In particular, the UI thread gets stuck in a loop while performing some floating-point operations. The pseudocode of the loop at sub_13F9E70C0
is as follows:
int __attribute__((ms_abi)) sub_13F9E70C0(double a1, double a2, double a3, int a4) {
char v5;
int result;
v5 = sub_13F9E6EF4(a1, a2, a3, a4);
do {
a1 = a1 + 0.03333333333333333;
result = sub_13F9E6EF4(a1, a2, a3, a4);
} while ( (char)result == v5 );
return result;
}
int __attribute__((ms_abi)) sub_13F9E6EF4(double a1, double a2, double a3, int a4) {
...
double v18 = floor(v8 * 255.0 + 0.5);
result = (int)v18 & 0xF0;
if ( (char)(int)v18 == -1 )
result = (unsigned char)(int)v18;
return result;
}
The problem is that in sub_13F9E6EF4
, v18 = 255.0
, so (char)(int)v18 == -1
is true, and 255
is returned. Then, in sub_13F9E70C0
, v5 = 255
, so (char)result == 255
is true, and the loop endlessly repeats. At the top level, this loop is called (through some intermediate functions) from a timer callback managed by SetTimer()
/KillTimer()
.
I suspect this has something to do with the operating system changing the size of the virtual desktop when I connect, and it’s triggering some floating-point instability (or a logic error involving v18
) in UI-related code.
Let me know if you need more information. I have a crash dump available, but I’m not willing to post it publicly.