Last active
August 29, 2015 14:05
-
-
Save jakebolewski/8684ef2f5bd7b183f921 to your computer and use it in GitHub Desktop.
Flisp debug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reading symbols from flisp/flisp-debug...done. | |
(gdb) r | |
Starting program: /home/jake/julia-test/src/flisp/flisp-debug | |
[Thread debugging using libthread_db enabled] | |
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". | |
; _ | |
; |_ _ _ |_ _ | . _ _ | |
; | (-||||_(_)|__|_)|_) | |
;-------------------|---------------------------------------------------------- | |
> (load "torture.scm") | |
Program received signal SIGSEGV, Segmentation fault. | |
0x0000000000414288 in fl_map1 (args=0x7ffff711fdb8, nargs=2) at flisp.c:2322 | |
2322 cdr_(*last) = v; | |
(gdb) p *last | |
Cannot access memory at address 0x7ffff711fdd0 | |
(gdb) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mktorture(filename) | |
open(filename, "w") do file | |
write(file, "begin\n") | |
for i = 1:30_000 | |
funcname = "myfunc$i" | |
write(file, "function $funcname(x)\n x^2\nend\n") | |
end | |
write(file, "end") | |
end | |
end | |
mktorture("/tmp/torture.jl") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(load "jlfrontend.scm") | |
(define (profile-frontend fname) | |
(let* ((str (io.readall (open-input-file fname))) | |
(ast (julia-parse str))) | |
(time (expand-toplevel-expr ast))) | |
#t) | |
(profile-frontend "/tmp/torture.jl") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
julia-test/src [master●] » valgrind flisp/flisp-debug | |
==26857== Memcheck, a memory error detector | |
==26857== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. | |
==26857== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info | |
==26857== Command: flisp/flisp-debug | |
==26857== | |
; _ | |
; |_ _ _ |_ _ | . _ _ | |
; | (-||||_(_)|__|_)|_) | |
;-------------------|---------------------------------------------------------- | |
> (load "torture.scm") | |
==26857== Invalid read of size 8 | |
==26857== at 0x414288: fl_map1 (flisp.c:2322) | |
==26857== by 0x41B947: apply_cl (flisp.c:1272) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== by 0x411810: _applyn (flisp.c:717) | |
==26857== by 0x411B7C: fl_applyn (flisp.c:762) | |
==26857== by 0x42B77F: main (flmain.c:54) | |
==26857== Address 0x5b0dda0 is 2,096,576 bytes inside a block of size 2,097,152 free'd | |
==26857== at 0x4C2CE8E: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) | |
==26857== by 0x4116D4: grow_stack (flisp.c:698) | |
==26857== by 0x41AD47: apply_cl (flisp.c:1095) | |
==26857== by 0x411810: _applyn (flisp.c:717) | |
==26857== by 0x4141F4: fl_map1 (flisp.c:2317) | |
==26857== by 0x41B947: apply_cl (flisp.c:1272) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== | |
==26857== Invalid write of size 8 | |
==26857== at 0x41429E: fl_map1 (flisp.c:2323) | |
==26857== by 0x41B947: apply_cl (flisp.c:1272) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== by 0x411810: _applyn (flisp.c:717) | |
==26857== by 0x411B7C: fl_applyn (flisp.c:762) | |
==26857== by 0x42B77F: main (flmain.c:54) | |
==26857== Address 0x5b0dda0 is 2,096,576 bytes inside a block of size 2,097,152 free'd | |
==26857== at 0x4C2CE8E: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) | |
==26857== by 0x4116D4: grow_stack (flisp.c:698) | |
==26857== by 0x41AD47: apply_cl (flisp.c:1095) | |
==26857== by 0x411810: _applyn (flisp.c:717) | |
==26857== by 0x4141F4: fl_map1 (flisp.c:2317) | |
==26857== by 0x41B947: apply_cl (flisp.c:1272) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== | |
==26857== Invalid read of size 8 | |
==26857== at 0x4146D9: fl_map1 (flisp.c:2361) | |
==26857== by 0x41B947: apply_cl (flisp.c:1272) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== by 0x411810: _applyn (flisp.c:717) | |
==26857== by 0x411B7C: fl_applyn (flisp.c:762) | |
==26857== by 0x42B77F: main (flmain.c:54) | |
==26857== Address 0x5b0dd98 is 2,096,568 bytes inside a block of size 2,097,152 free'd | |
==26857== at 0x4C2CE8E: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) | |
==26857== by 0x4116D4: grow_stack (flisp.c:698) | |
==26857== by 0x41AD47: apply_cl (flisp.c:1095) | |
==26857== by 0x411810: _applyn (flisp.c:717) | |
==26857== by 0x4141F4: fl_map1 (flisp.c:2317) | |
==26857== by 0x41B947: apply_cl (flisp.c:1272) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== by 0x42190A: do_trycatch (flisp.c:938) | |
==26857== by 0x4200F3: apply_cl (flisp.c:1893) | |
==26857== | |
Elapsed time: 1363.558227062225 seconds | |
#t | |
> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment