From: ludovic.courtes@laas.fr (Ludovic Courtès)
Subject: [PATCH] Fixing `gc-live-object-stats'
Date: Thu, 17 Nov 2005 14:21:32 +0100 [thread overview]
Message-ID: <87r79f4dgj.fsf@laas.fr> (raw)
In-Reply-To: <87y83z3vh5.fsf@laas.fr> (Ludovic Courtès's message of "Tue, 08 Nov 2005 18:22:46 +0100")
Hi,
ludovic.courtes@laas.fr (Ludovic Courtès) writes:
> $ guile
> guile> (gc-live-object-stats)
> Segmentation fault (core dumped)
The patch below fixes this problem. Basically, what happens when doing
this is that `scm_i_card_statistics ()' gets called on yet uninitialized
cards. This is normal because cards are initialized lazily at sweep
time by `scm_i_sweep_some_cards ()' which calls
`scm_i_init_card_freelist ()' if needed.
BTW, looking at the code of `scm_i_sweep_some_cards ()', it looks like
cards can be initialized more than once in the event where THRESHOLD is
reached before NEXT_FREE reached the upper boundary of SEG. In such a
case, SEG->FIRST_TIME will remain equal to 1, and thus, the next time
this function is called on SEG, `scm_i_init_card_freelist ()' will be
called again for each of SEG's cards.
Did I miss something?
Thanks,
Ludovic.
2005-11-17 Ludovic Courtès <ludovic.courtes@laas.fr>
* gc-card.c (scm_i_card_statistics): Return if BITVEC is NULL.
This was typically hit when running `gc-live-object-stats' right
after starting Guile.
--- orig/libguile/gc-card.c
+++ mod/libguile/gc-card.c
@@ -306,6 +306,10 @@
int span = seg->span;
int offset = SCM_MAX (SCM_GC_CARD_N_HEADER_CELLS, span);
+ if (!bitvec)
+ /* Card P hasn't been initialized yet by `scm_i_init_card_freelist ()'. */
+ return;
+
for (p += offset; p < end; p += span, offset += span)
{
scm_t_bits tag = -1;
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2005-11-17 13:21 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-08 17:22 [PATCH] Marking weak alist vectors Ludovic Courtès
2005-11-08 23:51 ` Marius Vollmer
2005-11-09 9:03 ` Ludovic Courtès
2005-12-06 23:55 ` Marius Vollmer
2005-12-07 10:33 ` Ludovic Courtès
2005-12-13 23:45 ` Marius Vollmer
2005-12-14 9:30 ` Ludovic Courtès
2005-11-09 10:28 ` Han-Wen Nienhuys
2005-11-09 16:28 ` Ludovic Courtès
2005-11-09 18:36 ` Han-Wen Nienhuys
2005-11-09 21:11 ` Kevin Ryde
2005-11-09 22:45 ` Marius Vollmer
2005-11-10 12:11 ` Han-Wen Nienhuys
2005-11-10 9:47 ` [PATCH] Reference leak in `iprin1 ()' Ludovic Courtès
2005-11-12 9:23 ` Neil Jerram
2005-11-14 9:58 ` Ludovic Courtès
2005-11-16 21:18 ` Neil Jerram
2005-11-17 9:54 ` Ludovic Courtès
2005-11-17 18:52 ` Neil Jerram
2005-11-23 10:19 ` [PATCH] Marking weak alist vectors, #2 Ludovic Courtès
2005-11-24 0:59 ` Han-Wen Nienhuys
2005-11-24 9:01 ` Ludovic Courtès
2005-11-26 0:49 ` Kevin Ryde
2006-01-09 14:51 ` [PATCH] Marking weak alist vectors, epilogue Ludovic Courtès
2006-01-09 19:29 ` Neil Jerram
2006-01-10 8:21 ` Ludovic Courtès
2006-01-10 9:33 ` Neil Jerram
2006-01-10 15:43 ` Ludovic Courtès
2005-11-17 13:21 ` Ludovic Courtès [this message]
2005-11-17 14:12 ` [PATCH] Fixing `gc-live-object-stats' Han-Wen Nienhuys
2005-11-30 8:54 ` Ludovic Courtès
2005-11-30 23:45 ` Han-Wen Nienhuys
2005-12-03 19:31 ` Neil Jerram
2005-12-05 8:50 ` Ludovic Courtès
2005-12-06 19:14 ` Neil Jerram
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r79f4dgj.fsf@laas.fr \
--to=ludovic.courtes@laas.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).