Comments (10)
I'm not sure how I can potentially verify whether it's not some weird clang issue or whether Blend2D does something wrong. Because this exact example runs regularly on our CI with ASAN as well. Are you sure it's not a clang issue?
from blend2d.
@judicaelclair Could you test the current master and report if you are getting any issues?
I'm using clang-16 with ASAN and all works great.
from blend2d.
Sorry for the late response. I've just tried it again with latest master with Clang-18. ASAN seems to work now, but UBSAN is causing me issues now at the same location. I think the previous ASAN issue might have been hiding the UBSAN issue as when I opened this issue I was testing both UBSAN and ASAN together. Here's the UBSAN error I'm getting:
blend2d/src/blend2d/raster/rastercontext.cpp:2641:87: runtime error: downcast of misaligned address 0x55d3b932be28 for type 'RenderFetchData', which requires 16 byte alignment
0x55d3b932be28: note: pointer points here
d3 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 ff 00 00 00 00 00 00 00 ff
^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior blend2d/src/blend2d/raster/rastercontext.cpp:2641:87 in
blend2d/src/blend2d/raster/rastercontext.cpp:2641:132: runtime error: member access within misaligned address 0x55d3b932be28 for type 'RenderFetchData', which requires 16 byte alignment
0x55d3b932be28: note: pointer points here
d3 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 ff 00 00 00 00 00 00 00 ff
^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior blend2d/src/blend2d/raster/rastercontext.cpp:2641:132 in
UndefinedBehaviorSanitizer:DEADLYSIGNAL
==37621==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x7fa8e2bdfff8 (pc 0x7fa8e6a7f615 bp 0x7ffefd6c5380 sp 0x7ffefd6c5130 T37621)
==37621==The signal is caused by a READ memory access.
#0 0x7fa8e6a7f615 in BLRasterEngine::CommandProcSync::fillBoxA(BLRasterEngine::WorkData&, BLPipeline::DispatchData const&, unsigned int, BLBoxI const&, void const*) blend2d/src/blend2d/raster/../raster/rendercommandprocsync_p.h:36:5
#1 0x7fa8e6a7f615 in unsigned int BLRasterEngine::fillClippedBoxA<(BLRasterEngine::RenderingMode)0>(BLRasterContextImpl*, BLRasterEngine::DispatchInfo, BLRasterEngine::DispatchStyle, BLBoxI const&) blend2d/src/blend2d/raster/rastercontext.cpp:2641:10
#2 0x7fa8e6a7f615 in unsigned int BLRasterEngine::fillAll<(BLRasterEngine::RenderingMode)0>(BLRasterContextImpl*, BLRasterEngine::DispatchInfo, BLRasterEngine::DispatchStyle) blend2d/src/blend2d/raster/rastercontext.cpp:2715:7
#3 0x7fa8e6a56904 in unsigned int BLRasterEngine::fillAllImpl<(BLRasterEngine::RenderingMode)0>(BLContextImpl*) blend2d/src/blend2d/raster/rastercontext.cpp:3343:10
UndefinedBehaviorSanitizer can not provide additional info.
SUMMARY: UndefinedBehaviorSanitizer: SEGV blend2d/src/blend2d/raster/../raster/rendercommandprocsync_p.h:36:5 in BLRasterEngine::CommandProcSync::fillBoxA(BLRasterEngine::WorkData&, BLPipeline::DispatchData const&, unsigned int, BLBoxI const&, void const*)
I've also made sure to compile asmjit with the sanitiser, but still same issue.
from blend2d.
Thanks for verifying with UBSAN. I can indeed confirm the issue, although it's pretty harmless (the 16-byte aligned pointer is only used by non-solid fills).
It should be fixed by 480cf05 - let me know if you have any other issues
from blend2d.
That's just turned the issue into a read error unfortunately:
UndefinedBehaviorSanitizer:DEADLYSIGNAL
==730775==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x7f0491516ff8 (pc 0x7f04954dee57 bp 0x000000004111 sp 0x7ffd00e00e60 T730775)
==730775==The signal is caused by a READ memory access.
#0 0x7f04954dee57 in BLRasterEngine::CommandProcSync::fillBoxA(BLRasterEngine::WorkData&, BLPipeline::DispatchData const&, unsigned int, BLBoxI const&, void const*) blend2d/src/blend2d/raster/../raster/rendercommandprocsync_p.h:36:5
#1 0x7f04954dee57 in unsigned int BLRasterEngine::fillClippedBoxA<(BLRasterEngine::RenderingMode)0>(BLRasterContextImpl*, BLRasterEngine::DispatchInfo, BLRasterEngine::DispatchStyle, BLBoxI const&) blend2d/src/blend2d/raster/rastercontext.cpp:2641:10
#2 0x7f04954dee57 in unsigned int BLRasterEngine::fillAll<(BLRasterEngine::RenderingMode)0>(BLRasterContextImpl*, BLRasterEngine::DispatchInfo, BLRasterEngine::DispatchStyle) blend2d/src/blend2d/raster/rastercontext.cpp:2715:7
UndefinedBehaviorSanitizer can not provide additional info.
SUMMARY: UndefinedBehaviorSanitizer: SEGV blend2d/src/blend2d/raster/../raster/rendercommandprocsync_p.h:36:5 in BLRasterEngine::CommandProcSync::fillBoxA(BLRasterEngine::WorkData&, BLPipeline::DispatchData const&, unsigned int, BLBoxI const&, void const*)
And in some cases alongside this error I get: Caught signal 11 (Segmentation fault: address not mapped to object at address 0x7f2948311ff8)
from blend2d.
I tried, but I cannot repro this error with any sanitizer.
Can you paste here the code that triggers the problem, and the compiler as well?
I'm currently using Debian clang version 16.0.6 (11)
and it all works with ASAN, UBSAN, and valgrind - I have no issues like these.
from blend2d.
Exact same code as OP but with a more recent compiler:
Ubuntu clang version 18.0.0 (++20230827042310+1c4c9e8e7029-1~exp1~20230827042445.1148)
Target: x86_64-pc-linux-gnu
Thread model: posix
Running on: Ubuntu 22.04.3 LTS
The Caught signal 11
might be a side effect of the app being uncleanly killed by UBSAN as I only get that when running a non-trivial app. That being said, the DEADLYSIGNAL
error should happen every single time ctx.fillAll()
is called (e.g. with the trivial example in OP).
from blend2d.
I have compiled clang from git and filled the following issue:
Let's wait for the feedback from llvm developers, maybe there is a regression in UBSAN.
from blend2d.
@judicaelclair AsmJit has added a workaround to help LLVM's UBSAN to not crash. Updating asmjit is required in this case.
from blend2d.
Seems to be fixed now, thanks. Closing the issue.
from blend2d.
Related Issues (20)
- crash when saving/restoring strokeOptions HOT 2
- crash: blitImage + setTransform HOT 4
- img.getData 0.9.0 to 0.10.5 version HOT 4
- Wish: implement an API to rendering text along/by a path HOT 1
- composition operator not work on macOS MPB with Apple m1 HOT 2
- [Portable Pipeline] Composition operators not working (only SrcCopy and SrcOver) HOT 11
- Rendering bug with BLContext for certain image sizes HOT 2
- Wish: Android support HOT 2
- Raspberry Pi 2B rev1.1 compilation failed HOT 3
- about BLFont question HOT 12
- strokedPath error HOT 1
- Can bled2d be easily ported to rtos? HOT 3
- Rendering of fonts in various national languages HOT 2
- Build failure simdx86_test_avx512.cpp, MingGW-w64, static, cmake/ninja, no tests HOT 4
- clipToRect not correctly applied to fillGlyphRun within rotated context HOT 4
- crash with gcc (Debian 12.2.0-14) 12.2.0 HOT 4
- build errors on Fedora s390x HOT 1
- Crash on blitImage with different image format HOT 4
- ctest of bl_test_unit failed on fedora s390x HOT 5
- Support 8-bit (s)RGBA BLImages? HOT 5
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 blend2d.