generational garbage collector (gencgc) accessors broken

Bug #529014 reported by Brett van de Sande
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
High
Unassigned

Bug Description

The accessor functions for gencgc are broken:

(progn (format t "Gen consed prom minage~%")
       (loop for i from 0 to 6 do (format t "~A ~A ~A ~A~%" i
             (generation-bytes-consed-between-gcs i)
             (generation-number-of-gcs-before-promotion i)
             (generation-minimum-age-before-gc i))))
Gen consed prom minage
0 2000000 1 0.75d0
1 2000000 0 0.0d0
2 0 2000000 4.9406564584124654d-324
3 0 2000000 2.1219957909652723d-314
4 0 0 9.881312916824931d-318
5 0 0 4.243991582918676d-308
6 0 0 4.24399159546905d-308

This occurs for sbcl-1.0.35 on darwin-x86, linux-x86, linux-x86_64.

If I add the following code to gencgc.c:

extern void
print_generation_params()
{
    generation_index_t i;
   fprintf(stderr, " Gen trigger consed prom minage\n");
    for (i = 0; i < NUM_GENERATIONS; i++) {
        fprintf(stderr, " %1d: %8ld %8ld %8d %7.4f\n",
                i,
                generations[i].gc_trigger,
                generations[i].bytes_consed_between_gc,
                generations[i].number_of_gcs_before_promotion,
                generations[i].minimum_age_before_gc);
    }
}

And I call from lisp, I get the desired quantities:

(sb-alien:define-alien-routine ("print_generation_params" print-generation-params) sb-alien:void)
(print-generation-params)

PRINT-GENERATION-PARAMS
* Gen trigger consed prom minage
   0: 2009944 2000000 1 0.7500
   1: 2000000 2000000 1 0.7500
   2: 2000000 2000000 1 0.7500
   3: 2000000 2000000 1 0.7500
   4: 2000000 2000000 1 0.7500
   5: 2000000 2000000 1 0.7500
   6: 2000000 2000000 1 0.7500
   7: 2000000 2000000 1 0.7500

For completeness:

josiah> uname -a
Darwin josiah.local 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386 i386 i386

* *features*

(:ASDF :SB-THREAD :ANSI-CL :COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB
 :SB-PACKAGE-LOCKS :SB-UNICODE :SB-EVAL :SB-SOURCE-LOCATIONS
 :IEEE-FLOATING-POINT :X86 :UNIX :MACH-O :BSD :DARWIN :MACH-EXCEPTION-HANDLER
 :SB-LUTEX :RESTORE-FS-SEGMENT-REGISTER-FROM-TLS :GENCGC
 :STACK-GROWS-DOWNWARD-NOT-UPWARD :C-STACK-IS-CONTROL-STACK
 :COMPARE-AND-SWAP-VOPS :UNWIND-TO-FRAME-AND-CALL-VOP :RAW-INSTANCE-INIT-VOPS
 :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-VECTORS
 :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-FIXED-OBJECTS :ALIEN-CALLBACKS
 :CYCLE-COUNTER :INLINE-CONSTANTS :LINKAGE-TABLE :OS-PROVIDES-DLOPEN
 :OS-PROVIDES-DLADDR :OS-PROVIDES-PUTWC :OS-PROVIDES-BLKSIZE-T
 :OS-PROVIDES-SUSECONDS-T)

Revision history for this message
Nikodemus Siivola (nikodemus) wrote : Re: [Bug 529014] [NEW] generational garbage collector (gencgc) accessors broken

  status inprogress
  importance high

The page structure definition on the lisp side is missing space for lutexes. Committing after freeze.

Index: src/code/gc.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/gc.lisp,v
retrieving revision 1.90
diff -u -r1.90 gc.lisp
--- src/code/gc.lisp 14 Feb 2010 20:17:40 -0000 1.90
+++ src/code/gc.lisp 27 Feb 2010 15:58:25 -0000
@@ -346,7 +346,9 @@
             (number-of-gcs int)
             (number-of-gcs-before-promotion int)
             (cum-sum-bytes-allocated unsigned-long)
- (minimum-age-before-gc double)))
+ (minimum-age-before-gc double)
+ ;; The space for lutexes is reserved on non-lutex platforms as well.
+ (lutexes (* t))))

 #!+gencgc
 (define-alien-variable generations

Revision history for this message
Nathan Froyd (froydnj) wrote :

Thanks for the report; fixed in 1.0.35.19.

Changed in sbcl:
status: New → Fix Committed
Changed in sbcl:
importance: Undecided → High
status: Fix Committed → In Progress
Changed in sbcl:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.