Forwarding this with permission to the kind folks on racket-users…

I’m having a strange problem with raco test; specifically, performing raco test 
on a file in a collection from the racket-poppler collection generates error 
text very fast… about 3 megabytes per second… with this text (apparently) 
repeated ad infinitum:

> > internal error: attempt to deschedule the current thread in atomic mode
> > exception raised by exception handler: abort-current-continuation: contract 
> > violation
> >   expected: continuation-prompt-tag?
> >   given: [?error-value->string-handler not ready?]; original exception 
> > raised: internal error: attempt to deschedule the current thread in atomic 
> > mode
> >   context...:
> >    proc
> >    loop
> >    call-in-empty-metacontinuation-frame
> >    abort-current-continuation
> >    loop
> >    call-in-empty-metacontinuation-frame
> >    l
> >    loop
> >    dynamic-wind
> >    temp52_0
> >    .../ffi/unsafe.rkt:2117:27: loop
> >    .../private/more-scheme.rkt:265:2: call-with-exception-handler
> >    call-in-empty-metacontinuation-frame
> >    .../ffi/unsafe.rkt:2104:19: retry-loop
> >    call-in-empty-metacontinuation-frame
> >    call-with-empty-metacontinuation-frame-for-swap

(a longer prefix appears below)

However, copying the same file to /tmp/ and running raco test on that file 
produces much saner output (included below). 

The bad news: this package uses ffi, so in some sense all bets are off.

The important question: is this difference likely to be the result of a “real" 
internal error in racket, and it would be a good idea to try and track it down, 
or is this a known problem with raco test, or something else entirely?

FWIW, this is stock 7.6, running on macOS 10.15.2.

Any thoughts welcome!

John

> On Feb 20, 2020, at 4:02 PM, Jens Axel Søgaard <jensa...@soegaard.net> wrote:
> 
> > BTW, is it okay with you if I forward this to racket-users? I feel like 
> > people there might be better able to answer some of these questions.
> 
> Of course. 
> 
> I might have forgotten to try the examples when I updated racket-poppler to 
> work with latex-pict.
> 
> And I just notices that the docs of latex-pict is missing on 
> docs.racket-lang.org.
> You hopefully found them in the source, but if not the beginning of 
> 
> https://github.com/soegaard/latex-pict/blob/master/latex-pict/tex.rkt
> 
> contains an explanation.
> 
> /Jens Axel
> 
> 
> 
> Den fre. 21. feb. 2020 kl. 00.56 skrev John Clements 
> <cleme...@brinckerhoff.org>:
> Okay, that worked! Good to see.
> 
> On the topic of the output explosion … I’m not sure exactly what’s going on. 
> The problem appears to be related to the “test-pdf-functions.rkt” file, but 
> when I run it directly, I get a different and more sensible error
> 
> hardy:/tmp clements> /Applications/Racket\ v7.6/bin/racket 
> /Users/clements/Library/Racket/7.6/pkgs/racket-poppler/racket-poppler/examples/test-pdf-functions.rkt
> #f
> #f
> pdf-title: contract violation
>   expected: pdf?
>   given: #f
>   in: the 1st argument of
>       (-> pdf? (or/c false? string?))
>   contract from: 
>       <pkgs>/racket-poppler/racket-poppler/main.rkt
>   blaming: 
> <pkgs>/racket-poppler/racket-poppler/examples/test-pdf-functions.rkt
>    (assuming the contract is correct)
>   at: <pkgs>/racket-poppler/racket-poppler/main.rkt:42.2
>   context...:
>    .../private/blame.rkt:347:0: raise-blame-error
>    .../private/arrow-val-first.rkt:486:18
>    call-with-values
>    call-in-empty-metacontinuation-frame
>    body of 
> "/Users/clements/Library/Racket/7.6/pkgs/racket-poppler/racket-poppler/examples/test-pdf-functions.rkt"
>    temp35_0
>    for-loop
>    run-module-instance!
>    perform-require!
>    namespace-require+
>    #%for-each
>    call-in-empty-metacontinuation-frame
>    [repeats 1 more time]
>    call-with-empty-metacontinuation-frame-for-swap
> 
> I’m not sure why calling it with raco test causes the explosion, especially 
> since I don’t see any use of test-specific functions in this file.
> 
> BTW, is it okay with you if I forward this to racket-users? I feel like 
> people there might be better able to answer some of these questions.
> 
> John
> 
> 
> > On Feb 20, 2020, at 3:41 PM, Jens Axel Søgaard <jensa...@soegaard.net> 
> > wrote:
> > 
> > 
> > Den fre. 21. feb. 2020 kl. 00.35 skrev John Clements 
> > <cleme...@brinckerhoff.org>:
> > Whoa! 
> > 
> > I just tried installing racket-poppler on my 7.6 installation, and tried 
> > running 
> > 
> > raco test -p racket-poppler
> > 
> > and generated a LOT of error text very quickly. I redirected it to a file 
> > and it generated 95 Megabytes quite quickly. After the first few pages, 
> > though, you see a pattern. 
> > 
> > FWIW, this is on macOS 10.15.2.
> > 
> > I see the same as you - but I don't know what that command is running.
> > I don't made any tests for racket-poppler?
> > 
> > I just tried this program in DrRacket 7.6 CS
> > 
> > #lang racket
> > (require racket-poppler latex-pict pict)
> > (pict->bitmap (tex-math "1+x"))
> > 
> > and that worked fine.
> > 
> > By the way - you might need to update to TexLive 2019 if you haven't 
> > already.
> > 
> > pdflatex
> > This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded 
> > format=pdflatex)
> >  restricted \write18 enabled.
> >  
> > /Jens Axel
> > 
> > 
> > Here’s the first few hundred lines.
> > 
> > 
> > hardy:/tmp clements> head -150 zz.txt  
> > raco test: "/Users/clements/Library/Racket/7.6/pkgs/racket-poppler/info.rkt"
> > raco test: 
> > "/Users/clements/Library/Racket/7.6/pkgs/racket-poppler/racket-poppler/examples/test-pdf-functions.rkt"
> > cpointer-ref: contract violation
> >   expected: cpointer?
> >   given: "The Racket Guide\nVersion 5.3.4.11\nMatthew Flatt,\nRobert Bruce 
> > Findler,\nand PLT\nJune 9, 2013\nThis guide is intended for programmers who 
> > are new to Racket or new to some part of\nRacket. It assumes programming 
> > experience, so if you are new to programming, consider\ninstead reading How 
> > to Design Programs. If you want an especially quick introduction 
> > to\nRacket, start with Quick: An Introduction to Racket with 
> > Pictures.\nChapter 2 provides a brief introduction to Racket. From Chapter 
> > 3 on, this guide dives into\ndetails—covering much of the Racket toolbox, 
> > but leaving precise details to The Racket\nReference and other reference 
> > manuals.\n1"
> > exception raised by exception handler: abort-current-continuation: contract 
> > violation
> >   expected: continuation-prompt-tag?
> >   given: [?error-value->string-handler not ready?]; original exception 
> > raised: cpointer-ref: contract violation
> >   expected: cpointer?
> >   given: "The Racket Guide\nVersion 5.3.4.11\nMatthew Flatt,\nRobert Bruce 
> > Findler,\nand PLT\nJune 9, 2013\nThis guide is intended for programmers who 
> > are new to Racket or new to some part of\nRacket. It assumes programming 
> > experience, so if you are new to programming, consider\ninstead reading How 
> > to Design Programs. If you want an especially quick introduction 
> > to\nRacket, start with Quick: An Introduction to Racket with 
> > Pictures.\nChapter 2 provides a brief introduction to Racket. From Chapter 
> > 3 on, this guide dives into\ndetails—covering much of the Racket toolbox, 
> > but leaving precise details to The Racket\nReference and other reference 
> > manuals.\n1"
> >   context...:
> >    proc
> >    loop
> >    call-in-empty-metacontinuation-frame
> >    abort-current-continuation
> >    loop
> >    call-in-empty-metacontinuation-frame
> >    .../unsafe/alloc.rkt:35:6: loop
> >    .../unsafe/alloc.rkt:27:0: deallocate
> >    .../ffi/unsafe.rkt:2117:27: loop
> >    .../private/more-scheme.rkt:265:2: call-with-exception-handler
> >    call-in-empty-metacontinuation-frame
> >    .../ffi/unsafe.rkt:2104:19: retry-loop
> >    call-in-empty-metacontinuation-frame
> >    call-with-empty-metacontinuation-frame-for-swap
> > cpointer-ref: contract violation
> >   expected: cpointer?
> >   given: "The Racket Guide\nVersion 5.3.4.11\nMatthew Flatt,\nRobert Bruce 
> > Findler,\nand PLT\nJune 9, 2013\nThis guide is intended for programmers who 
> > are new to Racket or new to some part of\nRacket. It assumes programming 
> > experience, so if you are new to programming, consider\ninstead reading How 
> > to Design Programs. If you want an especially quick introduction 
> > to\nRacket, start with Quick: An Introduction to Racket with 
> > Pictures.\nChapter 2 provides a brief introduction to Racket. From Chapter 
> > 3 on, this guide dives into\ndetails—covering much of the Racket toolbox, 
> > but leaving precise details to The Racket\nReference and other reference 
> > manuals."
> > exception raised by exception handler: abort-current-continuation: contract 
> > violation
> >   expected: continuation-prompt-tag?
> >   given: [?error-value->string-handler not ready?]; original exception 
> > raised: cpointer-ref: contract violation
> >   expected: cpointer?
> >   given: "The Racket Guide\nVersion 5.3.4.11\nMatthew Flatt,\nRobert Bruce 
> > Findler,\nand PLT\nJune 9, 2013\nThis guide is intended for programmers who 
> > are new to Racket or new to some part of\nRacket. It assumes programming 
> > experience, so if you are new to programming, consider\ninstead reading How 
> > to Design Programs. If you want an especially quick introduction 
> > to\nRacket, start with Quick: An Introduction to Racket with 
> > Pictures.\nChapter 2 provides a brief introduction to Racket. From Chapter 
> > 3 on, this guide dives into\ndetails—covering much of the Racket toolbox, 
> > but leaving precise details to The Racket\nReference and other reference 
> > manuals."
> >   context...:
> >    proc
> >    loop
> >    call-in-empty-metacontinuation-frame
> >    abort-current-continuation
> >    loop
> >    call-in-empty-metacontinuation-frame
> >    .../unsafe/alloc.rkt:35:6: loop
> >    .../unsafe/alloc.rkt:27:0: deallocate
> >    .../ffi/unsafe.rkt:2117:27: loop
> >    .../private/more-scheme.rkt:265:2: call-with-exception-handler
> >    call-in-empty-metacontinuation-frame
> >    .../ffi/unsafe.rkt:2104:19: retry-loop
> >    call-in-empty-metacontinuation-frame
> >    call-with-empty-metacontinuation-frame-for-swap
> > cpointer-ref: contract violation
> >   expected: cpointer?
> >   given: "pdfTeX-1.40.3"
> > exception raised by exception handler: abort-current-continuation: contract 
> > violation
> >   expected: continuation-prompt-tag?
> >   given: [?error-value->string-handler not ready?]; original exception 
> > raised: cpointer-ref: contract violation
> >   expected: cpointer?
> >   given: "pdfTeX-1.40.3"
> >   context...:
> >    proc
> >    loop
> >    call-in-empty-metacontinuation-frame
> >    abort-current-continuation
> >    loop
> >    call-in-empty-metacontinuation-frame
> >    .../unsafe/alloc.rkt:35:6: loop
> >    .../unsafe/alloc.rkt:27:0: deallocate
> >    .../ffi/unsafe.rkt:2117:27: loop
> >    .../private/more-scheme.rkt:265:2: call-with-exception-handler
> >    call-in-empty-metacontinuation-frame
> >    .../ffi/unsafe.rkt:2104:19: retry-loop
> >    call-in-empty-metacontinuation-frame
> >    call-with-empty-metacontinuation-frame-for-swap
> > cpointer-ref: contract violation
> >   expected: cpointer?
> >   given: "LaTeX with hyperref package"
> > exception raised by exception handler: abort-current-continuation: contract 
> > violation
> >   expected: continuation-prompt-tag?
> >   given: [?error-value->string-handler not ready?]; original exception 
> > raised: cpointer-ref: contract violation
> >   expected: cpointer?
> >   given: "LaTeX with hyperref package"
> >   context...:
> >    proc
> >    loop
> >    call-in-empty-metacontinuation-frame
> >    abort-current-continuation
> >    loop
> >    call-in-empty-metacontinuation-frame
> >    .../unsafe/alloc.rkt:35:6: loop
> >    .../unsafe/alloc.rkt:27:0: deallocate
> >    .../ffi/unsafe.rkt:2117:27: loop
> >    .../private/more-scheme.rkt:265:2: call-with-exception-handler
> >    call-in-empty-metacontinuation-frame
> >    .../ffi/unsafe.rkt:2104:19: retry-loop
> >    call-in-empty-metacontinuation-frame
> >    call-with-empty-metacontinuation-frame-for-swap
> > internal error: attempt to deschedule the current thread in atomic mode
> > exception raised by exception handler: abort-current-continuation: contract 
> > violation
> >   expected: continuation-prompt-tag?
> >   given: [?error-value->string-handler not ready?]; original exception 
> > raised: internal error: attempt to deschedule the current thread in atomic 
> > mode
> >   context...:
> >    proc
> >    loop
> >    call-in-empty-metacontinuation-frame
> >    abort-current-continuation
> >    loop
> >    call-in-empty-metacontinuation-frame
> >    l
> >    loop
> >    dynamic-wind
> >    temp52_0
> >    .../ffi/unsafe.rkt:2117:27: loop
> >    .../private/more-scheme.rkt:265:2: call-with-exception-handler
> >    call-in-empty-metacontinuation-frame
> >    .../ffi/unsafe.rkt:2104:19: retry-loop
> >    call-in-empty-metacontinuation-frame
> >    call-with-empty-metacontinuation-frame-for-swap
> > internal error: attempt to deschedule the current thread in atomic mode
> > exception raised by exception handler: abort-current-continuation: contract 
> > violation
> >   expected: continuation-prompt-tag?
> >   given: [?error-value->string-handler not ready?]; original exception 
> > raised: internal error: attempt to deschedule the current thread in atomic 
> > mode
> >   context...:
> >    proc
> >    loop
> >    call-in-empty-metacontinuation-frame
> >    abort-current-continuation
> >    loop
> >    call-in-empty-metacontinuation-frame
> >    l
> >    loop
> >    dynamic-wind
> >    temp52_0
> >    .../ffi/unsafe.rkt:2117:27: loop
> >    .../private/more-scheme.rkt:265:2: call-with-exception-handler
> >    call-in-empty-metacontinuation-frame
> >    .../ffi/unsafe.rkt:2104:19: retry-loop
> >    call-in-empty-metacontinuation-frame
> >    call-with-empty-metacontinuation-frame-for-swap
> > internal error: attempt to deschedule the current thread in atomic mode
> > exception raised by exception handler: abort-current-continuation: contract 
> > violation
> >   expected: continuation-prompt-tag?
> >   given: [?error-value->string-handler not ready?]; original exception 
> > raised: internal error: attempt to deschedule the current thread in atomic 
> > mode
> >   context...:
> >    proc
> >    loop
> >    call-in-empty-metacontinuation-frame
> >    abort-current-continuation
> >    loop
> >    call-in-empty-metacontinuation-frame
> >    l
> >    loop
> >    dynamic-wind
> > 
> > … and on and on for another 95 megabytes.
> > 
> > Any thoughts? What does raco test -p racket-poppler produce in your machine?
> > 
> > John
> > 
> > 
> > > On Feb 20, 2020, at 3:11 PM, Jens Axel Søgaard <jensa...@soegaard.net> 
> > > wrote:
> > > 
> > > Hi Again,
> > > 
> > > It's working with stock 7.6. Note that DrRacket doesn't render the picts 
> > > correctly in the repl, so you need 
> > > to use 
> > > 
> > >     (pict->bitmap (tex-math "x+1"))
> > > 
> > > when using the repl. The reason is that DrRacket doesn't render the 
> > > original pict; it makes a copy
> > > and renders the copy - but it can't copy picts that call out to the Cairo 
> > > interface directly.
> > > 
> > > Den tor. 20. feb. 2020 kl. 23.45 skrev John Clements 
> > > <cleme...@brinckerhoff.org>:
> > > Yes, I’m pretty much certain that the draw libraries were updated. 
> > > Specifically, they had to be recompiled to comply with Apple’s 
> > > notarization requirements.
> > > 
> > > Is the requirement that the two cairo libraries have the same interface, 
> > > or must they literally be binarily compatible? 
> > > 
> > > I don't know for sure - but I think the latter. 
> > > 
> > > The first time I got Poppler working I managed to build both all Racket 
> > > libraries and Poppler
> > > and documented how I did. I believe that led Flatt to make some scripts 
> > > in order to make it 
> > > less painfull. 
> > > 
> > > Since then Flatt has kindly built Poppler each time the draw libraries 
> > > were updated.
> > > Then I put them on https://github.com/soegaard/poppler-libs
> > >  
> > > Also, is there any way to check the compatibility before dumping core? 
> > > 
> > > I don't know - but I do remember that I learned to check whether the 
> > > dynamic
> > > linker used the proper libraries. 
> > > 
> > > See the last section of "Tips and tricks":
> > > 
> > >     https://github.com/soegaard/racket-osx-libs
> > > 
> > > /Jens Axel
> > > 
> > >  
> > 
> > 
> > 
> > 
> > 
> > -- 
> > -- 
> > Jens Axel Søgaard
> > 
> 
> 
> 
> 
> 
> -- 
> -- 
> Jens Axel Søgaard
> 



-- 
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/5d596084-9dc5-44c3-ae01-dc50fcf6027b%40mtasv.net.

Reply via email to