[racket-dev] Strage 5.0.99.5 segfault

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Dec 28 20:32:38 EST 2010

Thanks for the report!

As it happens, I think I fixed this a few minutes ago:

 http://git.racket-lang.org/plt/commit/3b032893c1b9f74b04d0803ecd0f20c1d101dd11

Just to make sure before trying a new version, you might confirm that
the bug goes away if you disable the JIT (e.g., with "-j").

At Wed, 29 Dec 2010 02:27:56 +0100, Jakub Piotr Cłapa wrote:
> Hello,
> 
> I found out a very peculiar for for/list combo that segfaults both the 
> CLI racket and DrRacket (Intel OS X) on the current nightly build.
> 
> When I run the code (see below) it only works for empty input. When I 
> pass at least one line it segfaults. The (invalid) use of multiple 
> values is critical as is actually calling eof-object? on the result of 
> peek-char.
> 
> My other version does not crash (just reports the invalidity of multiple 
> values in this context). It was compiled somewhere after 5.0.99.4 
> (probably just after the websocket-client SSL merge but I am not sure).
> 
> Below is the misbehaving code, some test run outputs and a backtrace.
> 
> 
> #lang racket
> (let ([in (current-input-port)])
>    (for/list ([p (in-producer (λ () (file-position in)) #f)]
>               [l (in-lines in)]
>               #:when (eof-object? (peek-char in)))
>      (values l p)))
> 
> 
> Expected output:
> 
> 
> [jpc at jpc WK2009] echo "1" | racket- for-test.rkt
> context expected 1 value, received 2 values: "1" 0
> 
>   === context ===
> /Users/jpc/Projects/regaz/WK2009/for-test.rkt:3:2: for-loop
> /Users/jpc/Projects/regaz/WK2009/for-test.rkt: [running body]
> 
> 
> Got:
> 
> 
> [jpc at jpc WK2009] echo "1" | racket for-test.rkt
> Seg fault (internal error) at 0x6
> 
> 
> A quick backtrace I was able to get:
> 
> 
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_PROTECTION_FAILURE at address: 0x00000006
> 0x0015c8fb in check_cycles_fast ()
> (gdb) bt
> #0  0x0015c8fb in check_cycles_fast ()
> #1  0x0015c9d7 in check_cycles_fast ()
> #2  0x00167924 in print_to_string ()
> #3  0x00167e9c in print_to_port ()
> #4  0x00167f1c in scheme_internal_print ()
> #5  0x00156270 in sch_default_global_port_print_handler ()
> #6  0x000520a4 in scheme_do_eval ()
> #7  0x0014f8e1 in sch_default_print_handler ()
> #8  0x001593ed in display_write ()
> #9  0x000520a4 in scheme_do_eval ()
> #10 0x00086444 in scheme_default_print_handler ()
> #11 0x000520a4 in scheme_do_eval ()
> #12 0x0007953c in for_each ()
> #13 0x00756ead in ?? ()
> #14 0x0005158c in scheme_do_eval ()
> #15 0x000fae1e in body_one_expr ()
> #16 0x0005259c in scheme_do_eval ()
> #17 0x0007b1b8 in scheme_finish_apply_for_prompt ()
> #18 0x0007b357 in scheme_apply_for_prompt ()
> #19 0x00085130 in call_with_prompt ()
> #20 0x000520a4 in scheme_do_eval ()
> #21 0x0007b572 in do_call_with_prompt ()
> #22 0x000fb160 in scheme_module_run_finish ()
> #23 0x002ff3a3 in ?? ()
> #24 0x000e8af6 in scheme_module_run_start ()
> #25 0x0010107a in eval_module_body ()
> #26 0x001011f9 in do_start_module ()
> #27 0x00106f81 in start_module ()
> #28 0x0010affc in parse_requires ()
> #29 0x0010c59c in do_namespace_require ()
> #30 0x000520a4 in scheme_do_eval ()
> #31 0x00074e44 in apply_k ()
> #32 0x00074536 in scheme_top_level_do_worker ()
> #33 0x00074778 in scheme_top_level_do ()
> #34 0x000035f0 in finish_cmd_line_run ()
> #35 0x0000458a in main_after_stack ()
> #36 0x0000c0a3 in scheme_main_stack_setup ()
> #37 0x00002b46 in main ()
> 
> 
> -- 
> regards,
> Jakub Piotr Cłapa
> _________________________________________________
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/dev


Posted on the dev mailing list.