Page 1 of 2

OpenScreen causes Error in Linux OpenSuse Leap 15.3

Posted: Wed Dec 15, 2021 5:43 pm
by swhite
Hi

I was trying to test keyboard input in Linux PB 5.73 on OpenSuse 15.3 and the OpenScreen() function causes the program to stop working with an invalid memory access error. Can anyone advise me on the potential fix for this problem?

Thanks
Simon

Code: Select all

Define lnKey.i
If Not InitSprite()
ElseIf Not InitKeyboard()
ElseIf Not OpenScreen(100,100,16,"Keyboard")
Else
    Repeat
      ExamineKeyboard()
      lnKey = KeyboardPushed(#PB_Key_All)   ; press Esc to quit
      If lnKey = #PB_Key_Escape
         End
      Else
         Debug lnKey
      EndIf
    ForEver
  EndIf

Code: Select all

[11:32:35] Executable type: Linux - x64  (64bit, Unicode)
[11:32:35] Executable started.
[11:32:35] [WARNING] Line: 1
[11:32:35] [WARNING] GLib-GIO (DEBUG): _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’
[11:32:35] Execution stopped. (Breakpoint)
[11:32:38] [ERROR] Line: 4
[11:32:38] [ERROR] Invalid memory access.
[11:37:08] The Program was killed.


Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Posted: Wed Dec 15, 2021 5:54 pm
by Saboteur
I think you must use a valid monitor resolution, so 100x100 must not work. For example, you can use 1024x768, 800x600... or use OpenWindowedScreen() instead for lower resolutions.

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Posted: Wed Dec 15, 2021 5:58 pm
by #NULL
Saboteur wrote: Wed Dec 15, 2021 5:54 pm I think you must use a valid monitor resolution, so 100x100 must not work.
But the program should silently do nothing then by going into the empty ElseIf branch, and that's what it does on my Ubuntu. I don't get an IMA.

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Posted: Wed Dec 15, 2021 6:01 pm
by jacdelad
I'm not sure if I understand what the code is supposed to do...

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Posted: Wed Dec 15, 2021 6:02 pm
by swhite
Hi

I have tried a number of different standard resolutions but the error is the same. I also tried depths of 16, 24, and 32.

Simon

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Posted: Wed Dec 15, 2021 6:04 pm
by swhite
The only thing the code is suppose to do is to allow me to test the KeyboardPushed() function because the keyboard has a non-standard key called "Cancel" whose value I want to determine.

I was assuming the value returned from the KeyboadPushed() function would be the key value but it appears I was confusing PB with other software that I use that does return the key value pressed. So I will have to change my code to find the correct key value for the non-standard key.

However, I still need to solve the OpenScreen issue.

Simon

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Posted: Wed Dec 15, 2021 6:08 pm
by #NULL
If you remove the main loop (empty else block) then do you still get the IMA?

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Posted: Wed Dec 15, 2021 6:10 pm
by swhite
If I remove the code for the Else block I still get the error.

Simon

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Posted: Wed Dec 15, 2021 6:12 pm
by #NULL
Does the example in the doc for KeyboardPushed() work?

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Posted: Wed Dec 15, 2021 6:17 pm
by swhite
The KeyBoardPushed() example does not work. I get am IMA on the very first line. Neither does the OpenWindowedScreen example in the doc work. It gets an IMA on the OpenWindowedScreen().

Simon

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Posted: Wed Dec 15, 2021 6:20 pm
by #NULL
I don't get the warning by the way. Maybe some library versions on your system don't match? I don't know really. Maybe try the checkinstall script that comes with purebasic.

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Posted: Wed Dec 15, 2021 6:40 pm
by swhite
Yes I thought about missing libraries but CheckInstall only says that webkitgtk-3.0 is not found.

Simon

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Posted: Wed Dec 15, 2021 7:30 pm
by mk-soft
I thinks is better to use the "If Screen3DRequester() ... " from examples.

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Posted: Wed Dec 15, 2021 10:46 pm
by swhite
It would be nice to know how to fix this but in the mean time I used Openconsole and Inkey()/Rawkey() to determine the value of the non-standard key.

Simon

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Posted: Wed Jan 05, 2022 12:54 am
by Burrito
swhite wrote: Wed Dec 15, 2021 6:40 pm Yes I thought about missing libraries but CheckInstall only says that webkitgtk-3.0 is not found.

Simon
Using Yast, add this repository:

https://download.opensuse.org/repositor ... Leap_15.3/

and then install the package 'libwebkitgtk3-devel'.