FLTK logo

Re: [fltk.coredev] Windows 11 crash (still investigating)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Windows 11 crash (still investigating) Gonzalo Garramuño 08:27 Apr 28  
 


On 4/28/2024 12:13 PM, 'Albrecht Schlosser' via fltk.coredev wrote:


(3) I agree with Manolo that we should investigate and understand why such old code triggers a bug (crash) in your code. Understanding what happens is important to know *what* exactly needs to be fixed. Maybe there's another bug elsewhere (in FLTK or inyour application) that causes this unexpected behavior. As Manolo wrote, it is possible that some code accesses a deleted widget or window which causes undefined behavior. Do you have any insights what may trigger the bug in your program?

The problem seems to be that the Window is hidden while being in an FL_LEAVE event of another window.

OK, let's recap and try to simplify the scenario, maybe to create a small example program that triggers the issue so we are sure and can test easier:

(1) You have a (main) window A (subclassed from an FLTK window class)
(2) You open another window B (the small preview window)
(3) Window B is a modal (or non-modal) window (stays on top of A)
(4) You drag some "object" (in the timeline) inside your window A
(5) Your window A gets an FL_LEAVE event when the mouse cursor leaves window A while dragging
(6) You hide window B while handling FL_LEAVE in window A's handle method

Is all of this true? If not, please correct my wrong assumptions.

I believe so.  Here's a self contained example showing the crash on MSVC and compiled with MSys64 as my terminal as usual:

https://mega.nz/file/OaJ0XKwa#qgxJK2q9E9fzqO3Ltf5wUA2HR4ts4cCHWLc9lvoRIU4


More questions: which of the windows (A, B, or both) are OpenGL windows?
One is, the other not.

The timeout was a work-around (which randomly failed too) to hide the window.

According to your video with the crash you removed the timeout and did it as described above. Is this correct?
Yes.

It would be great if you could provide us with some more information about the program's state when the crash is triggered. Thanks in advance.
I think indeed it was a Windows issue (bug).  Sadly when I wrote the timeout code, I did not document *why* I wrote it and had not delved into FLTK's code.

Now that you can reproduce the issue, can you also reproduce it on Linux (X11 or Wayland) or macOS?
Haven't tried yet.  Will try it after I take a shower :D

Note: I'm asking these questions because I wonder why this bug is triggered in your code and was not reported earlier. Meanwhile I'm pretty sure that the fix given above is correct and necessary but I'm still wondering what the root cause of the issue may be.


I am
-- 
Gonzalo Garramuño
ggarra13@gmail.com

--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/c6ff150d-21fb-4fa5-996c-a55623ce505d%40gmail.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.