Help: running 32bit programs on 64bit Debian Linux server

Hi all; I’m an absolute beginner at all of this, so please forgive me if I’ve missed something daft. So…

  1. A simple ‘Hello World’ program was uploaded to our server, running 64bit Debian Linux. Strangely, our web hosting company specifically requests that uploads be ASCII, so that’s what we did (since then, we’ve also uploaded a version as binary, trying to track down what’s going wrong).

  2. I believe I’ve installed the 32bit compatibility libraries on the server, though the ‘sudo apt-get install ia32-libs-multiarch’ command brings up an ‘Unable to locate package…’.

  3. When trying to run the ‘Hello World’ program on the server, we get the error message ‘Unable to launch application ‘Hello World’ on port 22896’. I understand this is normally due to permissions being wrongly set, or files wrongly uploaded. I don’t think this is the case here.

  4. Uploading the program files as binary, incidentally, brings up the ‘Not found’ error.

So. On the understanding that my knowledge isn’t encyclopaedic, does anyone have any advice on how to troubleshoot this?

Thanks for your time

For the port error, check your firewall and make sure that the port is not blocked.

For the not found error, make sure the permissions are 755 (sudo chmod 755 myApp).

#1: Your host may say they only want ASCII uploads because they do not expect (or want) binary files uploaded. Is this shared hosting or a VPS?

#2: Make sure the “executable” bit is set for the app and the stuff in the Lib folder. In order to test the 32-bit libraries are installed properly, I’d recommend uploading a simple console app and seeing if that runs. Or a standalone web app. Once you know those run, you can move on to CGI.

3: Could be a whole host (pun intended) of issues that you may not be able to fix if you are using shared hosting. See here: http://documentation.xojo.com/index.php/Deploying_Web_Apps_on_Linux

Thanks for the replies, guys. Ok, let’s see…

  • it’s VPS hosting; I can’t think why they wouldn’t want binary files uploaded, it’s costing enough. I’d assumed it was something unusual about their filesystem or something.

  • permissions for everything are 755 (which should cover the ‘executable bit’, correct?

  • I can’t find any way to check blocked ports on the server; I’m working on it.

All suggestions welcome.

n

Ok:

  • I’ve confirmed with the hosting company that that firewall port is indeed open, so that’s not the problem.
  • I’ve confirmed that all the program files & folders are permission 755.
  • I’ve enabled i386 support on the server ( with sudo dpkg --add-architecture i386 )
  • I think I’ve installed all the possible ia32-libs files that I can find.

Running “ldd helloworld” shows a list of all the dependencies, and all of them are found.

I think I’ve run up against the limits of my knowledge.

And what are the results of running a console or standalone web app? This will help determine if you have a general library problem or an Apache configuration problem.

Hi Paul; well, I’ve successfully uploaded a standalone app, but the browsers don’t seem to recognise it as a program: when navigating to the URL, Chrome immediately starts downloading it, and Firefox believes it’s a ‘document’ and asks what to do with it. Currently the standalone app has no extension on the filename - I don’t know if that’s likely to have any effect. Files and folders are all in public_html folder, and have permissions 755.

Ah ha. I may be a giant idiot - running it from the command line gives a ‘Segmentation fault’.

[edit at 12:18]

Debugging with gdb gives the following useful bit of advice…

"Using host libthread_db library “/lib/x86_64-linux-gnu/libthread_db.so.1”.
Error while mapping shared library sections:
`/home/handeye/public_html/HelloWorld_standalone/Hello World Libs/RBConsoleFramework.so’: not in executable format: File truncated

Program received signal SIGSEGV, Segmentation fault.
0xf7feaa72 in ?? () from /lib/ld-linux.so.2"

Could this be related to uploading these binary files using ASCII mode?

I’ve asked for clarification from the hosting company, and it turns out I was misinformed: ASCII for…well, ASCII files, and binary for executables, graphics etc. So, with a new version uploaded using the necessary FTP settings, I’m still getting the “Unable to launch application X on port Y” error.

Looking in the Apache logs brings up…

[Wed Feb 19 10:57:31 2014] [error] [client 81.155.162.18] /home/handeye/public_html/HelloWorld/Hello World: /lib/i386-linux-gnu/i686/cmov/libc.so.6: version GLIBC_2.4' not found (required by /home/handeye/public_html/HelloWorld/Hello World) [Wed Feb 19 10:57:31 2014] [error] [client 81.155.162.18] /home/handeye/public_html/HelloWorld/Hello World: /lib/i386-linux-gnu/i686/cmov/libc.so.6: version GLIBC_2.0’ not found (required by /home/handeye/public_html/HelloWorld/Hello World)
[Wed Feb 19 10:57:31 2014] [error] [client 81.155.162.18] /home/handeye/public_html/HelloWorld/Hello World: /lib/i386-linux-gnu/i686/cmov/libc.so.6: version `GLIBC_2.1’ not found (required by /home/handeye/public_html/HelloWorld/Hello World)

I’ve updated the libc.so.6 files lots of times, and it seems strange that such a tiny program would need three different versions of the same library. Is there some sort of configuration problem on the server, or is there some error in compiling?

Those messages make me think the 32-bit version of glibc is not available.

I was under the impression that the ‘multiarch’ functionality replaced the need for the ialibs32 (?) package; is that not true? And can I ask what you mean by ‘not available’? Can I install it from somewhere else?

[edit]

Just tried ‘sudo apt-get libc6-i386’

“libc6-i386 is already the latest version”

So looks like it’s already there…

I hope Paul’s still checking in on this thread…

Since last time, the hosting company has installed Ubuntu in place of Debian, thinking that it might have the more recent versions of glibc, and thus be able to run the program. But no. Their technical support have been trying to run the program too, and (in their words) are stumped. They’ve suggested I post their error log snippets here, as Xojo may have run into this problem before. So…

[quote]The webserver, Apache, had not been configured to execute .cgi scripts. I
did this by adding the following to the vhost configuration file (at
/etc/apache2/sites-available/phil) for the site:

    AddHandler cgi-script .cgi

Unfortunately, now this has brought back the previous error we saw:

Unable to launch application ‘Hello_World’ on port 22896

Just to confirm, the current firewall configuration does not have any rules
pertaining to traffic on that port:

root@handeyevps:~# iptables -L | grep 22896
root@handeyevps:~#

Checking the error log after executing the cgi script also returns the
messages we saw before:

root@handeyevps:~# tail -f /home/phil/logs/error_log
[Wed Mar 05 19:25:29 2014] [error] [client 80.87.128.222]
/home/phil/public_html/HelloWorld/Hello_World:
/lib/i386-linux-gnu/libdl.so.2: version GLIBC_2.1' not found (required by /home/phil/public_html/HelloWorld/Hello_World) [Wed Mar 05 19:25:29 2014] [error] [client 80.87.128.222] /home/phil/public_html/HelloWorld/Hello_World: /lib/i386-linux-gnu/libdl.so.2: version GLIBC_2.0’ not found (required by
/home/phil/public_html/HelloWorld/Hello_World)
[Wed Mar 05 19:25:29 2014] [error] [client 80.87.128.222]
/home/phil/public_html/HelloWorld/Hello_World:
/lib/i386-linux-gnu/libc.so.6: version GLIBC_2.4' not found (required by /home/phil/public_html/HelloWorld/Hello_World) [Wed Mar 05 19:25:29 2014] [error] [client 80.87.128.222] /home/phil/public_html/HelloWorld/Hello_World: /lib/i386-linux-gnu/libc.so.6: version GLIBC_2.0’ not found (required by
/home/phil/public_html/HelloWorld/Hello_World)
[Wed Mar 05 19:25:29 2014] [error] [client 80.87.128.222]
/home/phil/public_html/HelloWorld/Hello_World:
/lib/i386-linux-gnu/libc.so.6: version `GLIBC_2.1’ not found (required by
/home/phil/public_html/HelloWorld/Hello_World)

What’s bizarre is not only that glib6 is installed, but that it should meet
the requirements for both version 2.0 and 2.1:

root@handeyevps:~# dpkg -l | grep libc6
ii libc6 2.15-0ubuntu10.5
Embedded GNU C Library: Shared libraries
ii libc6:i386 2.15-0ubuntu10.5
Embedded GNU C Library: Shared libraries

Unfortunately this is where I’m stumped on the matter. [/quote]

Exactly what version of Ubuntu are you currently using? I’ll see if I can set up a VM with it.

Distributor ID: Ubuntu
Description: Ubuntu 12.04.4 LTS
Release: 12.04
Codename: precise

64-bit or 32-bit?

64bit

Well, I downloaded 12.04.4 x64 and installed it in VMware Fusion. I let it do it’s updates and reboot a couple times. I did not install VMware Tools.

Then I downloaded the sample Xojo standalone app from here: Page Not Found — Xojo documentation

I unzipped it and tried to run it:

./XojoTest

But it didn’t work.

I then installed the multiarch stuff to get 32-bit support:

sudo apt-get install ia32-libs-multiarch

Ran the sample app again and it started without error. I was able to navigate to the web app in the browser:

http://localhost:8080

I’m afraid I have no idea how to troubleshoot your installation further. I’ve moved this conversation to the Linux category in the hopes that other Linux gurus might have some advice.

In case this is useful, running:

ldd Xojotest

has these results:

This is the issue - it appears that the system is running a too-new version of LIBC that doesn’t have the compatibility identifiers.

For example:

strings /lib/i386-linux-gnu/libc-2.15.so | grep GLIBC_

returns:

GLIBC_2.0 GLIBC_2.1 GLIBC_2.1.1 GLIBC_2.1.2 GLIBC_2.1.3 GLIBC_2.2 GLIBC_2.2.1 GLIBC_2.2.2 GLIBC_2.2.3 GLIBC_2.2.4 GLIBC_2.2.6 GLIBC_2.3 GLIBC_2.3.2 GLIBC_2.3.3 GLIBC_2.3.4 GLIBC_2.4 GLIBC_2.5 GLIBC_2.6 GLIBC_2.7 GLIBC_2.8 GLIBC_2.9 GLIBC_2.10 GLIBC_2.11 GLIBC_2.12 GLIBC_2.13 GLIBC_2.14 GLIBC_2.15 GLIBC_PRIVATE
on my Ubuntu 12.04 64bit system.

Thanks Paul, thanks Tim.

Tim - I did suspect as much (though my novice Linux skills meant I didn’t know how to perform that search of yours). I get similar results on our installation :

[quote]GLIBC_2.0
GLIBC_2.1
GLIBC_2.1.1
GLIBC_2.1.2
GLIBC_2.1.3
GLIBC_2.2
GLIBC_2.2.1
GLIBC_2.2.2
GLIBC_2.2.3
GLIBC_2.2.4
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_2.13
GLIBC_2.14
GLIBC_2.15
GLIBC_PRIVATE[/quote]

So, if we don’t have the compatibility identifiers, I guess this raises a couple of questions:

  1. Why does Xojo compile programs for non-standard / out-of-date libraries? Seems a little daft, to a relative layman…
  2. Is it possible to install the necessary compatibility identifiers?
  3. Is it possible to compile programs in Xojo for the actual, current versions of GLIBC?