Thanks for reporting problems here.
POST REPLY
Post Dec 26, 2017 12:30
#!/bin/hi *

I just bought GridCartography 4.0.7 Pro and downloaded the Linux version.
However, it crashes right on startup:

Code: Select all

$ ./gridc64pro 
Aborted (core dumped)
As this is very little to no infomation, I run an strace an attach the trace file.

Code: Select all

$ strace -o gridc64pro.trace ./gridc64pro 
Aborted (core dumped)
Link to trace file: https://cloud.dyle.org/index.php/s/AAjbcb6M88MKZPl, since the Forum software seems not to let me upload files.

Please fix. I've just spent >€50.
Site Admin
Post Dec 26, 2017 15:44
Hi dyle71,

Firstly, sorry you're having having problems with the Linux version.

I'm afraid that your core dump isn't clearly showing me anything wrong, but it may come in handy later. Can you tell me a bit more about what Linux distribution you're running? and whether you have a graphics card that supports OpenGL ? Do you have libpng12 and GTK3 installed?

Grid Cartographer only officially supports Linux Mint (and has been tested on 17.3 and 18.1) and although many people seem to be okay running it on other distributions you might be one of the unlucky ones with something my code doesn't like. I see mentions of Wayland and Mir in the core dump which suggests to me something might be amiss.

I want you to be happy with your purchase so I'm happy to offer you a refund if you are not able to get it working on your system.

Kind regards,

David
Post Dec 27, 2017 09:40
#!/bin/hi David,

Ah, thx for taking up! I appreciate this very much.

Mhm, strictly speaking, my uploaded file ain't a core dump but a syscall-log. All the syscalls the binary does against the operating system. Here some of my specs:

Code: Select all

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 17.10
Release:        17.10
Codename:       artful
So I do use Kubuntu 17.10, which based on KDE, but essentially the very same as Ubuntu 17.10.

Code: Select all

$ dpkg --list | grep libpng
ii  libpng-dev:amd64                                1.6.34-1                                    amd64        PNG library - development (version 1.6)
ii  libpng-dev:i386                                 1.6.34-1                                    i386         PNG library - development (version 1.6)
ii  libpng-tools                                    1.6.34-1                                    amd64        PNG library - tools (version 1.6)
ri  libpng12-0:amd64                                1.2.50-2+deb8u3                             amd64        PNG library - runtime
ii  libpng16-16:amd64                               1.6.34-1                                    amd64        PNG library - runtime (version 1.6)
ii  libpng16-16:i386                                1.6.34-1                                    i386         PNG library - runtime (version 1.6)

Code: Select all

$ dpkg --list | grep gtk3
ii  gtk3-engines-breeze                             5.10.5-0ubuntu1                             amd64        GTK theme built to match KDE's Breeze
ii  libcanberra-gtk3-0:amd64                        0.30-3ubuntu1                               amd64        GTK+ 3.0 helper for playing widget event sounds with libcanberra
ii  libcanberra-gtk3-module:amd64                   0.30-3ubuntu1                               amd64        translates GTK3 widgets signals to event sounds
ii  libdbusmenu-gtk3-4:amd64                        16.04.1+17.04.20170109.1-0ubuntu1           amd64        library for passing menus over DBus - GTK+ version
ii  libwxgtk3.0-0v5:amd64                           3.0.3.1+dfsg2-1                             amd64        wxWidgets Cross-platform C++ GUI toolkit (GTK+ runtime)
ii  python-wxgtk3.0                                 3.0.2.0+dfsg-5                              amd64        Python interface to the wxWidgets Cross-platform C++ GUI toolkit
ii  python3-aptdaemon.gtk3widgets                   1.1.1+bzr982-0ubuntu17                      all          Python 3 GTK+ 3 widgets to run an aptdaemon client

Code: Select all

$ dpkg --list | grep libgtk-3-0
ii  libgtk-3-0:amd64
Then, as you brought that up with the core dump, though I do think you stripped all debug symbols from the binary. This results in:

Code: Select all

$ ulimit -c unlimited

$ ./gridc64pro
Aborted (core dumped)

$ gdb ./gridc64pro ./core
GNU gdb (Ubuntu 8.0.1-0ubuntu1) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./gridc64pro...(no debugging symbols found)...done.
[New LWP 28078]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./gridc64pro'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) info threads
  Id   Target Id         Frame
* 1    Thread 0x7fb507400540 (LWP 28078) __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007fb504acff5d in __GI_abort () at abort.c:90
#2  0x00007fb4fb25cf7e in _Unwind_SetGR () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#3  0x00007fb4fb261af8 in __gcc_personality_v0 () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#4  0x0000000000680ad3 in ?? ()
#5  0x000000000068118a in ?? ()
#6  0x000000000067515c in __cxa_throw ()
#7  0x00007fb4fee0a100 in ?? () from /usr/lib/x86_64-linux-gnu/libmirclient.so.9
#8  0x00007fb4fee05a72 in ?? () from /usr/lib/x86_64-linux-gnu/libmirclient.so.9
#9  0x00007fb4fede9ebf in ?? () from /usr/lib/x86_64-linux-gnu/libmirclient.so.9
#10 0x00007fb4fedeb8b1 in mir::client::DefaultConnectionConfiguration::the_rpc_channel() () from /usr/lib/x86_64-linux-gnu/libmirclient.so.9
#11 0x00007fb4fedf6a94 in mir_connect () from /usr/lib/x86_64-linux-gnu/libmirclient.so.9
#12 0x00007fb4fedf7e1b in mir_connect_sync () from /usr/lib/x86_64-linux-gnu/libmirclient.so.9
#13 0x00007fb505e258b9 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#14 0x00007fb505db9f33 in gdk_display_manager_open_display () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#15 0x00007fb5062bc2ca in gtk_init_check () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#16 0x00007fb5062bc2f9 in gtk_init () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#17 0x00000000005bcf26 in ?? ()
#18 0x00007fb504ab81c1 in __libc_start_main (main=0x5bcee0, argc=1, argv=0x7ffc133e37e8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffc133e37d8) at ../csu/libc-start.c:308
#19 0x00000000004092a9 in ?? ()
So, yes there is some Mir working under the hood. Which is funny, since I do use KDE and neither Mir nor Gnome nor Unit. But I do have plenty of Gnome applications installed, which work nicely. So I doubt to locate the reason in this area. Yet, quite plainly the

Code: Select all

gtk_init()
causes the crash, since it does not return...

Then you mentioned Linux Mint 17.3 and 18.1. So I got myself a docker container of Mint:

Code: Select all

$ docker images
REPOSITORY                 TAG                 IMAGE ID            CREATED             SIZE
vcatechnology/linux-mint   18.0                1c038c7a65fe        4 days ago          559 MB
portainer/portainer        latest              f71b185552bf        2 weeks ago         33.2 MB
It's just a Mint 18.0 but then

Code: Select all

$ docker ps -a
CONTAINER ID        IMAGE                           COMMAND             CREATED             STATUS              PORTS                    NAMES
7bca146c23dd        vcatechnology/linux-mint:18.0   "/bin/bash"         7 minutes ago       Up 7 minutes                                 mint18.0
a1ff7f4d3f64        portainer/portainer             "/portainer"        3 days ago          Up 17 minutes       0.0.0.0:9000->9000/tcp   goofy_curran

$ docker attach mint18.0

# lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description:    Linux Mint 18 Sarah
Release:        18
Codename:       sarah

# (dpkg --list | grep gtk-3); (dpkg --list | grep libpng)
ii  libgtk-3-0:amd64                3.18.9-1ubuntu3.3                     amd64        GTK+ graphical user interface library
ii  libgtk-3-bin                    3.18.9-1ubuntu3.3                     amd64        programs for the GTK+ graphical user interface library
ii  libgtk-3-common                 3.18.9-1ubuntu3.3                     all          common files for the GTK+ graphical user interface library
ii  libpng12-0:amd64                1.2.54-1ubuntu1                       amd64        PNG library - runtime

# ls -1
base0.zip
Documents
gridc64pro
readme.txt

# ./gridc64pro 
Aborted (core dumped)
Same result.
Post Dec 27, 2017 09:45
Ah, missed OpenGL stuff:

Code: Select all

$ glxinfo | head
name of display: :0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
server glx extensions:
    GLX_ARB_context_flush_control, GLX_ARB_create_context, 
    GLX_ARB_create_context_profile, GLX_ARB_create_context_robustness, 
    GLX_ARB_fbconfig_float, GLX_ARB_multisample, GLX_EXT_buffer_age, 
    GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile, 

Code: Select all

$ glxinfo | grep -i opengl
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 1070/PCIe/SSE2
OpenGL core profile version string: 4.5.0 NVIDIA 384.90
OpenGL core profile shading language version string: 4.50 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.5.0 NVIDIA 384.90
OpenGL shading language version string: 4.50 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 384.90
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:
On a Nvidia 1070:

Code: Select all

$ lspci | grep -i nvidia
01:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GP104 High Definition Audio Controller (rev a1)
But I do doubt that been the cause.
Site Admin
Post Dec 27, 2017 10:53
It looks very much like it's crashing inside of mir.

If gtk_init is the cause of the crash, this is basically the first function called. This eliminates any opengl concerns since it's miles away from doing anything with GL - it's not even opening the application window.

This is the main function for Grid Cartographer on Linux.

Code: Select all

//
// main
//
// Linux Entry-point
//
int main( int argc, const char* argv[] )
{
	// Process command line
	HcCommandArgs args;
	args.Parse( argc, argv );

	// GTK initialisation
	gtk_init( &argc, (char ***)&argv );

	// Engine
	haEngineStart();

	if ( g_application.Start( args ) )
	{
		while ( haEngineUpdate() )
		{
			//
		}

		// Stop Application
		g_application.Stop();
	}

	haEngineStop();

	return 0;
}
So basically the code I've personally written is barely being run at all which makes this quite difficult.

You could try to pass in some command line arguments into gtk_init - I've no idea if it will help though.
https://www.systutorials.com/docs/linux ... k-options/
Site Admin
Post Dec 27, 2017 11:19
Since I think mir is throwing an exception, I think what I'd like to do next is put a try/catch around gtk_init to hopefully at least get a message about what the problem is.

I should point out though I'm on holiday this week, so I'm not sure exactly when I'll get time to do that.
Post Dec 27, 2017 12:17
#!/bin/hi David
David Walters wrote:
Dec 27, 2017 11:19
I should point out though I'm on holiday this week, so I'm not sure exactly when I'll get time to do that.
Well, no problem to this. Solved. =)

How? Well, for unknown reasons, gtk and gdk didn't fiddle out that I'm using a x11 backend. They tried wayland and mir:

Code: Select all

$ ./gridc64pro --gtk-debug=all --gdk-debug=all
Gtk-Message: Loading module list: gail:atk-bridge
Gdk-Message: Trying wayland backend
Gdk-Message: opening display 
Gdk-Message: Trying mir backend
Aborted (core dumped)
However, I'm using plain good old x11 as one can see via (hence the 'Type=' entry):

Code: Select all

$ loginctl | grep $(whoami) | awk '{ print $1 }' | xargs loginctl show-session
Id=3
User=1000
Name=dyle
Timestamp=Wed 2017-12-27 12:44:37 CET
TimestampMonotonic=17046959
VTNr=7
Seat=seat0
Display=:0
Remote=no
Service=sddm
Desktop=KDE
Scope=session-3.scope
Leader=1781
Audit=3
Type=x11
Class=user
Active=yes
State=active
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
LockedHint=no
Obviously, GDK got confused when choosing a proper backend and fails to select x11 too (why would someone *not* try this is as a last resort? I don't understand... Well, I'm no GTK guy. I'm into Qt and C++ for that matter. Never understood those Gnome/GTK people. Maybe, there's a reason to this I don't get.).

Luckily, there are some environment variables (https://developer.gnome.org/gtk3/unstab ... nning.html). With these, one can "hammer" in a certain behavior.

So,

Code: Select all

$ GDK_BACKEND="x11" ./gridc64pro
worked.

Enjoy your holidays. Solved. GTK/GDK "bug" (actually, not really a "bug", but an oddity).

Cheers,
Oliver (aka dyle)
Site Admin
Post Dec 27, 2017 17:08
Thanks for the update, that's great news!

I'm not sure why mir is crashing like that, and I assume it never gets a chance to try X11 as it considers mir's failure as a fatal error. I'm happy you found a work-around, although ideally these alternative compositing systems should just work too - at least running basic things like gtk_init. It'd make more sense if it was failing in my code at least.

At some point I will download Kubuntu 17.10, run it in a VM and see if I can repro the crash. Hopefully I can tweak the GC4 build to avoid needing this override.
edit: or at least try to show a more meaningful error message!
Post Jan 01, 2018 05:28
Thanks for that workaround, I have the same distro with Kubuntu 17.10, and a very similar crash that was fixed by the same environment variable.

Going to try this with Pool of Radiance later.
POST REPLY