Comments (12)
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.
@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.
the execution steps after model creation but then I got error with pointer to std::string (I suppose)
from vosklet.
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.
good, idea, I'll try it right now
from vosklet.
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
from vosklet.
According to assmebly, it fails at std::string::substr, so I think, it's here
from vosklet.
I managed out, I repacked tarball given by vosk-browser (I removed top-level hidden file, and all the hidden files there).
from vosklet.
So the issue was that model files wasn't tgz'ed in the top-level directory, right?
from vosklet.
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.
Alr imma fix this! Thanks for your help!
from vosklet.
@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)
- working example? HOT 9
- evaluation give worse metrics then server-based VOSK. Way to run it sync for test? HOT 8
- ReferenceError: Can't find variable: SharedArrayBuffer HOT 14
- Import via module: Can't find variable window HOT 2
- Error: "Unable to open tar in WASM memory" using en-model.tgz HOT 5
- "TypeError: cannot convert undefined to object" in VoskletTransferer HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vosklet.