Deploying to linux, CGI, 64 bit on Strato Ubuntu 16 LTS server gives Segmentation Fault

Hi!

I can’t wrap my head around this one.

My journey started when deploying and getting a 500 Server error. Checking permissions, writable config, suexec logs, libunwind8 installation but it still gave me a server error. Looking at the logs I saw the famous “line 118” error, so I tried starting the binary from the command line: Segmentation Fault.

Running it standalone on the same server worked fine.

So, I created a simple new web application (empty page with a label) and tried to deploy that: same error.

Did a backtrace on it:

#0 0x00007f358298c854 in ?? () from /usr/lib/x86_64-linux-gnu/libunwind-x86_64.so.8 #1 0x00007f358298d7b4 in _Ux86_64_step () from /usr/lib/x86_64-linux-gnu/libunwind-x86_64.so.8 #2 0x00007f35841e5dff in ?? () from /var/www/vhosts/docs.vivia-connect.nl/httpdocs/cgi-bin/Test Libs/XojoConsoleFramework64.so #3 0x00007f35842a61dd in RuntimeRaiseException () from /var/www/vhosts/docs.vivia-connect.nl/httpdocs/cgi-bin/Test Libs/XojoConsoleFramework64.so #4 0x00007f35842a639d in RuntimeRaiseFunctionNotFoundException () from /var/www/vhosts/docs.vivia-connect.nl/httpdocs/cgi-bin/Test Libs/XojoConsoleFramework64.so #5 0x000000000032fdc7 in _WebSupport.set_umask%%i8 () #6 0x0000000000319120 in _CGIGateway.Start%b%o<_HTTPServer.HTTPRequestHandler>i8 () #7 0x0000000000340c25 in WebApplication.Event_Run%i8%o<WebApplication>A1s () #8 0x00007f35841e423a in ?? () from /var/www/vhosts/docs.vivia-connect.nl/httpdocs/cgi-bin/Test Libs/XojoConsoleFramework64.so #9 0x00000000002ac0d8 in ConsoleApplication._CallFunctionWithExceptionHandling%%o<ConsoleApplication>p () #10 0x00007f35842acbe6 in ?? () from /var/www/vhosts/docs.vivia-connect.nl/httpdocs/cgi-bin/Test Libs/XojoConsoleFramework64.so #11 0x00007f35842abf39 in RuntimeRun () from /var/www/vhosts/docs.vivia-connect.nl/httpdocs/cgi-bin/Test Libs/XojoConsoleFramework64.so #12 0x000000000040cf03 in REALbasic._RuntimeRun () #13 0x00000000004e18da in _Main () #14 0x00000000004e1283 in main ()

Now I am stuck. It seems that Libunwind is the problem right? Any ideas on how to fix this? Or am I overlooking the obvious?

Thanks!

libunwind is required, as well as some others http://documentation.xojo.com/resources/system_requirements_for_current_version.html.
always required:

you can do

in the terminal to see if there are any other libraries missing.

You should be able to install the missing libaries.

Hi Derk, long time no see!

I think all is in place?

linux-vdso.so.1 => (0x00007ffe51921000) XojoConsoleFramework64.so => /var/www/vhosts/docs.vivia-connect.nl/httpdocs/cgi-bin/./Test Libs/XojoConsoleFramework64.so (0x00007fa730d1f000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa73094c000) libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007fa7306f9000) libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fa7303e7000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa7301ca000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa72ffc6000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fa72fdbd000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa72fab4000) libunwind.so.8 => /usr/lib/x86_64-linux-gnu/libunwind.so.8 (0x00007fa72f899000) libunwind-x86_64.so.8 => /usr/lib/x86_64-linux-gnu/libunwind-x86_64.so.8 (0x00007fa72f679000) libc++.so.1 => /var/www/vhosts/docs.vivia-connect.nl/httpdocs/cgi-bin/./Test Libs/libc++.so.1 (0x00007fa72f2c8000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa72f0b2000) /lib64/ld-linux-x86-64.so.2 (0x0000561f1d323000) libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007fa72eea9000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fa72ec39000) liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fa72ea16000)

Oh and I did try the binary/ascii upload thing, zipping, SSH, FTP. Makes no difference.

Paul

It’s more likely this…

 RuntimeRaiseFunctionNotFoundException

The line below that which calls set_umask seems to be failing. I’ll have to see what that links to.

The only thing I can think of is that you don’t have your libraries up to date. Please check the versions of the following items via apt:

glib 2.0
glibc-2.14 (64-bit)
libstdc++.so.6.0.13
libunwind8

@Paul Zwiers it’s been a while yeah…

Are you trying to daemonize the application yourself?

You should set the “application” to executable and don’t start it from the commandline. That won’t work it needs to be called from the cgi script.

[quote=473430:@Greg O’Lone]The only thing I can think of is that you don’t have your libraries up to date. Please check the versions of the following items via apt:

glib 2.0
glibc-2.14 (64-bit)
libstdc++.so.6.0.13
libunwind8[/quote]

If I do a apt list | grep glibc I get

glibc-doc/xenial-updates,xenial-updates 2.23-0ubuntu11 all glibc-doc-reference/xenial,xenial 2.19-1 all glibc-source/xenial-updates,xenial-updates 2.23-0ubuntu11 all

libstdc++ seems to be installed in several versions, from 4 to 6. Libunwind8 is installed. ldd output is in a previous message.

The standalone compiled application runs fine on this server, I assume that the libraries are ok then?

Or maybe apt list is not the proper way of checking?

Also I noticed that in the /tmp directory a file with the name of the app-identifier is written with correct permissions so that seems to be ok.

[quote=473434:@Derk Jochems]@Paul Zwiers it’s been a while yeah…

Are you trying to daemonize the application yourself?

You should set the “application” to executable and don’t start it from the commandline. That won’t work it needs to be called from the cgi script.[/quote]

It is a standard new Web application, build as CGI 64 bit with only a label on an empty page, No other code.

I understand I need to run the cgi from apache, but if I run the executable binary directly, I assume I get some errors, but no segfault right?

If that’s the case then the app is getting at least part way into a running state. Are you perhaps running low on RAM?

FWIW, internally the CGI and Standalone modes are nearly identical, but that call to umask is definitely one of the differences. Umask also has a command-line component. Perhaps you should check and see if that’s installed?

Are you using a VPS or a dedicated Strato Server?

I’ve ran into issues with the VPS one, also resulting in Segmentation Faults. Even on Commandline apps without any code. The VPS servers are running a modified kernel I believe, causing incompatibility with libunwind.

We gave up on VPS…

It may be better to move to hostnet for example, a VPS with debian and plesk runs flawless and is easy to manage. Then there is Xojo Cloud, or any other (total control VPS) would do. It could be strato has a different kernel, if so it’s probably not the best idea to stay there.

[quote=473458:@Greg O’Lone]If that’s the case then the app is getting at least part way into a running state. Are you perhaps running low on RAM?

FWIW, internally the CGI and Standalone modes are nearly identical, but that call to umask is definitely one of the differences. Umask also has a command-line component. Perhaps you should check and see if that’s installed?[/quote]

RAM is available, umask is available. Your umask remarks made me check permissions, especially on the /tmp directory because I though it could be that the tmp-file is created, but after that the user might not be able to write to it or something. But all is fine in that area, as root user I have the same problems.

[quote=473508:@Robert Everts]Are you using a VPS or a dedicated Strato Server?

We gave up on VPS…[/quote]

It is a VPS, but your remarks make sense. Before the libunwind8 requirements, I rolled out web-apps without any problems on the same server.

Would you happen to know if I switched to a Strato VPS on CentOS instead of Ubuntu, it would work?

I guess this can very well be the outcome. This was a staging-issue, for production I need a NEN7510 certified hosting partner with a dutch datacenter, perhaps I will be staging there to. I have been using Strato for a long time and never had any complaints (also running (older) Xojo web apps), but unfortunately I need to switch.

Xojo cloud is also available in the netherlands. Just to note.

Thanks, I was not aware of that. I have contacted customer service to get the details.

[quote=473835:@Paul Zwiers]It is a VPS, but your remarks make sense. Before the libunwind8 requirements, I rolled out web-apps without any problems on the same server.

Would you happen to know if I switched to a Strato VPS on CentOS instead of Ubuntu, it would work?[/quote]

Nope, I have no clue. We switched to an ikoula dedicated server; hosted in France I believe…