Skip to content

Ribbit C RVM makes wrong assumptions on its GC #145

Description

@chouettevan

In multiple instances , the ribbit C RVM assumes the garbage collector does not run during a series of allocations,

Bug Trigger

apply the following patch to the C RVM:

diff --git a/src/host/c/rvm.c b/src/host/c/rvm.c
index ba2c4d4..2057952 100644
--- a/src/host/c/rvm.c
+++ b/src/host/c/rvm.c
@@ -591,9 +591,7 @@ void push2(obj car, obj tag) {
     gc();
   }
 #else
-  if (alloc == alloc_limit) {
     gc();
-  }
 #endif
 }

Compile virtually any scheme program (such as tests/00-ribbit/00-empty.scm)

Expected behaviour

Since ribbit is well built, the program executes normally

Actual behaviour.

A segfault due to parts of ribbit assuming the gc does not trigger on some allocation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions