GithubHelp home page GithubHelp logo

Comments (13)

ivmai avatar ivmai commented on June 2, 2024

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.

ivmai avatar ivmai commented on June 2, 2024

If you confirm that SOFT_VDB is suspected then this might have the same root cause as issue #479

from bdwgc.

plajjan avatar plajjan commented on June 2, 2024

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.

ivmai avatar ivmai commented on June 2, 2024

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.

ivmai avatar ivmai commented on June 2, 2024

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.

ivmai avatar ivmai commented on June 2, 2024

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.

ivmai avatar ivmai commented on June 2, 2024

I could debug this but I need a a guide how to setup the environment. Which host OS/arch?

from bdwgc.

plajjan avatar plajjan commented on June 2, 2024

@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.

ivmai avatar ivmai commented on June 2, 2024

@michaellilltokiwa, I moved the issue reported by you in a separate one - #552

from bdwgc.

ivmai avatar ivmai commented on June 2, 2024

@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.

ivmai avatar ivmai commented on June 2, 2024

Is the issue not observed if -D NO_SFT_VDB passed to CFLAGS?

from bdwgc.

ivmai avatar ivmai commented on June 2, 2024

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.

ivmai avatar ivmai commented on June 2, 2024

The root cause seems to be the same as in #376 .
soft_set_grungy_pages is to be fixed.

from bdwgc.

Related Issues (20)

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.