You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AECforWebAssembly v1.5 crashes if compiled with CLANG on Windows or Visual Studio C++ and is set to compile Analog Clock. It runs into Stack Overflow. Here is what the debugger in Visual Studio outputs:
So, the error appears to occur in Analog Clock program on line 358, when compiling the 60 token. convertToInteger64 calls compile, which in turns calls convertTo which again calls convertToInteger64. I do not think this loop is infinite, as the error disappears on CLANG if the program is compiled with -O3 (although I could be triggering some Undefined Behavior again leading to my program behaving unpredictably). But, obviously, the recursion runs deep enough to cause Stack Overflow in some cases under some compilers.
This problem appears not to exist (or at least obviously show up, if my C++ code is again triggering some undefined behavior as the parsing code once used to) under any version of GCC, be it under Windows, Linux or FreeDOS.
The text was updated successfully, but these errors were encountered:
A Discord user called @zero9178 commented the following:
Do you know what a stackoverflow is? Chances are you got a recursive function and/or some very large objects that causes your stack to overflow. Optimizations will make the code and functions and such smaller hence it working when using optimizations. Debuggers should halt on stack overflow, check the recursive functions there. If it's easy, try turning the recursive algorithm into an iterative one, otherwise try reducing the size of some classes or allocate some things on the heap. Hard to tell where the issue is. There is also -fstack-usage in GCC that will tell you how many bytes a function occupies
Should help with the search
Perhaps we can at least make the problem less severe by outputting a sensible error message in that case. I have started a forum thread asking how to do that: https://atheistforums.org/thread-63150.html
I have tweaked it into working when compiled using CLANG on Windows, but I still have not managed to make it work if compiled using Visual Studio: 8e70e2f
Unfortunately, I just tried compiling AECforWebAssembly with the latest version of Emscripten, and I get the same "Stack Overflow" error when compiling the Analog Clock program. This time, compiling with -O3 optimisation does not help.
AECforWebAssembly v1.5 crashes if compiled with CLANG on Windows or Visual Studio C++ and is set to compile Analog Clock. It runs into Stack Overflow. Here is what the debugger in Visual Studio outputs:
So, the error appears to occur in Analog Clock program on line 358, when compiling the
60
token.convertToInteger64
callscompile
, which in turns callsconvertTo
which again callsconvertToInteger64
. I do not think this loop is infinite, as the error disappears on CLANG if the program is compiled with-O3
(although I could be triggering some Undefined Behavior again leading to my program behaving unpredictably). But, obviously, the recursion runs deep enough to cause Stack Overflow in some cases under some compilers.This problem appears not to exist (or at least obviously show up, if my C++ code is again triggering some undefined behavior as the parsing code once used to) under any version of GCC, be it under Windows, Linux or FreeDOS.
The text was updated successfully, but these errors were encountered: