Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-81728

[wasm] QWasmString::toQString() cause assertion failure for emscripten 1.39.4

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.14.2, 5.15.0 Alpha
    • 5.14.1
    • None
    • ubuntu 18.04
      chrome 79
      emscripten 1.39.4-fastcomp
      qt 5.14 git
    • WebAssembly
    • f998e630e74a8921e2e48e84fc0153ff81850def (qt/qtbase/5.14)

    Description

          I got the latest qt source from git today and built qt-5.14 webassembly with emscripten 1.39.4-fastcomp with the following command:

      ./configure -opensource -confirm-license -xplatform wasm-emscripten -feature-thread -nomake examples -nomake tests -skip qt3d -skip qtdeclarative -skip qtmultimedia -skip qttools -skip qtxmlpatterns -prefix /usr/local/qt5-wasm-em-1.39.4-fastcomp

      The qt wasm module fail to load with the simplest sample program in chrome browser:

      qtloader.js:372 Assertion failed: stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!
      qtloader.js:382 Assertion failed: stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!
      qtloader.js:382 exception thrown: RuntimeError: abort(Assertion failed: stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!) at Error
      at jsStackTrace (eval at completeLoadEmscriptenModule (http://localhost:8080/qtloader.js:443:14), <anonymous>:2042:17)
      at stackTrace (eval at completeLoadEmscriptenModule (http://localhost:8080/qtloader.js:443:14), <anonymous>:2059:16)
      at abort (eval at completeLoadEmscriptenModule (http://localhost:8080/qtloader.js:443:14), <anonymous>:1768:44)
      at assert (eval at completeLoadEmscriptenModule (http://localhost:8080/qtloader.js:443:14), <anonymous>:805:5)
      at stringToUTF16 (eval at completeLoadEmscriptenModule (http://localhost:8080/qtloader.js:443:14), <anonymous>:1168:3)
      at __emval_call (eval at completeLoadEmscriptenModule (http://localhost:8080/qtloader.js:443:14), <anonymous>:6912:23)
      at QWasmString::toQString(emscripten::val const&) [__ZN11QWasmString9toQStringERKN10emscripten3valE] (wasm-function[793]:0x24310)
      at QWasmIntegration::QWasmIntegration() [__ZN16QWasmIntegrationC2Ev] (wasm-function[581]:0x17079)
      at QWasmIntegrationPlugin::create(QString const&, QStringList const&) [__ZN22QWasmIntegrationPlugin6createERK7QStringRK11QStringList] (wasm-function[564]:0x16311)
      at QPlatformIntegrationPlugin::create(QString const&, QStringList const&, int&, char**) [__ZN26QPlatformIntegrationPlugin6createERK7QStringRK11QStringListRiPPc] (wasm-function[9612]:0x4167cb),RuntimeError: abort(Assertion failed: stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!) at Error
      at jsStackTrace (eval at completeLoadEmscriptenModule (http://localhost:8080/qtloader.js:443:14), <anonymous>:2042:17)
      at stackTrace (eval at completeLoadEmscriptenModule (http://localhost:8080/qtloader.js:443:14), <anonymous>:2059:16)
      at abort (eval at completeLoadEmscriptenModule (http://localhost:8080/qtloader.js:443:14), <anonymous>:1768:44)
      at assert (eval at completeLoadEmscriptenModule (http://localhost:8080/qtloader.js:443:14), <anonymous>:805:5)
      at stringToUTF16 (eval at completeLoadEmscriptenModule (http://localhost:8080/qtloader.js:443:14), <anonymous>:1168:3)
      at __emval_call (eval at completeLoadEmscriptenModule (http://localhost:8080/qtloader.js:443:14), <anonymous>:6912:23)
      at QWasmString::toQString(emscripten::val const&) [__ZN11QWasmString9toQStringERKN10emscripten3valE] (wasm-function[793]:0x24310)
      at QWasmIntegration::QWasmIntegration() [__ZN16QWasmIntegrationC2Ev] (wasm-function[581]:0x17079)
      at QWasmIntegrationPlugin::create(QString const&, QStringList const&) [__ZN22QWasmIntegrationPlugin6createERK7QStringRK11QStringList] (wasm-function[564]:0x16311)
      at QPlatformIntegrationPlugin::create(QString const&, QStringList const&, int&, char**) [__ZN26QPlatformIntegrationPlugin6createERK7QStringRK11QStringListRiPPc] (wasm-function[9612]:0x4167cb)
      at abort (eval at completeLoadEmscriptenModule (http://localhost:8080/qtloader.js:443:14), <anonymous>:1774:9)
      at assert (eval at completeLoadEmscriptenModule (http://localhost:8080/qtloader.js:443:14), <anonymous>:805:5)
      at stringToUTF16 (eval at completeLoadEmscriptenModule (http://localhost:8080/qtloader.js:443:14), <anonymous>:1168:3)
      at __emval_call (eval at completeLoadEmscriptenModule (http://localhost:8080/qtloader.js:443:14), <anonymous>:6912:23)
      at __ZN11QWasmString9toQStringERKN10emscripten3valE (wasm-function[793]:0x24310)
      at __ZN16QWasmIntegrationC2Ev (wasm-function[581]:0x17079)
      at __ZN22QWasmIntegrationPlugin6createERK7QStringRK11QStringList (wasm-function[564]:0x16311)
      at __ZN26QPlatformIntegrationPlugin6createERK7QStringRK11QStringListRiPPc (wasm-function[9612]:0x4167cb)
      at _Z11qLoadPluginI20QPlatformIntegration26QPlatformIntegrationPluginJRK11QStringListRiRPPcEEPT_PK14QFactoryLoaderRK7QStringDpOT1 (wasm-function[17682]:0x55ab3c)
      at _ZN27QPlatformIntegrationFactory6createERK7QStringRK11QStringListRiPPcS2 (wasm-function[17680]:0x55aac7)

      This seems to be a regression introduced by a recent commit: 0a4c5b5119ccefc355fe737f03ec330e70c33ec9

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kusharami Alexandra Cherdantseva
            jianliang79 liang jian
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes