Recent

Author Topic: Optimization parameters  (Read 1536 times)

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: Optimization parameters
« Reply #15 on: November 05, 2022, 01:32:09 pm »
But I am not sure to understand ok.
Of course it could be a bug in MSEgui, but like you said, it is very difficult to debug.
Mainly because I never get a crash like this before and it appends also with a simple unique window.
If you see what could create the crash, please advice.
It is indeed a bug in MSEgui. The function gui_getpointerpos passes the address of the ca1 variable, whose type is longword (always 32 bit), to a parameter of xquerypointer that's a pointer to a pointer. So when xquerypointer writes nill in it on a 64 bit target, it overwrites the return address if that variable is the last one in the stack frame (which it is in case of LLVM with optimisations). That's why the return address becomes nil.

Re-hello Jonas.

I understood this:

Code: Pascal  [Select][+][-]
  1. function gui_getpointerpos: pointty;
  2. var
  3.  ca1: PLongWord;  // Change this, it must be a pointer!
  4. begin
  5.  gdi_lock;
  6.  xquerypointer(appdisp,rootid,@ca1,@ca1,@result.x,@result.y,@ca1,@ca1,@ca1);
  7.  gdi_unlock;
  8. end;

---> test with -O1 ---> PERFECT, no crash  :o

Jonas, you are simply the Best.

OK, I will check all others ca1 and friends ( there is no more crash but the icon of form is not ok, surely related with pointer of pointer).

Write you later.

Fre;D
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: Optimization parameters
« Reply #16 on: November 05, 2022, 01:52:47 pm »
Re-...re-hello Jonas.

The last one to announce the total Victory.
I did check other ca1 and, indeed, some need to become PLongWord.

Re compiled with -O4 --> runs perfect, no crash, nice icon in form, moving, resizing, set to back, etc, all perfect.  ;D
[EDIT] Tested also with the complicated graphic + audio + anims app with -O4 and works perfectly. 
           Fixes:  https://github.com/mse-org/mseide-msegui/commit/bfb2efea058bb31015764a25c11fd870d701b8b7

All that thanks to the guardian angel.

Congrats and WoW Jonas and so happy for MSEgui that is now indisputably the best ever widgetset of the World.

Have a perfect WE.

Fre;D


« Last Edit: November 05, 2022, 11:54:40 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

 

TinyPortal © 2005-2018