Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /tests/vis15-bugs/heron-coll.diderot
ViewVC logotype

Annotation of /tests/vis15-bugs/heron-coll.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4751 - (view) (download)

1 : jhr 4751 /*
2 :     Working on the examples at github, I got another memory problem related to shapshots. I think this is the first time snapshots led to a segfault, but it may be related to the memory errors I've noted previously.
3 :    
4 :     Compiling the attached file with:
5 :    
6 :     diderotc --snapshot --exec heron-coll.diderot
7 :    
8 :     where diderotc is vis15 , then running just "./heron-coll" won't finish (because some strands never stabilize), but:
9 :    
10 :     ./heron-coll -l 20
11 :    
12 :     will terminate, however (for my on my laptop) it stops with either a segfault, or a message like:
13 :    
14 :     heron-coll(99598,0x7fff7607c000) malloc: *** error for object 0x7fde6a403a78: incorrect checksum for freed object - object was probably modified after being freed.
15 :     *** set a breakpoint in malloc_error_break to debug
16 :    
17 :     Valgrind also sees a problem, but for me gets stuck in an infinite look that I could stop only with "killall -9 valgrind" in a different shell.
18 :    
19 :     I get the same memory problem if I actually run with snapshots (./heron-coll -s 1 -l 20).
20 :    
21 :     Compiling without --snapshot, the program exits cleanly with "-l 20", with no valgrind problems.
22 :     */
23 :    
24 :     real minval = 1;
25 :     real maxval = 100;
26 :     int numval = 100;
27 :     real eps = 0.0000001;
28 :    
29 :     strand sqroot (real val) {
30 :     real root = val;
31 :     int iter = 0;
32 :     output vec4 vrie = [val,-1,-1,-1];
33 :    
34 :     update {
35 :     if (val <= 0) {
36 :     stabilize;
37 :     }
38 :     root = (root + val/root) / 2.0;
39 :     iter += 1;
40 :     if (|(root/val)*root - 1| < eps) {
41 :     stabilize;
42 :     }
43 :     }
44 :     stabilize {
45 :     vrie = [val, root, iter, (root-sqrt(val))/sqrt(val)];
46 :     }
47 :     }
48 :    
49 :     initially { sqroot(lerp(minval, maxval, 1, ii, numval)) | ii in 1 .. numval };

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0