Comments (3)
Could be undefined behavior. Try with -fsanitize=undefined
.
If it's not that, please reduce this to a small testcase that is simple to compile (without gtest
and other external things).
from emscripten.
Could be undefined behavior. Try with
-fsanitize=undefined
.If it's not that, please reduce this to a small testcase that is simple to compile (without
gtest
and other external things).
I wrote a testcase with minimal external things, finally i found the compile option -ffast-math
used in my project is the main crime.
I know it is a compile option in gcc, does new emscripten has some similiar compile option?
#include <iostream>
#include <limits>
static const float M_INF = std::numeric_limits<float>::infinity();
int main()
{
std::cout << std::isinf(std::numeric_limits<float>::infinity()) << std::endl;
std::cout << std::isinf(M_INF) << std::endl;
std::cout << (M_INF == std::numeric_limits<float>::infinity()) << std::endl;
std::cout << "Hello, World!" << std::endl;
return 0;
}
>> em++ .\main.cpp -ffast-math -O3 -o test.js
>> node test.js
0
0
0
Hello, World!
>> em++ .\main.cpp -O3 -o test.js
>> node test.js
1
1
1
Hello, World!
from emscripten.
I solved it with compile option -fhonor-infinities
Clang manual has more detail information about it: clang manual
>>em++ .\main.cpp -ffast-math -fhonor-infinities -O3 -o test.js
>> node test.js
1
1
1
Hello, World!
Thanks for your reply @kripken
from emscripten.
Related Issues (20)
- -fsanitize=address & -sWASM_WORKERS=1 leads to ==42==Unmatched call to __lsan_enable() error HOT 2
- dlopen returns incorrectly on subsequent load HOT 1
- file_packager.py: REMOTE_PACKAGE_BASE does not work when data is not a the root HOT 4
- Warn users that a flag is set multiple times with different values and being overwritten
- SEGMENTATION FAULT with IMG_Load_RW HOT 4
- file_packager.py: option to continue-on-error in output js (for optional packages)? HOT 4
- `abort` export not provided when compiling C code that uses this symbol? HOT 2
- Problems calling main / imported functions with Node environment [EAGAIN exception] HOT 1
- --embind-emit-tsd fails when using WASM=0
- test_pthread_gcc_atomic_fetch_and_op fails in 2gb and 4gb modes HOT 1
- Importing the SDL_mixer with -sUSE_SDL_MIXER=2 seems to cause the error: Mix_Init: no sound/music loaders supported () HOT 3
- Libpng wasm port broken? HOT 9
- idbfs backend: If `reconcile()` triggers QuotaExceededError, callback is never called
- file_packager: `preloadFallback` may not be triggered in QuotaExceeded scenarios
- [WasmFS+OPFS] Unspecified file size limit HOT 7
- Opencv.js --threads how to compleatly release memory when refreshing page? HOT 3
- Performance Degradation: Excessive fmaf Calls Generated for __builtin_elementwise_fma Leading to Inefficient Code Generation HOT 8
- pthread_equal(thread, pthread_self()) && "val accessed from wrong thread HOT 2
- Add assertions for number of arguments for exported functions
- Uncaught JavaScript exceptions eventually overflow the stack HOT 3
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 emscripten.