chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Segfault with large data-structures


From: Arthur Maciel
Subject: [Chicken-users] Segfault with large data-structures
Date: Sat, 2 Feb 2013 15:51:32 -0200

Hello! I don't know if it is related to Ivan's problem, but when I compile and run this code:

(use srfi-69)

(define NODES 250000)
(define EDGES 1000)

(define graph (make-hash-table))

(define (insert-edges)
  (printf "~N Hash-tables - Inserting edges ~N")
  (do ((n 1 (+ n 1))) ((= n NODES))
    (if (= (remainder n 5000) 0)
        (printf " ~S nodes inserted ~N" n))
    (do ((e 2 (+ e 1))) ((= e (+ 1 EDGES)))
      (hash-table-update!/default graph
                                  n
                                  (lambda (edges-list)
                                    (if (member e edges-list)
                                        edges-list
                                        (cons e edges-list)))
                                  (list e)))))

(time  (insert-edges))

I get this:

 $ csc list-in-hash-table-partials.scm -o list-partials.scm
 $ ./list-partials.scm

 Hash-tables - Inserting edges
 5000 nodes inserted
 10000 nodes inserted
 15000 nodes inserted
 20000 nodes inserted
 25000 nodes inserted
 30000 nodes inserted
 35000 nodes inserted
 40000 nodes inserted
Segmentation fault


I tried to compile with -O2, -O -d2 and -O3. It doesn't make difference for me: it always present a segfault. Any hint on how to make it work?

Thanks!
Arthur

reply via email to

[Prev in Thread] Current Thread [Next in Thread]