]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
examples : fix WASM Stack Overflow (#1713)
authorAndreu Huguet <redacted>
Tue, 2 Jan 2024 16:50:04 +0000 (17:50 +0100)
committerGitHub <redacted>
Tue, 2 Jan 2024 16:50:04 +0000 (16:50 +0000)
Fix for problem:

"""
RuntimeError: Aborted(Stack overflow! Stack cookie has been overwritten at 0x12be2b10, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x00000000 0x00000000)
"""

That appears when executing the WASM example with the newer versions.

CMakeLists.txt

index 801c5cf2112044475de19dfa85ee957912cc0433..8b338cbc4f84e67f0d0698c63f60321875745494 100644 (file)
@@ -344,8 +344,8 @@ else()
         endif()
     else()
         if (EMSCRIPTEN)
-            set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   -pthread")
-            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
+            set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   -pthread -s TOTAL_STACK=5242880")
+            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -s TOTAL_STACK=5242880")
         else()
             if(NOT WHISPER_NO_AVX)
                 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx")