Page 1 of 1

Display errors on Linux

Posted: Wed Oct 31, 2018 11:41 am
by DDS
Greetings,

Last year, i asked for help on a conversion of an old Metacard application to Livecode, mostly aimed at the communication between Livecode and C part of an application.
It worked better than i expected : got all functionalities working fine, but i have problems trying to display it on a remote X terminal.

Development machine is a CentOS6.3 with Livecode (Indy) 6.7.11 (latest i can install).
The computer on which the applications run (as stand-alone) is also a CentOS6.3.

The display tried are :
Xming 6.9 on a Windows 7 machine : works OK (mostly)
X terminal with a CentOS 5.4 : works OK (mostly)
localhost display : works OK (mostly)
X terminal with a 2.4.3 linux kernel : When executing my apps (or even an basic app with just a button but without any script), i get the following errors (several times) before the app crash (segmentation fault) :

Xlib: extension "XVideo" missing on display "tx4:0.0".
Xlib: extension "RANDR" missing on display "tx4:0.0".
(<unknown>:30572): Gdk-CRITICAL **: gdk_colormap_new: assertion `GDK_IS_VISUAL (visual)' failed
(<unknown>:30572): Gtk-CRITICAL **: gtk_widget_set_colormap: assertion `GDK_IS_COLORMAP (colormap)' failed
(<unknown>:30572): Gdk-WARNING **: gdk_gc_set_rgb_fg_color() and gdk_gc_set_rgb_bg_color() can only be used on GC's with a colormap. A GC will have a colormap if it is created for a drawable with a colormap, or if a colormap has been set explicitly with gdk_gc_set_colormap.
(<unknown>:30572): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

The terminal is in 8bit pseudo colour, i thought it could cause the problem, but Livecode seems to be able to deal with that on its own (unless i missed something and there's stuff to do ?)

Considering this is a conversion from Metacard (which displays fine on the same kind of terminal), nothing in my apps should be incompatible.
Are my apps simply built with a system too recent for the X terminal or is there something i'm missing ? (dealing with the pseudo colour for example)


Bonus questions :
1) One of my four apps tends to stay on top/visible (when switching desktop for example) even on mostly OK displays. I'm guessing it's something in the Livecode that causes this behaviour, but i don't know where to begin my search.
2) Is there a way to make the taskbar icon flash ? (an app get new data but is not visible, so the icon flashes to warn the user)

Thank you for your time

Re: Display errors on Linux

Posted: Wed Oct 31, 2018 2:09 pm
by bogs
Glad to hear you were able to get it going (mostly ok) :wink:
The display tried are :
Xming 6.9 on a Windows 7 machine : works OK (mostly)
X terminal with a CentOS 5.4 : works OK (mostly)
localhost display : works OK (mostly)
X terminal with a 2.4.3 linux kernel : When executing my apps (or even an basic app with just a button but without any script), i get the following errors (several times) before the app crash (segmentation fault) :

Xlib: extension "XVideo" missing on display "tx4:0.0".
Xlib: extension "RANDR" missing on display "tx4:0.0".
(<unknown>:30572): Gdk-CRITICAL **: gdk_colormap_new: assertion `GDK_IS_VISUAL (visual)' failed
(<unknown>:30572): Gtk-CRITICAL **: gtk_widget_set_colormap: assertion `GDK_IS_COLORMAP (colormap)' failed
(<unknown>:30572): Gdk-WARNING **: gdk_gc_set_rgb_fg_color() and gdk_gc_set_rgb_bg_color() can only be used on GC's with a colormap. A GC will have a colormap if it is created for a drawable with a colormap, or if a colormap has been set explicitly with gdk_gc_set_colormap.
(<unknown>:30572): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

The terminal is in 8bit pseudo colour, i thought it could cause the problem, but Livecode seems to be able to deal with that on its own (unless i missed something and there's stuff to do ?)
I ran up against a similar issue trying to run Lc apps on Crouton and some newer 'nix distros where I was trying to run older engines. This is most of the information I found from Lc, followed by what I did to get it running on Crouton, the pertinent parts to your problem in bold / underline, with some notes I made following dashes in italic.
Lc_Requirements wrote: The linux engine requires the following:
32-bit installation, or a 64-bit linux distribution that has a *32-bit compatibility layer
2.4.x or later kernel
X11R5 capable Xserver running locally on a 24-bit display
glibc 2.3.2 or later
gtk/gdk/glib (optional – required for native theme support) - Possible responsibility for text box issues...
pango/xft (optional – required for pdf printing, anti-aliased text and unicode font support) - same as above...
lcms (optional – required for color profile support in JPEGs and PNGs)
gksu (optional – required for elevate process support)

Note: The optional requirements (except for gksu and lcms) are also required by Firefox and Chrome, so if your linux distribution runs one of those, it will run the engine. - run the engine yes, the next line shows some of the limitations ...
Note: If the optional requirements are not present then the engine will still run but the specified features will be disabled.
Note: LiveCode and standalones it builds may work on remote Xservers and in other bit-depths, however this mode of operation is not currently supported.
The engine (both IDE and standalone) will require : gtk, gdk, glib, pango and xft on Linux - Even though it is listed optional above, it said required later on.

I'll also mention that while the above was interesting, what eventually got (almost) all the issues sorted on Crouton (and most newer 'nix installs) when using older Lc engines for me was installing libgtk2.0-0:i386,
Considering this is a conversion from Metacard (which displays fine on the same kind of terminal), nothing in my apps should be incompatible.
And your right, the original Mc didn't require it as far as I can tell, it only requires 32bit compatibility.

These are the steps i took on chromebook os cloudready. If you are using a regular distro of linux, skip to 3a.

Code: Select all

1. chromebook os Developer mode
2. used crouton to install ubuntu trusty, xfce
3. Lc test program - BubbleTimer
3a. terminal ./BubbleTimer = shared library error for libX11.so.6
4. verified multiarch was set up properly
5. added i386 and i686 architectures (32bit platforms)
6. sudo apt-get update / then upgrade
7. sudo apt-get install libgtk2.0-0:i386 
Some other things you can do from the terminal to see what else might be missing -
. type readelf -a ./ProgramName - if [Requesting program interpreter: /lib/ld-linux.so.2] is there then install libc6-i386.
. make sure you have the 32 bit architecture on the box/xserver your running, dpkg --print-architecture will tell you the 32 or 64 bit (or other) architecture your on, dpkg --print-foreign-architectures will tell you what else you have setup.
. Lc 6.7.x requires the 32bit libstd6c++. This can be added with -
"sudo apt install lib32stdc++6", you may need to add ":i386" to the end of it.

Thats about all I can think of at the moment.

BONUS ROUND !
Bonus questions :
1) One of my four apps tends to stay on top/visible (when switching desktop for example) even on mostly OK displays. I'm guessing it's something in the Livecode that causes this behaviour, but i don't know where to begin my search.

Maybe iconify or iconic? No guarantee there though.
2) Is there a way to make the taskbar icon flash ? (an app get new data but is not visible, so the icon flashes to warn the user)
Maybe armed? Again, not sure, I only see things like this for Windows or mobile :(

Re: Display errors on Linux

Posted: Fri Nov 02, 2018 2:21 pm
by DDS
You give me hope, bogs !

I did more digging on the X terminal : it's a minimal Mandrake 7.2 which indeed does not have gtk/gdk installed.
So my next step is to check if the app can be displayed on a full Mandrake 7.2 (via virtual machine) and if it works, see how/if the X terminal can be upgraded.

I'll report if i make any progress.

Re: Display errors on Linux

Posted: Fri Nov 02, 2018 2:36 pm
by bogs
DDS wrote:
Fri Nov 02, 2018 2:21 pm
You give me hope, bogs !
"hope" is my middle name! I'm constantly saying things like -
I "hope" I don't screw this up beyond repair...
and
I "hope" no one ever sees this line of code...
:P

Boy, Mandrake, I haven't seen or used that one in a long while. I may have to go take another look at it, thanks for the memories and good luck getting it running :D

Edit - DOH! I forgot that Mandrake changed to Mandriva, and the last release was 7 years ago
Image

Re: Display errors on Linux

Posted: Tue Nov 06, 2018 4:41 pm
by DDS
So, after a few days of trials and errors, i managed to get a Mandrake 7.2 working on a VM.
And it does not work, which is expected considering the gtk that comes with Mandrake 7.2 is 1.2.8 and not the 2.0.0 needed. I could try to upgrade it, but that would mean updating the whole system quite a bit and i probably won't be able to upgrade the X terminal.

I also tried using xDMCP (so the mandrake terminal displays the CentOS desktop and i can run the app from there) but that also fails with the same errors.

I have one (very ugly) possibility left but i'm pretty sure it won't work :
Could it be possible to embark the .so from gtk2 as externals (on the CentOS) and and have them used but the engine instead of it searching the /usr/lib folder (on the mandrake) ? Or are externals only used by the scripts ?


One more bonus question :
I know there's several options possible when launching Livecode apps (-ui seems to disable the user interface for example). I found that -d seems to change the display, but are those options written somewhere ? I checked the user's guide, but haven't found anything. (maybe there's a "minimal display" option or something)

Re: Display errors on Linux

Posted: Thu Nov 08, 2018 2:18 pm
by bogs
I didn't want you to think you were being ignored, I just don't (at the moment) have any answers to the questions :|

*If* I come up with any, I will post them though.
One more bonus question :
I know there's several options possible when launching Livecode apps (-ui seems to disable the user interface for example). I found that -d seems to change the display, but are those options written somewhere ? I checked the user's guide, but haven't found anything. (maybe there's a "minimal display" option or something)
While I am sure there *is* a source of information about the switches you can use to launch Lc built applications, I've never personally found it myself :?

I sure wish someone would post a link to it though, or possibly consider putting whatever they might personally know about it somewhere on the forum :mrgreen:

Re: Display errors on Linux

Posted: Fri Nov 09, 2018 3:39 pm
by DDS
No problem, i was busy on other things (namely : making the other displays work better)

But i do have news : we managed to reproduce the errors when displaying the apps on a Centos 6.3 (which otherwise works fine) when the depth of the display is limited to 8-bit, which is the current conf of the Mandrake display. (i *think* centos fails too when configured as 16-bits.)
Fortunately, the customer is open to using more recent displays which work (the CentOS 5.4) so all should end well.

About the bonus questions :
the 2) is solved, not with livecode, but with a call to the C code.
about 3) : only option i can remember is -ui and -d <display>. There's also a -u, but i don't know what it does (same as -ui ?)
About 1) : I don't think iconify is why the app stay on top. Plus it's weird : i got 4 apps that i can switch between
A, B and C play together nicely but :
- When i go from D to A/B : the screen displays A/B then D briefly before settling on A/B (i don't mind to much)
- When i go from D to C : the screen displays A/B then go back to D. I have to reclick on the C button on the taskbar to switch to C reliably. (i should not need to reclick)
This brings me to the following : is there a handler called when a stack completely lose focus ? I can't find a list of the event that can affect a control (or a list of properties for each type of control)

Fourth question :
When an application starts, what are the handler called and in which order ? From what i can see, it is :
- preOpenStack
- preOpenCard (first card)
- openStack
- openCard (first card)
But is there something between the pre* and the open* ?

Re: Display errors on Linux

Posted: Fri Nov 09, 2018 4:19 pm
by bogs
DDS wrote:
Fri Nov 09, 2018 3:39 pm
Fourth question :
When an application starts, what are the handler called and in which order ? From what i can see, it is :
- preOpenStack
- preOpenCard (first card)
- openStack
- openCard (first card)
But is there something between the pre* and the open* ?
UGH, I was just reading about this :evil: The real question is *where* :evil: :evil: :evil:

Klaus I think was the explainer, it was on an archived mailing list someone just recently linked to...Hmmm....

Edit - HA~! go looking for one thing, and find a different thingy you were looking for previously :P
Richard Gaskin Apr 29, 2013; 11:08am Re: Faceless LiveCode App for CLI on Mac OS X and Windows 7, Nabble mailing list wrote: Yes. Add -ui, and avoid flags the engine currently expects, and you'll
be fine.

The latter is the harder part of this, since the engine still reserves a
great many flags it no longer uses - these are listed here in this
request to remove the ones that are no longer relevant (perhaps this
will be one of the first pull requests submitted, since I can't imagine
it'll take long to fix):
<http://quality.runrev.com/show_bug.cgi?id=1644>

[-f[iles] (disable access to files and processes)
[-g[eometry] ={+-}<xoffset>{+-}<yoffset>]
[-i[nput] fd] read commands from fd (0 is stdin) or named pipe
[-m[map]] (don't memory map files)
[-n[opixmaps]] (draw direct to screen)
[-p[ointerfocus]] (use active focus)
[-s[haredoff]] (don't use shared memory server extension)
[+s[haredon]] (use shared memory server extension)
[-u] (don't create graphical user interface)
[-v[isualid] n] (use visual id n as listed from xdpyinfo)
[-w[indowid] n] (watch window id n for commands)
[stackname(s) | argument(s)]


Re: Display errors on Linux

Posted: Tue Nov 20, 2018 11:59 am
by DDS
I managed to solve the first question : when the D app was suspended, a handler made it change its card (despite being only one card in the app) which i guess brought it back to the top. Removing that corrected the behaviour.

Last question (i think) :
i contacted the Livecode Support about the display problem (on the 16-bit mandrake 5.2). They suggested i use more recent Livecode versions (so 7, 8 and 9) since it changed the underlying structure.
Problem is : LC 8 and 9 need library that appeared on CentOS 6.10 and 7.5.
LC 7 on the other does not display any error message, but nothing happens. I re-contacted the support, but they advised me to seek counsel on the forums.
The question is two-fold :
- Does anyone know why Version 7 does not want to execute on a CentOS 6.3 ?
- Does anyone know from which version it works ? (6.4 ? 6.5 ? more recent ?)

Re: Display errors on Linux

Posted: Tue Nov 20, 2018 3:08 pm
by bogs
I didn't have a copy handy, but found one and will take a look at it later.

*Edit - I guess it will be a bit later, apparently cent won't let me dl the Lc installer :oops:
StepOsTesters [Running] - Oracle VM VirtualBox_003.png
What the...

Re: Display errors on Linux

Posted: Thu Nov 22, 2018 12:36 pm
by bogs
Well, I'm sorry to say I've had less than no luck with getting Cent installed and functioning correctly :?

Over the last 2 days, where it has installed, it won't download the installer for Lc (above error). When I update it, thinking that might resolve the issue, it gets and installs the first series of updates correctly, but doesn't make it through the second round. I've exhausted my bag of tricks and work arounds just trying to get it installed and as current as 6.3 was, so if your dealing with it on a permanent basis you must be way ahead of me.

I will try one more way to side load Lc on the un-updated Cent I get to, but I'm not holding out a lot of hope at this point.

*Edit - sure, soon as I posted the above, I got the update to work and reboot, allowing me to download the Lc installer. I'm a little worried though that Cent briefly reported as 6.10 instead of 6.3, however when I 'uname -a' it reports as 6.3, so I'll continue and see if Lc will actually run or not, I'm just not sure if I've gone past your revision of Cent :roll:

Re: Display errors on Linux

Posted: Thu Nov 22, 2018 2:08 pm
by bogs
Ok, well, even though 7.1.x fails to start silently, 7.0.x gave up something I think is pretty important -
StepOsTesters [Running] - Oracle VM VirtualBox_001.png
Installer start error...
Looking into it, I found you'd need at least Cent 6.7 to get that installed, and it can't be brought backwards. My theory at this point is that if 7.0.x needs at least that version, 7.1.x up will need more than that.

Some other stumbling blocks that were able to be gotten -

Code: Select all

yum groupinstall "Development Tools"
yum install gtk+-devel gtk2-devel

This solves libgtk2.0-dev problem.

Code: Select all

libc6-dev-i386

Post by toracat » 2009/12/08 15:29:08
CentOS does not have a package with that name. Try installing glibc-devel
That is about as far as I am this morning :|

*Edit - anything lower than 7 appears to throw a bad elf error -
StepOsTesters [Running] - Oracle VM VirtualBox_002.png
Naughty Elves!
I suspect that I may not have multi-arch setup correctly on this Cent machine, I may go back at some point and setup a 32bit only machine for the rest of the testing, but as for now I'm going to leave off and enjoy the rest of my Thanksgiving day :D

Hope you and yours (and EVERYONE ELSE on the boards) has a great holiday (if you celebrate it) :mrgreen:

Re: Display errors on Linux

Posted: Mon Nov 26, 2018 2:30 pm
by DDS
Thanks bogs, that confirms my suspicions : latest version of livecode i can use on a CentOS6.3 is 6.7.11.

That should conclude the thread : On a (somewhat) recent display, my app works fine and there's not much to be done on the truly ancient one.

Bogs, Thank you for your help. :)

Re: Display errors on Linux

Posted: Mon Nov 26, 2018 3:34 pm
by bogs
Glad it was of some use, I rarely delve into the rpm/yum type distros myself or I might have been able to come up with some more useful alternatives for you.