Comments (13)
Looks strange, let's figure out the root cause.
Which libgc version? Reproducible on fresh release-8_2 (or master)?
Which VDB mode? SOFT_VDB? The issue is not reproducible if compiled with NO_SOFT_VDB, right?
Also, try with NO_VDB_FOR_STATIC_ROOTS (instead of NO_SOFT_VDB) - based on your report, the issue is here.
(We need to understand why an object referenced from a static root directly is not marked.)
from bdwgc.
If you confirm that SOFT_VDB is suspected then this might have the same root cause as issue #479
from bdwgc.
I'm compiling using zig / clang and targetting glibc 2.28.
Using git commit daea2f1 so that's relatively close to HEAD of master.
I haven't explicitly picked a VDB mode. I think it defaults to SOFT_VDB on Linux, right? So yes, SOFT_VDB!?
And yes indeed, compiling with either -DNO_SOFT_VDB
or -DNO_VDB_FOR_STATIC_ROOTS
appears to fix the problem, I don't see any more crashes while running the acton test suite.
What does NO_VDB_FOR_STATIC_ROOTS actually mean? That we scan the static root ranges on every GC run, right? But for the rest we rely on VDB?
from bdwgc.
I think it defaults to SOFT_VDB on Linux
Yes
And yes indeed, compiling with either -DNO_SOFT_VDB or -DNO_VDB_FOR_STATIC_ROOTS appears to fix the problem, I don't see any more crashes while running the acton test suite.
Got it. The issue relates to code within ifndef NO_VDB_FOR_STATIC_ROOTS block.
What does NO_VDB_FOR_STATIC_ROOTS actually mean?
With SOFT VDB (and PROC_VDB) facility the scanning of static roots could be optimized too (unless NO_VDB_FOR_STATIC_ROOTS is defined) to skip unmodified pages during collections other than full ones.
The algorithm of full collections should be re-inspected.
from bdwgc.
I need your help with figuring out the root cause.
I ran the program with gdb, put a breakpoint at initialization of reQ_W_125
Could you please check that soft_set_grungy_pages(0x7f9412cca000, 0x7f9412cfc000, ...) is called? (without -D NO_VDB_FOR_STATIC_ROOTS) And when is it called among output lines above?
from bdwgc.
It seems the information that reQ_W_125 has been written (i.e. page is dirty) is lost somehow.
-D DEBUG_DIRTY_BITS enables the relevant logging.
from bdwgc.
I could debug this but I need a a guide how to setup the environment. Which host OS/arch?
from bdwgc.
@ivmai I'm super busy at the moment preparing for a conference next week, I'll get back as soon as I can after that with more info! :)
from bdwgc.
@michaellilltokiwa, I moved the issue reported by you in a separate one - #552
from bdwgc.
@plajjan, I've implemented a checker (CHECK_SOFT_VDB) that if some page was identified as dirty by mprotect-based VDB then it should be also identified as dirty by SOFT_VDB implementation, commit b4e1ce5.
Please try to build bdwgc (master) passing -D CHECK_SOFT_VDB to CFLAGS_EXTRA. Just in case it would be useful in figuring out the root case.
PS. On my Ubuntu 22.04 x64 machine I see some rare inconsistency on gctest (i.e. some page is reported dirty by mprotect-based but pagemap file says it is clean) - I have not investigated it yet by looks like an issue in the kernel.
from bdwgc.
Is the issue not observed if -D NO_SFT_VDB passed to CFLAGS?
from bdwgc.
Reproduced with the following build command:
../zig/zig build -DBUILD_SHARED_LIBS -Dbuild_tests -Denable_gc_assertions -Denable_threads=false -Denable_gcj_support=false -Denable_disclaim=false -Denable_munmap=false -Ddisable_handle_fork test
Also reproduced if -Ddisable_single_obj_compilation
option added.
Not reproduced with any of:
-DBUILD_SHARED_LIBS=false
option-D NO_VDB_FOR_STATIC_ROOTS
added to C flags- without
-fvisibility=hidden
in C flags (but only if-Denable_gc_assertions
option is given) - build with cmake
- build with configure
from bdwgc.
The root cause seems to be the same as in #376 .
soft_set_grungy_pages is to be fixed.
from bdwgc.
Related Issues (20)
- Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS HOT 5
- compile fail on Win10/MSVC HOT 2
- Bad maximum heap size on large initial heap HOT 4
- Zig warning of "large atomic operation may incur significant performance penalty" on 32-bit arm HOT 7
- Assertion violation of GC_stop_count&THREAD_RESTARTED in GC_restart_all running disclaimtest
- Illegal instruction in GC_clear_stack in tests built by Zig on Linux HOT 7
- disclaimtest, weakmaptest or middletest fail in zig build on Linux if enable_gc_debug and enable_redirect_malloc HOT 5
- Unexpected bus error on Linux/powerpc (32-bit) HOT 9
- weakmap test fail on Ubuntu/x64 (zig build) if malloc redirection and gc-debug enabled HOT 1
- autogen.sh is incomplete HOT 16
- Downstream libgc releases (Feb 2024) HOT 21
- GC hangs with "parallel mark" if using `GC_allow_register_threads()` HOT 11
- Debugging an issue with GC seemingly not happening on Emscripten/WebAssembly
- Upstream TLS support HOT 2
- How final are the finalizers? HOT 2
- Problem getting finalizers to work HOT 3
- Add examples collection of small programs showing how to use GC for varioues features and with different configurations HOT 2
- Support CHERI extension
- using extra pointer bits on x86_64 (tagged pointer support) HOT 3
- Resolve warnings reported by cppcheck 2.13.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 bdwgc.