Brian-ED / Brian-ED/raylibAPL

Crash when re-opening window in-session around 13 times

Open
#32 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
8
Forks
3
PR merge metrics
No merged PRs in 30d

Description

There's a error that happens when, in the same dyalogAPL session, you repeatedly run initWindow and closeWindow about 13 times. This is on Linux X11. Happens in both Ride and `dyalog`-TUI. Doesn't happen in dyalogscript.

The error is specifically this:
```
WARNING: GLFW: Error: 65542 Description: GLX: No GLXFBConfigs returned
WARNING: GLFW: Error: 65545 Description: GLX: Failed to find a suitable GLXFBConfig
dyalog: external/glfw/src/window.c:581: glfwGetWindowPos: Assertion `window != NULL' failed.
apl: syserror 999.
```
According to [this msg on raylib discord by JeffM](https://discord.com/channels/426912293134270465/427518168995725317/1206045177714704484) it's saying that GLFW asked the OS to create a window with OpenGL, and the windowing system said "no".
I believe it's due to dyalog messing with UI resources which makes raylib's cleanup not work, so resources get used up, even on dyalog-TUI.

Reproduce in a DyalogAPL session, assuming your path is currently `raylibAPL/`. To see the crash error, make sure to be using the `dyalog`-TUI:
```
]cd link
]create # .
raylib.Init''
i←0
:while 13>i⊣i+←1 ⋄ raylib.InitWindow 400 400 'h' ⋄ raylib.CloseWindow⍬ ⋄ :endWhile
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Run the provided Dyalog APL reproduction using raylib.InitWindow and raylib.CloseWindow in the dyalog-TUI environment, then inspect the implementations of those entry points and their window-resource cleanup. Compare behavior across Ride, dyalog-TUI, and dyalogscript; done means repeatedly reopening the window no longer produces the GLFW GLX errors or assertion failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.