Giter Site home page Giter Site logo

Comments (12)

msqr1 avatar msqr1 commented on June 19, 2024

I tried not to set ALLOW_MEMORY_GROWTH with pthread because I do lots of JS read and writes. See
https://emscripten.org/docs/porting/pthreads.html?#special-considerations

last section about pthread and allow memory growth

from vosklet.

korabelnikov avatar korabelnikov commented on June 19, 2024

@msqr1 I tried to rebuild using your make script, I've set 600mb instead of 300, but the error persists.

model, I used, from vosk-browser

https://github.com/ccoreilly/vosk-browser/raw/gh-pages/models/vosk-model-small-ru-0.4.tar.gz

from vosklet.

korabelnikov avatar korabelnikov commented on June 19, 2024

image

the execution steps after model creation but then I got error with pointer to std::string (I suppose)

from vosklet.

msqr1 avatar msqr1 commented on June 19, 2024

Without getting my hand dirty, I can't know what is going on. You can try with o0, g3 and assertions and sanitizers to debug, I'll try it later tonight. If you discover anything, please share it so I can improve this!

from vosklet.

korabelnikov avatar korabelnikov commented on June 19, 2024

good, idea, I'll try it right now

from vosklet.

korabelnikov avatar korabelnikov commented on June 19, 2024
Vosklet.js:418 Aborted(native code called abort())
threadPrintErr @ Vosklet.js:418
abort @ Vosklet.js:903
__abort_js @ Vosklet.js:1959
$abort @ Vosklet.wasm-01f04bca:0x2b12f
$std::__2::__throw_out_of_range[abi:nn180100](char const*) @ Vosklet.wasm-01f04bca:0x2cefbb
$std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>::__throw_out_of_range[abi:nn180100]() const @ Vosklet.wasm-01f04bca:0x2cefb1
$std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>::basic_string(std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>> const&, unsigned long, unsigned long, std::__2::allocator<char> const&) @ Vosklet.wasm-01f04bca:0x18069
$std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>::substr[abi:ne180100](unsigned long, unsigned long) const @ Vosklet.wasm-01f04bca:0x16eda
$genericModel::extractAndLoad(int, int)::$_0::operator()() const @ Vosklet.wasm-01f04bca:0x1590e
$decltype(std::declval<genericModel::extractAndLoad(int, int)::$_0&>()()) std::__2::__invoke[abi:ne180100]<genericModel::extractAndLoad(int, int)::$_0&>(genericModel::extractAndLoad(int, int)::$_0&) @ Vosklet.wasm-01f04bca:0x157d4
$void std::__2::__invoke_void_return_wrapper<void, true>::__call[abi:ne180100]<genericModel::extractAndLoad(int, int)::$_0&>(genericModel::extractAndLoad(int, int)::$_0&) @ Vosklet.wasm-01f04bca:0x15787
$std::__2::__function::__alloc_func<genericModel::extractAndLoad(int, int)::$_0, std::__2::allocator<genericModel::extractAndLoad(int, int)::$_0>, void ()>::operator()[abi:ne180100]() @ Vosklet.wasm-01f04bca:0x15612
$std::__2::__function::__func<genericModel::extractAndLoad(int, int)::$_0, std::__2::allocator<genericModel::extractAndLoad(int, int)::$_0>, void ()>::operator()() @ Vosklet.wasm-01f04bca:0x155d9
$std::__2::__function::__value_func<void ()>::operator()[abi:ne180100]() const @ Vosklet.wasm-01f04bca:0x1387d
$std::__2::function<void ()>::operator()() const @ Vosklet.wasm-01f04bca:0x137d5
$genericModel::extractAndLoad(int, int)::$_1::operator()() const @ Vosklet.wasm-01f04bca:0x13787
$decltype(std::declval<genericModel::extractAndLoad(int, int)::$_1>()()) std::__2::__invoke[abi:ne180100]<genericModel::extractAndLoad(int, int)::$_1>(genericModel::extractAndLoad(int, int)::$_1&&) @ Vosklet.wasm-01f04bca:0x13732
$void std::__2::__thread_execute[abi:ne180100]<std::__2::unique_ptr<std::__2::__thread_struct, std::__2::default_delete<std::__2::__thread_struct>>, genericModel::extractAndLoad(int, int)::$_1>(std::__2::tuple<std::__2::unique_ptr<std::__2::__thread_struct, std::__2::default_delete<std::__2::__thread_struct>>, genericModel::extractAndLoad(int, int)::$_1>&, std::__2::__tuple_indices<...>) @ Vosklet.wasm-01f04bca:0x12f77
$void* std::__2::__thread_proxy[abi:ne180100]<std::__2::tuple<std::__2::unique_ptr<std::__2::__thread_struct, std::__2::default_delete<std::__2::__thread_struct>>, genericModel::extractAndLoad(int, int)::$_1>>(void*) @ Vosklet.wasm-01f04bca:0x12b03
invokeEntryPoint @ Vosklet.js:1743
handleMessage @ Vosklet.js:516
Vosklet.js:418 worker: onmessage() captured an uncaught exception: RuntimeError: Aborted(native code called abort())
threadPrintErr @ Vosklet.js:418
handleMessage @ Vosklet.js:543
Vosklet.js:418 RuntimeError: Aborted(native code called abort())
    at abort (http://127.0.0.1:5000/static/Vosklet.js:922:11)
    at __abort_js (http://127.0.0.1:5000/static/Vosklet.js:1959:7)
    at Vosklet.wasm.abort (wasm://wasm/Vosklet.wasm-01f04bca:wasm-function[1146]:0x2b12f)
    at Vosklet.wasm.std::__2::__throw_out_of_range[abi:nn180100](char const*) (wasm://wasm/Vosklet.wasm-01f04bca:wasm-function[7047]:0x2cefbb)
    at Vosklet.wasm.std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>::__throw_out_of_range[abi:nn180100]() const (wasm://wasm/Vosklet.wasm-01f04bca:wasm-function[7046]:0x2cefb1)
    at Vosklet.wasm.std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>::basic_string(std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>> const&, unsigned long, unsigned long, std::__2::allocator<char> const&) (wasm://wasm/Vosklet.wasm-01f04bca:wasm-function[449]:0x18069)
    at Vosklet.wasm.std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>::substr[abi:ne180100](unsigned long, unsigned long) const (wasm://wasm/Vosklet.wasm-01f04bca:wasm-function[422]:0x16eda)
    at Vosklet.wasm.genericModel::extractAndLoad(int, int)::$_0::operator()() const (wasm://wasm/Vosklet.wasm-01f04bca:wasm-function[411]:0x1590e)
    at Vosklet.wasm.decltype(std::declval<genericModel::extractAndLoad(int, int)::$_0&>()()) std::__2::__invoke[abi:ne180100]<genericModel::extractAndLoad(int, int)::$_0&>(genericModel::extractAndLoad(int, int)::$_0&) (wasm://wasm/Vosklet.wasm-01f04bca:wasm-function[410]:0x157d4)
    at Vosklet.wasm.void std::__2::__invoke_void_return_wrapper<void, true>::__call[abi:ne180100]<genericModel::extractAndLoad(int, int)::$_0&>(genericModel::extractAndLoad(int, int)::$_0&) (wasm://wasm/Vosklet.wasm-01f04bca:wasm-function[408]:0x15787)

but pointer to the tar is correct, I compared memory view with offline hex viewer
image

from vosklet.

korabelnikov avatar korabelnikov commented on June 19, 2024

According to assmebly, it fails at std::string::substr, so I think, it's here
image

from vosklet.

korabelnikov avatar korabelnikov commented on June 19, 2024

I managed out, I repacked tarball given by vosk-browser (I removed top-level hidden file, and all the hidden files there).

from vosklet.

msqr1 avatar msqr1 commented on June 19, 2024

So the issue was that model files wasn't tgz'ed in the top-level directory, right?

from vosklet.

korabelnikov avatar korabelnikov commented on June 19, 2024

not exact, the issue was in that, you have a line in code which assume that all the files in tarball have '/' in their path, and then you cut the dirname out. But tarball from vosk-browser contains some hidden files at top level.
attempting to find '/' returns -1
then substr(path, -1, len(path))) crashes the program

from vosklet.

msqr1 avatar msqr1 commented on June 19, 2024

Alr imma fix this! Thanks for your help!

from vosklet.

msqr1 avatar msqr1 commented on June 19, 2024

@korabelnikov It took a long time, but it seemed that I fixed my code. Could you recheck so I can close the issue?

from vosklet.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.