segmentation fault

Linux specific questions.
Post Reply
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

segmentation fault

Post by Dinosaur »

Hi All

I have recently installed Linux Mint 18.3 on a separate mSata drive.
Installed FB 1.05.0 64 bit
And as usual you have to spend hours discovering which libraries are missing and install them.

Did all that and took an application from Mint 17.3 and compiled it on 18.3.
No errors.
When I go to run the application I get:

Segmentation Fault (core dumped)
program exited with code: 139

This has happened to me once before when I made some user name mistakes etc (although I don't recall the code number)
So, installed Nemiver and loaded the application with the intent of stepping through until the error code.
However, it immediately comes up with Locate File error: ...long path...dl-runtime.c
Now Nemiver does pop this kind of error when you normally try to re-run without re-loading.

Taking a pre-compiled copy from 17.3 runs perfectly on 18.3, but if compiled on 18.3 , it fails.

Any suggestions appreciated.
So, I suspect there is a library compatibility problem, but I can't debug.
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: segmentation fault

Post by Munair »

It would be helpful if you could isolate what libraries are used. Is it a game, a console app, or a GUI using a specific library? Also, maybe the STOP keyword may help to isolate where in the code things go wrong. It's what I use step by step when the code cannot be debugged.
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: segmentation fault

Post by Dinosaur »

Hi All

Munair, it is a GUI.(cgui to be precise)
But I have copied all the relevant libraries from 17.3 to 18.3.
Also did a complete copy of ALL libraries in /usr/lib/x86_64_linux_gnu folder, which stuffed up my Cinnamon but still did not resolve the issue.
Browsing did reveal some problems with pthread library, but once again copying this from 17.3 to no avail.

Making the very first statement STOP still creates the same error.

Regards
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: segmentation fault

Post by lizard »

This error means, it is tried to access an array field that doesn't exist. That can easily happen in Gtk or other GUIs, when widgets or other things are arranged in arrays.

In this case when reading your post i would suspect it could be a conflict of 32 and 64 bit software. I myself use in this box here Linux Mint 18.2 Cinnamon 32bit and have seldom problems at the moment. I am planning to setup a 64bit environment on another box. I use to have more boxes in reach in case something happens and i want to quickly connect to the net and simple take another box, as they became cheap nowadays.

Any 3 Ghz processor does the job, a HD and when you have a graphics card you are a lucky one and can do almost everything you want. If 32 or 64 is not most importanted for me so i use to avoid many problems by choosing 32 bit most of the time. You can install all the packages from the ubuntu repository and it is fast enough.

In your problem it could be something with 64 bit because adressing of memory is another. With 64 bit you can adress much more, there could be some conflict with older 32 bit soffware. But thats just guessing.
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: segmentation fault

Post by Dinosaur »

Hi All

Lizard my setup is a bit different.
I have an industrial Fitlet computer.

http://www.fit-pc.com/wiki/index.php/Fi ... let#fitlet

It is 64 bit 4 core and I have my 32Gb mSata drives in usb adapters for my test bench.
On site, in my production machines the mSata drives are installed inside the Fitlet.

So I either plug in the one with 17.3 or the one with 18.3.
They are both using the same 64 bit processor. (it's a bit like swapping HDD)

I have copied every folder associated from one to the other.
ie:
Allegro 4.4.2
FB
Geany
My project folder

Still no luck.

Regards
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: segmentation fault

Post by Munair »

lizard wrote:This error means, it is tried to access an array field that doesn't exist.
Not necessarily. It happens with invalid memory access. This could be anything where addressing exceeds allocated memory for a particular data type.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: segmentation fault

Post by lizard »

Munair wrote:Not necessarily. It happens with invalid memory access. This could be anything where addressing exceeds allocated memory for a particular data type.
Thats right, could be other things, too.
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: segmentation fault

Post by Dinosaur »

Hi All

Same error when I run the "Hello.bas" example ???

Regards

Edit: Interesting that when you put -nodeflibs on the command line, simply nothing happens when
you try to compile (in Geany).
No error messages, no missing libs message, nothing.
I expected at least a message xx.lib required or
Can't find xx
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: segmentation fault

Post by Munair »

Dinosaur wrote:Hi All

Same error when I run the "Hello.bas" example ???

Regards

Edit: Interesting that when you put -nodeflibs on the command line, simply nothing happens when
you try to compile (in Geany).
No error messages, no missing libs message, nothing.
I expected at least a message xx.lib required or
Can't find xx
Sounds like something is wrong with Mint. Both Ubuntu and Mint can cause problems due to package version conflicts and other dependency related problems. I experienced it multiple times when I tried to use either of them as a programming platform. You would be better off with Debian stable. I use it since version 6 and always came back to it (currently version 9) because of its stability and default absence of proprietary stuff. I also don't use backports for this reason. It's probably one of the best Linux (programming) platforms. I also have a Debian 7 server running for several years now. No issues whatsoever and still rock solid.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: segmentation fault

Post by lizard »

Dinosaur wrote:Same error when I run the "Hello.bas" example ???
Must be definitly something wrong with your installation. I am compiling since months all kinds of FB programs and most of the examples (these where i have the needed libs) including "hello.bas" with Mint 18.2 Cinnamon 32 bit, FB 1.05 and Geany without any error messages.
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: segmentation fault

Post by Munair »

lizard wrote:
Dinosaur wrote:Same error when I run the "Hello.bas" example ???
Must be definitly something wrong with your installation. I am compiling since months all kinds of FB programs and most of the examples (these where i have the needed libs) including "hello.bas" with Mint 18.2 Cinnamon 32 bit, FB 1.05 and Geany without any error messages.
64 bits may be different.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: segmentation fault

Post by lizard »

Munair wrote:64 bits may be different.
Haven't tested.
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: segmentation fault

Post by Dinosaur »

Hi All

Just an update after I got it working.
I re-installed Mint 18.3 but the difference was:
Installed with mSata plugged into socket of pc instead of usb adapter.(was at least quicker to install)
Used Lizard's instructions which I noticed had all .dev packages and not just the libraries.
(Does that mean the libraries were compiled during the installation, and previously they were not ??)
Previously I used Synaptic to download the missing Libraries.

Munair I did download Ubuntu Gnome 16.04.3, but wrote it to a standard usb stick to play with.
Much to slow, so ordered another mSata drive to put it on, and will have another play.
Perhaps because of familiarity issues, I thought in Ubuntu it was harder to navigate to the tools I use.
Then again having to choose which "Flavour" may be to blame.

Many thanks for the help

Regards
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: segmentation fault

Post by Munair »

If Gnome is too slow, you could try XFCE or Mate. Personally, I am very comfortable with Debian 9 KDE.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: segmentation fault

Post by lizard »

Dinosaur wrote:Used Lizard's instructions which I noticed had all .dev packages and not just the libraries.
(Does that mean the libraries were compiled during the installation, and previously they were not ??)
Seems, the .dev files you need to compile. The normal libs to run the compiled programs, but they are often already installed. In synaptic you can see which files are in which packages and where they are stored. Linux is a gigantic labyrinth, step by step i am finding my way through.
Post Reply