For a few days, `primitiveScreenScaleFactor` fails on headless Linux/X11 VMs. Reprocase:
1. Download and extract the latest AiO bundle from today 2. ```bash $ cat << EOF > test.st TranscriptStream redirectToStdOut: true. Transcript showln: DisplayScreen actualScreenScaleFactor asString. EOF $ ./squeak.sh --headless "$(realpath test.st)" ``` 3. stack overflow: ``` DisplayScreen>>#actualScreenScaleFactor
stack page bytes 8192 available headroom 5576 minimum unused headroom 6016
(Segmentation fault) Aborted (core dumped) ```
8 days again, this still worked. See also: https://github.com/LinqLover/create-image/actions/workflows/test.yml
@marceltaeumel Does this require a fix similar to 2a0e7851d0e057b06e77e64a58e155d9c7935e6a?
PS: I noted a still existing typo here: https://sourcegraph.com/search?q=context:global+ioSceenScaleFactor+repo:%5Eg...
I'm working on a fix. :-)
Does this require a fix similar to https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/2a0e7851d0e057b06e7...
Well, since it worked before VMMaker.oscog-eem.3183, I don't think so. Hmm...
Maybe we cannot trust the timestamps in the OSVM repo because this bug is also related to image changes? Hmm...
Yeah, does not work with OSVM sources from Apr 13 either. Since the last run that worked was from Apr 18, I suspect some image-level changes between then and now. This thing is active in the image since Apr 6: http://lists.squeakfoundation.org/pipermail/squeak-dev/2022-April/219799.htm...
Ah, I see. Last week, I changed the bundled VM. That's why your seven-day CI job showed that issue only now. :-)
I've already identified the causes and will commit a fix soon! :-)
Nice! I have another strange effect here. When I remove `scaleIconToDisplay` from `currentCursor:`, I the platform starts reporting a scale factor of "1.25" instead of "1.0" ... is this releated? What's the platform-scale-factor in your setup?
The image I try does not have the wizard open but sets the cursor:
``` 0x7ffdb7830e48 I Cursor class>currentCursor: 0x564895d0f848: a(n) Cursor 0x7ffdb7830e90 I CursorWithMask(Cursor)>show 0x564896169230: a(n) CursorWithMask 0x7ffdb7830ee0 I SmalltalkImage>snapshot:andQuit:withExitCode:embedded: 0x564895d43640: a(n) SmalltalkImage 0x564898dea4e0 s SmalltalkImage>snapshot:andQuit:embedded: 0x564898deaa58 s SmalltalkImage>snapshot:andQuit: ```
`Cursor` is higher up the start-up list than `ReleaseBuilder`:
``` 0x7ffdf2458c70 I DisplayScreen class>checkForNewScreenScaleFactor 0x2b0e5c8: a(n) DisplayScreen 0x7ffdf2458cc0 I WorldState>doOneCycleNowFor: 0x36cf768: a(n) WorldState 0x7ffdf2458d08 I WorldState>doOneCycleFor: 0x36cf768: a(n) WorldState 0x7ffdf2458d50 I PasteUpMorph>doOneCycle 0x36dacf8: a(n) PasteUpMorph 0x7ffdf2458d90 I PreferenceWizardMorph>refreshWorld 0x2274070: a(n) PreferenceWizardMorph 0x7ffdf2458dd0 I PreferenceWizardMorph>showWelcome 0x2274070: a(n) PreferenceWizardMorph ```
I see. There is a difference betwen `--headless` and `--nodisplay`. The former still uses `vm-display-X11` but frees certain variables. That then requires checks for the `headless` variable such as in `display_ioScreenSize`.
There are no such checks in `display_ioScreenScaleFactor`. That's the bug?
Yes, adding the following to line 4897 in sqUnixX11.c fixes one segfault:
``` if (headless || !isConnectedToXServer) return nan("MISS"); ```
Still, there is this other one on `#beCursor` :-/
I see. The same checks are missing or are incomplete in: - `display_ioSetCursorWithMask` - `display_ioSetCursorWithMaskBig` - `display_ioSetCursorARGB`
Would you open a PR today? Then I can merge it.
Thanks for the information @marceltaeumel! Please find my current fix in #626. I might be underestimating the complexity of this issue but I could not find any other place that needs to be changed.
Regarding cursors, primitive 101 seems to always have worked for me:
``` ./squeak --headless SqueakTrunk.image --evaluate 'Cursor normal show' ```
This also works for `--nodisplay`.
Am I missing any other scenario or was that all? :-)
---
I have another strange effect here. When I remove `scaleIconToDisplay` from `currentCursor:`, the platform starts reporting a scale factor of "1.25" instead of "1.0" ... is this releated? What's the platform-scale-factor in your setup?
I'm not aware of this implementation, you might now better. :-) But I don't think that the scaling factor matters if no display is shown. My scaling factor was `1.0`.
PS: Right now, I am unable to test any scaling factor different from `1.0` in my Linux environment because VcXsrv always crashes when calling `primitiveHostWindowSizeSet`. But this could also be a bug in that X server ...
Yeah, and now I finally got to try out the latest VM RC for Windows. It's so delightful that everything in Squeak is finally resized automatically when I move the host window to a different window. Thanks to everyone who has contributed to that! :D
This also works for --nodisplay. Am I missing any other scenario or was that all? :-)
Well, `--nodisplay` was not broken, right? I think that I will reject #626 follow up on that other approach as documented here. Sorry.
Fixed via https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/2d7105db755928fd908...
Closed #625.
vm-dev@lists.squeakfoundation.org