Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 587730 - app-shells/ksh-93.20140625 i686-pc-linux-gnu-gcc: internal compiler error: Segmentation fault (program as)
Summary: app-shells/ksh-93.20140625 i686-pc-linux-gnu-gcc: internal compiler error: Se...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 591080 (view as bug list)
Depends on: 595288
Blocks:
  Show dependency tree
 
Reported: 2016-07-01 20:00 UTC by David W Noon
Modified: 2017-03-12 21:37 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge_info.txt,7.03 KB, text/plain)
2016-07-01 20:00 UTC, David W Noon
Details
ebuild log (app-shells:ksh-93.20140625:20160701-161300.log,639.28 KB, text/plain)
2016-07-01 20:01 UTC, David W Noon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David W Noon 2016-07-01 20:00:14 UTC
Created attachment 439352 [details]
emerge --info

The build of ksh seems to require the old 16-bit Microsoft/IBM make utility.

+ nmake --base --compile --file=/var/tmp/portage/app-shells/ksh-93.20140625/work/src/cmd/nmake/Makerules.mk
sh: line 3: nmake: command not found

The ebuild log and emerge --info will be attached.
Comment 1 David W Noon 2016-07-01 20:01:13 UTC
Created attachment 439354 [details]
ebuild log
Comment 2 Mike Gilbert gentoo-dev 2016-07-01 20:05:53 UTC
nmake is a UNIX command that gets built during the ksh build process.

The real error is further up; the assembler is segfaulting.

iffe: cc -fPIC -march=athlon-mp -mmmx -m3dnow -msse -mfpmath=sse,387 -O2 -pipe -fomit-frame-pointer -fno-stack-protector -Wl,-O1 -Wl,--as-needed -L/var/tmp/portage/app-shells/ksh-93.20140625/work/arch/linux.i386/lib -I/var/tmp/portage/app-shells/ksh-93.20140625/work/arch/linux.i386/include/ast -I/var/tmp/portage/app-shells/ksh-93.20140625/work/arch/linux.i386/include -c ./karn10110.c
i686-pc-linux-gnu-gcc: internal compiler error: Segmentation fault (program as)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.
iffe: cc: core dump or fatal interruption -- results inconclusive
mamake [lib/libcoshell]: *** exit code 139 making FEATURE/nfsd
Comment 3 SpanKY gentoo-dev 2016-07-04 05:53:41 UTC
check `dmesg` to see it has anything useful

otherwise, try building binutils with simpler CFLAGS (like just -O2 -march=native) and see if it ksh works.
Comment 4 David W Noon 2016-07-04 17:24:07 UTC
(In reply to SpanKY from comment #3)
> check `dmesg` to see it has anything useful

dmesg shows nothing in the way of disk corruption or anything like that.

> otherwise, try building binutils with simpler CFLAGS (like just -O2
> -march=native) and see if it ksh works.

I rebuilt binutils with:
  -march=native -O2 -pipe

The build of ksh still crashes with the segfault in as. The ebuild log is effectively identical to the one already uploaded.
Comment 5 David W Noon 2017-01-06 20:20:14 UTC
It has been 6 months since I reported this. Has there been any progress made on it?

I have seen that bug #591080 has identical symptoms, so it seems to confirm this bug. It also seems to be specific to 32-bit systems. Does this help?
Comment 6 Harry Putnam 2017-01-08 20:15:12 UTC
(In reply to David W Noon from comment #5)
> It has been 6 months since I reported this. Has there been any progress made
> on it?
> 
> I have seen that bug #591080 has identical symptoms, so it seems to confirm
> this bug. It also seems to be specific to 32-bit systems. Does this help?

On the 32 bit part only:

I started a thread on gentoo newsgroup that you responded to on this issue some
time ago.

Since then I've installed another gentoo into a vbox vm... and once again cannot emerge ksh.... with this same problem.  (It is also a 32 bit vm)

OK, now the good part: I have anther host (vbox vm) running gentoo, only on that install I was unable to get lxde running.... I decided to turn it into a no-x host and unmerged all X stuff. (Not sure if that has any bearing)

I did manage to get ksh installed there... I must have installed with no issues since I don't recall having to do anything special.

So cutting to the chase: I have one 32 bit install of gentoo in a vbox vm where I cannot install ksh with the problem described in this bug. (Bug 587730).
I have another slightly older install of 32 bit gentoo where ksh installed with no problems.  Both cases were installing this version: 
   app-shells/ksh-93.20160110
CFLAGS="-O2 -march=i686 -pipe"  in both /etc/portage/make.conf

I hope there is a clue in there somewhere... but not sure how to go about finding it.  If you have ideas you can send me a message at reader@newsguy.com
Comment 7 David W Noon 2017-01-08 21:42:59 UTC
(In reply to Harry Putnam from comment #6)
> (In reply to David W Noon from comment #5)
> > It has been 6 months since I reported this. Has there been any progress made
> > on it?
> > 
> > I have seen that bug #591080 has identical symptoms, so it seems to confirm
> > this bug. It also seems to be specific to 32-bit systems. Does this help?
> 
> On the 32 bit part only:
> 
> I started a thread on gentoo newsgroup that you responded to on this issue
> some
> time ago.

Well, it has been hanging around for some time.

> Since then I've installed another gentoo into a vbox vm... and once again
> cannot emerge ksh.... with this same problem.  (It is also a 32 bit vm)
> 
> OK, now the good part: I have anther host (vbox vm) running gentoo, only on
> that install I was unable to get lxde running.... I decided to turn it into
> a no-x host and unmerged all X stuff. (Not sure if that has any bearing)
> 
> I did manage to get ksh installed there... I must have installed with no
> issues since I don't recall having to do anything special.
> 
> So cutting to the chase: I have one 32 bit install of gentoo in a vbox vm
> where I cannot install ksh with the problem described in this bug. (Bug
> 587730).
> I have another slightly older install of 32 bit gentoo where ksh installed
> with no problems.  Both cases were installing this version: 
>    app-shells/ksh-93.20160110
> CFLAGS="-O2 -march=i686 -pipe"  in both /etc/portage/make.conf
> 
> I hope there is a clue in there somewhere... but not sure how to go about
> finding it.  If you have ideas you can send me a message at
> reader@newsguy.com

The real problem is in sys-devel/binutils whereby /usr/bin/as is segfaulting. I have upgraded GCC since I reported this, but the newer C compiler probably generates identical assembler code to the old one and hence the assembly still segfaults.

The binutils in question, on my machine, is 2.25.1-r1. I might rebuild this with -march=i486 instead of -march=native and see if that changes anything.

The newer version of app-shells/ksh probably does not have much effect, as the Korn shell is very old and it source code does not change very much these days, even in "clean room" builds that differ from the AT&T original Korn shell.

I have also installed app-shells/mksh as an alternative Korn shell.
Comment 8 David K. Thompson 2017-01-10 17:55:31 UTC
This problem is reproducible trying to rebuild ksh (via emerge -e world) on two similar 32 bit machines, both already have app-shell/ksh installed - was last built successfully 7/21/16. It builds OK on two other 64 bit machines.

Same binutils (2.25.1-r1) and gcc (4.9.4) on all machines.

CFLAGS="-march=pentium3 -O2" on one of the failing machines, CFLAGS="-march=native -O2" on the other.

Bug 591080 is a duplicate.
Comment 9 David K. Thompson 2017-01-11 20:11:48 UTC
Builds without problem using binutils-2.26.1. Does not currently build with 2.25.1-r1 (current stable version)
Comment 10 SpanKY gentoo-dev 2017-01-18 06:11:27 UTC
*** Bug 591080 has been marked as a duplicate of this bug. ***
Comment 11 David W Noon 2017-03-12 18:22:42 UTC
Since the stabilization of sys-apps/binutils-2.26.1, the assembler code for this package now assembles properly.