Repair pushed.

At Wed, 5 Jun 2019 09:45:58 -0600, Matthew Flatt wrote:
> I had just reached the same conclusion. Specifically, it looks like a
> missing runstack sync in the JIT-inlined `unsafe-make-flrectangular`.
> 
> Thanks!
> 
> At Wed, 5 Jun 2019 11:40:41 -0400, Sam Tobin-Hochstadt wrote:
> > I think this is a miscompilation of `unsafe-make-flrectangular` by the
> > underlying Racket compiler.
> > The below program is a plain racket version of the code, with just one
> > use of unsafe, a call to `unsafe-make-flrectangular`. If that's
> > replaced with `make-flrectangular`, then the program works propetly.
> > Furthermore, if we add a print statement that requires the argument to
> > `unsafe-make-flrectangular`, then the program also works correctly.
> > The program also works correctly with the JIT off, and under RacketCS.
> > https://gist.github.com/samth/683042c4754c1c5ce284794b19dd37e3
> > 
> > On Wed, Jun 5, 2019 at 11:02 AM 'Paulo Matos' via Racket Users
> > <racket-users@googlegroups.com> wrote:
> > >
> > >
> > > On 05/06/2019 16:47, Philip McGrath wrote:
> > > > What version of Racket are you using? I get a segfault in 7.2, but 7.3
> > > > works for me.
> > >
> > > I see the segfault in 7.1 but not in 7.2 or 7.3. Then I run it under
> > > valgrind and I see it in all the versions. :)
> > > It's there, but sometimes hiding.
> > >
> > > Will take a look.
> > >
> > > > -Philip
> > > >
> > > >
> > > > On Wed, Jun 5, 2019 at 10:42 AM James Geddes <james.ged...@gmail.com
> > > > <mailto:james.ged...@gmail.com>> wrote:
> > > >
> > > >     Dear All,
> > > >
> > > >     The following Typed Racket program is intended to produce an image
> > > >     of the Mandelbrot set (but it doesn't bother actually displaying the
> > > >     image).
> > > >
> > > >     Running the program using command-line Racket causes a crash.
> > > >     Specifically, Racket terminates with the error message:
> > > >
> > > >             Segmentation fault: 11
> > > >
> > > >     However,
> > > >
> > > >     1. The program runs successfully in DrRacket;
> > > >
> > > >     2. Reducing the size of the image to, say, 200 x 200 (by changing
> > > >     the last arguments in the calls to `make-ticks`) also results in
> > > >     successful termination, without a segmentation fault.
> > > >
> > > >     Any advice appreciated!
> > > >
> > > >     (PS: I'm not actually that interested in making pictures. I'm trying
> > > >     to do some speed benchmarks to show my colleagues, particularly
> > > >     those who argue that Python is faster, and this example happened to
> > > >     be on hand.)
> > > >
> > > >
> > > >     James
> > > >
> > > >
> > > >
> > > >
> > > >     #lang typed/racket
> > > >
> > > >     ;; Generate an image of the Mandelbrot set
> > > >     (https://en.wikipedia.org/wiki/Mandelbrot_set)
> > > >
> > > >     (define *iteration-limit* : Integer 50)
> > > >
> > > >     (: mandel (-> Float-Complex Integer))
> > > >     ;; Given c, iterate z <- z^2 + c starting from z = 0 until either
> > > >     |z| > 2 or the number of iterations
> > > >     ;; exceeds *iteration-limit*. Returns the number of iterations 
> > required.
> > > >     (define (mandel c)
> > > >       (let mandel-iter ([z 0.0+0.0i]
> > > >                         [i 0])
> > > >         (if (or (>= i *iteration-limit*) (> (magnitude z) 2.0))
> > > >             i
> > > >             (mandel-iter (+ c (sqr z)) (+ i 1)))))
> > > >
> > > >     (: brot ((Listof Float) (Listof Float) -> (Listof Integer)))
> > > >     ;; Apply mandel to a rectangular grid of complex numbers
> > > >     (define (brot xs ys)
> > > >       (for*/list : [Listof Integer]
> > > >           ([y (in-list ys)]
> > > >            [x (in-list xs)])
> > > >         (mandel (make-rectangular x y))))
> > > >
> > > >     (: make-ticks (-> Float Float Integer (Listof Float)))
> > > >     (define (make-ticks min max resolution)
> > > >       (range min max (/ (- max min) resolution)))
> > > >
> > > >     (define *xs* (make-ticks -1.5 0.5 300))
> > > >     (define *ys* (make-ticks -1.0 1.0 300))
> > > >
> > > >     ;; Compute a Mandelbrot image (but then discard it)
> > > >     (void (brot *xs* *ys*))
> > > >
> > > >
> > > >
> > > >
> > > >     --
> > > >     You received this message because you are subscribed to the Google
> > > >     Groups "Racket Users" group.
> > > >     To unsubscribe from this group and stop receiving emails from it,
> > > >     send an email to racket-users+unsubscr...@googlegroups.com
> > > >     <mailto:racket-users%2bunsubscr...@googlegroups.com>.
> > > >     To view this discussion on the web visit
> > > >     
> > 
> https://groups.google.com/d/msgid/racket-users/194F0EE9-0B9E-412B-A2C0-BCE51CD0
> > AA75%40gmail.com.
> > > >     For more options, visit https://groups.google.com/d/optout.
> > > >
> > > > --
> > > > You received this message because you are subscribed to the Google
> > > > Groups "Racket Users" group.
> > > > To unsubscribe from this group and stop receiving emails from it, send
> > > > an email to racket-users+unsubscr...@googlegroups.com
> > > > <mailto:racket-users+unsubscr...@googlegroups.com>.
> > > > To view this discussion on the web visit
> > > > 
> > 
> https://groups.google.com/d/msgid/racket-users/CAH3z3gY4Cte5p0ZuY6yCmjAc1jjebZQ
> > 6GTaQQZJXQxdoqaop2Q%40mail.gmail.com
> > > > 
> > 
> <https://groups.google.com/d/msgid/racket-users/CAH3z3gY4Cte5p0ZuY6yCmjAc1jjebZ
> > Q6GTaQQZJXQxdoqaop2Q%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> > > > For more options, visit https://groups.google.com/d/optout.
> > >
> > > --
> > > Paulo Matos
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > "Racket Users" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to racket-users+unsubscr...@googlegroups.com.
> > > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/racket-users/cea3ba1c-64fe-2d39-a8ed-98570751
> > fb3e%40linki.tools.
> > > For more options, visit https://groups.google.com/d/optout.
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to racket-users+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BaX%2Bh4%3DEAOt4qYC8dB
> > 8JfPCRUfHvo0C8C-BnbzAfdfuqw%40mail.gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/5cf7e3b9.1c69fb81.74606.c239SMTP
> IN_ADDED_MISSING%40gmr-mx.google.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/5cf7e931.1c69fb81.295e5.1f94SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to