greg
2018-12-19 17:03:31

I’m seeing udp-receive! lose packets. It happens approximately the same time as a major GC, so I think they’re related, but I’m not sure. Does that sound familiar to anyone who’s done this?


greg
2018-12-19 17:04:05

I understand UDP is inherently unreliable. If Racket didn’t drop the packets, something else might. So on the one hand, this is fine — it’s helpfully exercising my loss-detection. My sender retransmits and eventually all is fine. On the other hand, it does add somewhat to the time-to-success. And I’m just curious if udp-receive! is intended to be unreliable during GC, this way.


greg
2018-12-19 17:05:44

(To clarify, I’m seeing this happen with the sender and receiver as two Racket processes bound to different UDP ports on the same machine. No interweb tubes involved.)


greg
2018-12-19 17:07:37

(To clarify #2, these are small 1200 byte datagrams.)


greg
2018-12-19 19:53:38

That was on 6.10. I see similar on 7.0.


greg
2018-12-19 19:54:16

I just downloaded 7.1.0.10 CS for macOS, and I’m getting an error. Making minimal example….


greg
2018-12-19 19:55:01

Running something like this: #lang racket/base (require racket/udp racket/function) (define port 50000) (define u (udp-open-socket #f #f)) (udp-bind! u #f port #t) (thread (thunk (define buffer (make-bytes 1200)) (for ([(len host port) (in-producer (thunk (udp-receive! u buffer)))]) (displayln (subbytes buffer 0 len))))) (sleep 2) (udp-send-to u "127.0.0.1" port #"Hello") (sync never-evt)


greg
2018-12-19 19:55:40

Outputs: $ /Applications/Racket_v7.1.0.10-CS/bin/racket /tmp/udp.rkt #<thread> invalid memory reference. Some debugging context lost context...: condition->exn dynamic-wind winder-dummy /Users/racket/build/plt/build/cs/racket/src/build/cs/compiled/io.scm:37450:3: do-udp-receive!28 /tmp/udp.rkt:12:2: for-loop /tmp/udp.rkt:10:1 internal error: terminated in atomic mode! context...: /Users/racket/build/plt/build/cs/racket/src/build/cs/compiled/thread.scm:1228:2: internal-error /Users/racket/build/plt/build/cs/racket/src/build/cs/compiled/thread.scm:10114:18 invoke


greg
2018-12-19 19:58:05

It’s probably a simple fix on line 37,450 of io.scm? :smile:


greg
2018-12-19 20:20:53

Simplified a bit more and added as https://github.com/racket/racket/issues/2433


soegaard2
2018-12-19 21:07:49

11


soegaard2
2018-12-19 21:08:11

The number of questions on MetaPost on StackOverflow.


soegaard2
2018-12-19 21:08:20

Does that mean that MetaPost is “dead”?


andreiformiga
2018-12-19 22:05:17

probably


andreiformiga
2018-12-19 22:05:30

I don’t know any TeX/LaTeX users who use metapost


greg
2018-12-19 22:05:35

@soegaard2 I am downvoting because you should discuss this on meta.meta.stackexchange.


soegaard2
2018-12-19 22:06:01

meta meta !?


andreiformiga
2018-12-19 22:06:02

a few years back it was pstricks, nowadays almost everyone (including myself) is using tikz/pgf


greg
2018-12-19 22:06:53

This recursion has no base case and will end badly. :slightly_smiling_face:


andreiformiga
2018-12-19 22:07:04

I wonder if Knuth uses metapost


soegaard2
2018-12-19 22:07:29

Found the Metapost mailing list. Roughly one thread a month.


soegaard2
2018-12-19 22:07:58

What made tikz take over?


andreiformiga
2018-12-19 22:08:26

even metafont seems to be going away? I think with the truetype engines it becomes unnecessary, but I don’t know, maybe it will still be necessary


greg
2018-12-19 22:09:08

andreiformiga
2018-12-19 22:09:38

tikz has a lot of functionality and you can work in many levels, from the level of basic shapes and forms to very high level constructs like “these nodes are a tree, draw it for me”


greg
2018-12-19 22:09:38

quietly backs out


soegaard2
2018-12-19 22:10:00

laughs


andreiformiga
2018-12-19 22:10:09

and it’s independent of the backend, pstricks was tied to postscript generation


soegaard2
2018-12-19 22:10:56

There is an impressive number of ready-made packages for tikz.


andreiformiga
2018-12-19 22:11:12

yeah