LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   GCC 8.2 seg faults on up-to-date Slackware64-current (https://www.linuxquestions.org/questions/slackware-14/gcc-8-2-seg-faults-on-up-to-date-slackware64-current-4175637327/)

gdsotirov 08-28-2018 01:47 PM

GCC 8.2 seg faults on up-to-date Slackware64-current
 
I recently upgraded my Slackware64-current virtual machine running on ESXi 6 hypervisor. Now I'm not able to compile anything, because GCC segmentation faults like this:

Code:

during GIMPLE pass: ldist
source.c: In function ‘main’:
source.c:19:5: internal compiler error: Segmentation fault
 int main(int argc,
    ^~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.

Anyone having the same or similar problem? I noticed that GCC pretty much fails on random places in different software that normally compiles OK. I'm pretty sure the previous version of GCC I was using was GCC 7.3, because I haven't upgraded the VM in a while, but now the latest in -current is 8.2.0 from July 27.
I'm running several other Slackware 14.x virtual machines on the same hypervisor, but I'm not having any problems compiling on them.

orbea 08-29-2018 09:39 AM

I have run into a few GCC bugs, but I can't say I ever seen it outright segfault...

Does using clang instead also have problems?

I think the possibilities are that you made a mistake in your update process or you ran into an obscure bug that only presents itself in the right environment. Either way there is not much to go on here, reading that gcc bugs link and following the instructions provided would prove your best bet to figuring this out.

gdsotirov 08-29-2018 01:45 PM

Quote:

Originally Posted by orbea (Post 5897488)
Does using clang instead also have problems?

I haven't though changing the compiler, but I tried. Clang doesn't seg fault, but instead leads to linker error, so a new problem to solved...

Quote:

Originally Posted by orbea (Post 5897488)
I think the possibilities are that you made a mistake in your update process

I used slackpkg and just upgraded all available packages. What mistake could have I made?

Quote:

Originally Posted by orbea (Post 5897488)
or you ran into an obscure bug that only presents itself in the right environment. Either way there is not much to go on here, reading that gcc bugs link and following the instructions provided would prove your best bet to figuring this out.

Yep, that's perhaps my only option, because with GCC I had not linking errors. However, I consider this as a last resort. I though the community could have the answer. I also found some information about possible segmentation faults in 8.2 from the hardening, but I'll first try reinstalling the VM. Unfortunately, I cannot just reinstall the older GCC version, which was working fine.

orbea 08-29-2018 01:57 PM

Quote:

Originally Posted by gdsotirov (Post 5897613)
I used slackpkg and just upgraded all available packages. What mistake could have I made?

Did you install the new packages? This is the general update process for Slackware current with slackpkg.

Code:

slackpkg update
slackpkg install-new
slackpkg upgrade-all
slackpkg clean-system

Note that "slackpkg clean-system" will prompt to remove all third party packages if they are not correctly blacklisted.

Since clang doesn't work too I want to suspect this is a general system issue and not a compiler bug.

gdsotirov 08-29-2018 04:10 PM

Quote:

Originally Posted by orbea (Post 5897625)
Did you install the new packages?

Hmm... you never know until someone pays you attention :-) Thanks for the suggestion! Apparently, I have forgot to do this and Slackware is not exactly the OS managing (new) requirements properly. Anyway I was missing a total of 26 packages (apparently I haven't upgraded recently) listed here below:
  • easytag
  • efivar
  • fig2dev
  • fluidsynth
  • gexiv2 (required by gimp-2.10)
  • haveged
  • icecream
  • igt-gpu-tools
  • jmtpfs
  • json-glib (required by gegl-0.4 and gimp-2.10)
  • lbzip2
  • libmypaint (required by gimp-2.10)
  • meson
  • mypaint-brushes (rqeuired by gimp-2.10)
  • ninja
  • openssl10 (openssl-1.0 compatibility)
  • openssl10-solibs (openssl-1.0 compatibility)
  • parallel
  • pcre2
  • python-notify2
  • re2c
  • rxvt-unicode
  • sc-im
  • ttf-tlwg
  • utf8proc (required by subversion-1.10)
  • wireless_tools
  • xorgproto

However, I could confidently rule them all out after checking the change log, because none of these is related to GCC. Anyway, better try then speak, so I installed all new (and missing) packages, restarted and (by no surprise) I have the same seg fault when trying to compile any software with GCC, so still no joy...

Quote:

Originally Posted by orbea (Post 5897625)
Note that "slackpkg clean-system" will prompt to remove all third party packages if they are not correctly blacklisted.

Yes, I know this. I have only some packages built by me, which again have no relation to GCC.

Quote:

Originally Posted by orbea (Post 5897625)
Since clang doesn't work too I want to suspect this is a general system issue and not a compiler bug.

As I explained Clang is compiling fine, but there is some linking error, which I do not want to dig into further, so the issue is not exactly the same. As far as I could tell from my experience with Slackware in the past about 18 years the rest of the system is working perfectly fine. It's just GCC that fails to compile sources, which with older versions (I believe I was using GCC 7.3 before) compiled without any problem. Therefore my attention was and is still on GCC.

Alien Bob 08-29-2018 04:46 PM

Let me try to get this more crisp:
Your original situation was a 'stale' Slackware-current installation which you upgraded, and then you also added all packages which were listed as "Added:" in the Slackware ChangeLog.txt?
My question:
Your original situation, was that a full install of Slackware-current or did you omit packages during the installation?

orbea 08-29-2018 04:46 PM

I just think that both compilers entirely breaking in strange ways at same time is suspicious. Sorry this is not more helpful.

gdsotirov 08-30-2018 03:29 AM

Quote:

Originally Posted by Alien Bob (Post 5897705)
Your original situation was a 'stale' Slackware-current installation which you upgraded, and then you also added all packages which were listed as "Added:" in the Slackware ChangeLog.txt?

Yes, a Slackware64-current not upgraded from several months. First, I just upgraded everything and then I also installed all new packages (after the comment of obea as I simply forgot). However, I do not think that any of the missing packages are related to GCC like I wrote in my previous comment. Anyway, I now have a completely updated Slackware64-current with all the new packages installed and the seg fault by GCC still persists.

Quote:

Originally Posted by Alien Bob (Post 5897705)
Your original situation, was that a full install of Slackware-current or did you omit packages during the installation?

A full install (as I find it the easiest option). I haven't omitted anything.

gdsotirov 08-30-2018 03:36 AM

Quote:

Originally Posted by orbea (Post 5897706)
I just think that both compilers entirely breaking in strange ways at same time is suspicious.

I haven't used Clang on Slackware before, so I have no reference for comparison like it's the case with GCC. Again with Clang there is a linker error (and not seg fault on compilation, so for me there's difference). I do not have the time and I do not want to dig further into the linker problem, because with previous versions of GCC there was no such problem at all and I was able to compile the same sources just fine. It's a pity I cannot just revert to previous GCC packages, but perhaps they just won't work on the upgraded -current.

ponce 08-30-2018 03:59 AM

I would double-check if everything is installed with
Code:

slackpkg install slackware64
if you think something got corrupted you could also try
Code:

slackpkg reinstall slackware64
could you please also point at what is that fails to build with gcc and clang because from what you write seems to be a specific software (and in that case it might be that it works only with gcc < 8.x).

gdsotirov 08-30-2018 12:17 PM

Quote:

Originally Posted by ponce (Post 5897886)
if you think something got corrupted you could also try
Code:

slackpkg reinstall slackware64

Well, I haven't though about this, but I reinstalled just GCC and the problem is gone. Thanks for the suggestion! :-)

Quote:

Originally Posted by ponce (Post 5897886)
could you please also point at what is that fails to build with gcc and clang because from what you write seems to be a specific software (and in that case it might be that it works only with gcc < 8.x).

Nothing specific, just some free and open source software found all over the Internet.

Note: As as side note I also had to rebuild some libraries (e.g. protobuf) that I previously built with GCC 7.x, so I could build other software that requires them with GCC 8.

qunying 08-31-2018 12:12 PM

It is better to do a fresh install of current.

BradReed 09-03-2018 06:56 PM

Quote:

Originally Posted by qunying (Post 5898461)
It is better to do a fresh install of current.

A fresh install of your OS is almost never the correct solution, unless you are running Windows.


All times are GMT -5. The time now is 10:49 AM.