<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
This is the magic incantation I use to use with valgrind.<br>
<br>
valgrind --tool=memcheck --db-attach=yes
--vex-iropt-precise-memory-exns=yes --leak-check=full
--num-callers=40<br>
<br>
the --vex-iropt-precise-memory-exns=yes is important for running
racket.<br>
<br>
Kevin<br>
<br>
On 02/29/2012 10:29 PM, Simon Haines wrote:
<blockquote
cite="mid:CACrbFVfTDVptp3uBFfd50bu2DUryxEv7j2R3WkkLU1kH4oaraA@mail.gmail.com"
type="cite">I'm coming across a segfault when using racket 5.2.1
in some particular circumstances.
<div><br>
</div>
<div>Here is a sample to reproduce the problem:</div>
<div>
<div>#!/home/simon/racket/bin/racket</div>
<div>#lang racket/base</div>
<div>(display "This is a test, designed to provoke an emotional
response")</div>
<div>
<div><br>
</div>
</div>
</div>
<div>When I chmod +x and run it, it runs just fine:</div>
<div>
<div>
<div>$ /home/simon/racket/bin/racket -v</div>
<div>Welcome to Racket v5.2.1.</div>
</div>
</div>
<div>$ ./test.rkt </div>
<div>
<div>This is a test, designed to provoke an emotional response</div>
</div>
<div><br>
</div>
<div>Running under valgrind segfaults the process:</div>
<div>
<div>$ valgrind ./test.rkt </div>
<div>==19366== Memcheck, a memory error detector</div>
<div>==19366== Copyright (C) 2002-2010, and GNU GPL'd, by Julian
Seward et al.</div>
<div>==19366== Using Valgrind-3.6.1 and LibVEX; rerun with -h
for copyright info</div>
<div>==19366== Command: ./test.rkt</div>
<div>==19366== </div>
<div>==19366== Invalid read of size 8</div>
<div>==19366== at 0x5DD34D: scheme_longjmpup (in
/home/simon/racket/bin/racket)</div>
<div>==19366== by 0x4402CD: scheme_handle_stack_overflow (in
/home/simon/racket/bin/racket)</div>
<div>==19366== by 0x478DD0: overflow_equal_hash_key (in
/home/simon/racket/bin/racket)</div>
<div>==19366== by 0x47D63A: equal_hash_key (in
/home/simon/racket/bin/racket)</div>
<div>==19366== by 0x47DB39: scheme_equal_hash_key (in
/home/simon/racket/bin/racket)</div>
<div>==19366== by 0x51147E: make_hash_indices_for_equal (in
/home/simon/racket/bin/racket)</div>
<div>==19366== by 0x479476: get_bucket (in
/home/simon/racket/bin/racket)</div>
<div>==19366== by 0x47AF1E: scheme_lookup_in_table (in
/home/simon/racket/bin/racket)</div>
<div>==19366== by 0x5FB742:
scheme_make_prefab_struct_type_raw (in
/home/simon/racket/bin/racket)</div>
<div>==19366== by 0x5FE5F8: scheme_lookup_prefab_type (in
/home/simon/racket/bin/racket)</div>
<div>==19366== by 0x621408: scheme_init_thread_places (in
/home/simon/racket/bin/racket)</div>
<div>==19366== by 0x42DBB4: place_instance_init (in
/home/simon/racket/bin/racket)</div>
<div>==19366== Address 0x8 is not stack'd, malloc'd or
(recently) free'd</div>
<div>==19366== </div>
<div>SIGSEGV MAPERR si_code 1 fault on addr 0x8</div>
<div>==19366== </div>
<div>==19366== HEAP SUMMARY:</div>
<div>==19366== in use at exit: 8,554,151 bytes in 1,497
blocks</div>
<div>==19366== total heap usage: 1,507 allocs, 10 frees,
8,567,479 bytes allocated</div>
<div>
==19366== </div>
<div>==19366== LEAK SUMMARY:</div>
<div>==19366== definitely lost: 16,680 bytes in 4 blocks</div>
<div>==19366== indirectly lost: 0 bytes in 0 blocks</div>
<div>==19366== possibly lost: 576 bytes in 2 blocks</div>
<div>==19366== still reachable: 8,536,895 bytes in 1,491
blocks</div>
<div>==19366== suppressed: 0 bytes in 0 blocks</div>
<div>==19366== Rerun with --leak-check=full to see details of
leaked memory</div>
<div>==19366== </div>
<div>==19366== For counts of detected and suppressed errors,
rerun with: -v</div>
<div>==19366== ERROR SUMMARY: 1 errors from 1 contexts
(suppressed: 2 from 2)</div>
<div>zsh: killed valgrind ./test.rkt</div>
</div>
<div>
<br>
</div>
<div>I first came across this issue trying to run racket under
apache, where I suspect the process was being killed off due to
its memory usage. Is that 8mb of heap allocation usual for a
racket/base process? Should I file a bug or is there something
wrong with my setup?</div>
<div>Thanks.</div>
<div><br>
</div>
<div><br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">____________________
Racket Users list:
<a class="moz-txt-link-freetext" href="http://lists.racket-lang.org/users">http://lists.racket-lang.org/users</a>
</pre>
</blockquote>
<br>
</body>
</html>