laurent.orseau
2021-6-25 08:08:47

Is anyone able to estimate how many person-week would be required to have a much more user friendly package server? I think it’s lacking a lot of validation and user feedback mostly.


shigemichik
2021-6-25 08:24:17

@shigemichik has joined the channel


sschwarzer
2021-6-25 09:28:17

@jbclements This happened to me many times when I tried to enter my packages. :disappointed: A workaround for me was to leave tags and description empty and add them after the package was in the database. Don’t ask me why it worked then.


sschwarzer
2021-6-25 09:30:37

jbclements
2021-6-25 10:00:59

Thanks so much! This workaround worked for me. I added a bump to your issue, many thanks.


massung
2021-6-25 12:16:04

Just wanted to note I had the exact same thing happen to me when adding the canvas-list package last week, First time the fields just reset, no messages, and I couldn’t find it after 15 (or so) minutes. So I tried again and the second time worked. If I happened to do something different, I have no idea what it was.


jjsimpso
2021-6-25 20:05:23

The following code crashes with some(most) JPEGs I try to load, but I’ve never seen it crash with a PNG of GIF. It almost seems like the jpeg insert is spawning a thread and it crashes when I try to close the input port. (define img (make-object image-snip% (gopher-response-data-port resp) 'unknown)) (send page-text erase) (send page-text insert img) (send page-text set-position 0) (close-input-port (gopher-response-data-port resp)) Here’s the error: ; internal error: attempt to deschedule the current thread in atomic mode ; Context (plain; to see better errortrace context, re-run with C-u prefix): ; /usr/local/racket/collects/racket/private/port.rkt:113:0 copy-port ; /usr/local/racket/share/pkgs/draw-lib/racket/draw/unsafe/callback.rkt:75:0 sanitize-input-port ; /usr/local/racket/share/pkgs/draw-lib/racket/draw/unsafe/jpeg.rkt:630:3 ; /usr/local/racket/collects/ffi/unsafe/alloc.rkt:80:14 ; /usr/local/racket/collects/ffi/unsafe/atomic.rkt:73:13 ; /usr/local/racket/share/pkgs/draw-lib/racket/draw/private/bitmap.rkt:455:4 do-load-bitmap/dispatch/known method in bitmap% ; /usr/local/racket/share/pkgs/draw-lib/racket/draw/private/bitmap.rkt:424:4 do-load-bitmap/port method in bitmap% ; /usr/local/racket/share/pkgs/draw-lib/racket/draw/private/syntax.rkt:234:25 ; /usr/local/racket/share/pkgs/draw-lib/racket/draw/private/bitmap.rkt:170:2 ; /usr/local/racket/collects/racket/private/class-internal.rkt:3590:0 continue-make-object ; /usr/local/racket/collects/racket/private/class-internal.rkt:3590:0 continue-make-object ; /usr/local/racket/collects/racket/private/class-internal.rkt:3565:0 do-make-object/real-class ; /usr/local/racket/share/pkgs/snip-lib/racket/snip/private/snip.rkt:1099:2 load-file method in image-snip% ; /usr/local/racket/collects/racket/private/class-internal.rkt:3590:0 continue-make-object ; /usr/local/racket/collects/racket/private/class-internal.rkt:3590:0 continue-make-object ; /usr/local/racket/collects/racket/private/class-internal.rkt:3565:0 do-make-object/real-class


jjsimpso
2021-6-25 20:08:29

Well, I tested removing the close-input-port call and that didn’t solve the crash. This crash wasn’t happening in an earlier version, but this code is now running in its own thread and I may have changed some other things as well since then.


jjsimpso
2021-6-25 20:15:32

Perhaps ‘make-object image-snip%’ is spawning a thread? It seems like a low-level problem, but please let me know if there are any gotchas with regard to using image-snips.


mflatt
2021-6-25 20:17:20

It looks like the JPEG reader is broken. It’s attempting to use sanitize-input-port to read all the data from the port — so it can use that data in a context that has to run in atomic mode. But the function that does that is itself put in atomic mode by an allocator wrapper. So, it runs into exactly the problem that it’s trying to avoid.


jjsimpso
2021-6-25 20:18:46

I may have been running 8.0cs when I initially tested the jpeg code. I’m on 8.1cs now, so potentially this was introduced then.


mflatt
2021-6-25 20:19:09

It’s CS-specific, but I don’t know whether v8.1 made it worse than v8.0 somehow.


jjsimpso
2021-6-25 20:20:38

I mean that it may have been introduced in 8.1cs, because I think it was working in 8.0cs. Or else something else about my program changed to exacerbate the issue.


jjsimpso
2021-6-25 20:21:22

Either way, it looks like you have a handle on it. I can file a bug if you’d like me to.


soegaard2
2021-6-25 20:23:02

Is it a particular jpeg or all?


mflatt
2021-6-25 20:23:27

If you need a workaround meanwhile, I think you can copy the input port to a pipe, and use the new read of the pipe instead of the original port. (Don’t forget to close the write end of the pipe.)


jjsimpso
2021-6-25 20:24:18

Most of them. It seems like really small jpegs load at least some of the time.


jjsimpso
2021-6-25 20:25:18

Really small is about 20KB in this case.


mflatt
2021-6-25 20:42:38

I’ve pushed a repair. Thanks for the report!


jjsimpso
2021-6-25 20:53:28

Great. Thanks!


blerner
2021-6-25 21:57:29

hopefully simple question: how can I use string-split to split on (the regex of any repeats of whitespace \s or the null zero character \u0000)?


blerner
2021-6-25 22:01:00

(i.e., I want to write #rx"\\s+\|\\u0000", but it doesn’t seem to be working)


mflatt
2021-6-25 22:05:10

I think you want #px"\\s+\|\u0000"p instead of r, and no extra \ before \u.


blerner
2021-6-25 22:06:36

thanks! I think the docs for this are a bit unhelpful: the only bit I could find regarding null zero was at https://docs.racket-lang.org/reference/regexp.html?q=regexp#%28part._regexp-syntax%29, which shows


blerner
2021-6-25 22:06:43

which seems to be an incomplete expression…


mflatt
2021-6-25 22:09:30

"\u0000" or just "\0" is a string with a nul character, and regexps are encoded with string literals. So, #px"\u0000" matches a nul character in the same way that #px"a" matches the letter “a”.


blerner
2021-6-25 22:11:44

right; I think I’d tried \0 with two slashes, and got a backreference, or something like that. But regardless, in the screenshot of the docs above, it shows a bare backslash with nothing whatsoever after it — is that correct?


mflatt
2021-6-25 22:11:52

I had definitely forgotten that #px"\\" matches a nul character. That must have been grandfathered in due to a bug somewhere.


mflatt
2021-6-25 22:12:54

Keep in mind that all the gray-background stuff in the regexp description shows literal characters, not the way those characters have to be encoded as a string.


mflatt
2021-6-25 22:16:45

You’re right that "\\0" would be a (useless) backreference in #px mode, and it’s a literal 0 in #rx mode. There’s no end of ways to be confused with this syntax and variant.


jbclements
2021-6-25 22:51:36

Ooh, sounds like a good time to ask: is there any interest in supporting Olin Shivers’ SRE regexp syntax or something vaguely similar? I did just add Alex Shinn’s irregex package to the package server, so there’s at least some way to get the job done, but it did seem strange to me that there’s no way to construct regexps in Racket that doesn’t involve string hygiene challenges.