OpenScreen causes Error in Linux OpenSuse Leap 15.3

Just starting out? Need help? Post your questions and find answers here.
swhite
Enthusiast
Enthusiast
Posts: 783
Joined: Thu May 21, 2009 6:56 pm

OpenScreen causes Error in Linux OpenSuse Leap 15.3

Post 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.

Last edited by swhite on Wed Dec 15, 2021 5:58 pm, edited 1 time in total.
Simon White
dCipher Computing
Saboteur
Enthusiast
Enthusiast
Posts: 272
Joined: Fri Apr 25, 2003 7:09 pm
Location: (Madrid) Spain
Contact:

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Post 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.
[:: PB Registered ::]

Win10 Intel core i5-3330 8GB RAM Nvidia GTX 1050Ti
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Post 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.
User avatar
jacdelad
Addict
Addict
Posts: 1991
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Post by jacdelad »

I'm not sure if I understand what the code is supposed to do...
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
swhite
Enthusiast
Enthusiast
Posts: 783
Joined: Thu May 21, 2009 6:56 pm

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Post 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
Simon White
dCipher Computing
swhite
Enthusiast
Enthusiast
Posts: 783
Joined: Thu May 21, 2009 6:56 pm

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Post 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
Last edited by swhite on Wed Dec 15, 2021 6:09 pm, edited 1 time in total.
Simon White
dCipher Computing
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Post by #NULL »

If you remove the main loop (empty else block) then do you still get the IMA?
swhite
Enthusiast
Enthusiast
Posts: 783
Joined: Thu May 21, 2009 6:56 pm

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Post by swhite »

If I remove the code for the Else block I still get the error.

Simon
Simon White
dCipher Computing
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Post by #NULL »

Does the example in the doc for KeyboardPushed() work?
swhite
Enthusiast
Enthusiast
Posts: 783
Joined: Thu May 21, 2009 6:56 pm

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Post 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
Simon White
dCipher Computing
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Post 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.
swhite
Enthusiast
Enthusiast
Posts: 783
Joined: Thu May 21, 2009 6:56 pm

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Post by swhite »

Yes I thought about missing libraries but CheckInstall only says that webkitgtk-3.0 is not found.

Simon
Simon White
dCipher Computing
User avatar
mk-soft
Always Here
Always Here
Posts: 6201
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Post by mk-soft »

I thinks is better to use the "If Screen3DRequester() ... " from examples.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
swhite
Enthusiast
Enthusiast
Posts: 783
Joined: Thu May 21, 2009 6:56 pm

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Post 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
Simon White
dCipher Computing
Burrito
New User
New User
Posts: 1
Joined: Wed Jan 05, 2022 12:48 am

Re: OpenScreen causes Error in Linux OpenSuse Leap 15.3

Post 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'.
Post Reply