hercules-390 / hyperion

Hercules 390
Other
251 stars 69 forks source link

Segfault on IPL in hyperion git master #92

Closed rubin55 closed 8 years ago

rubin55 commented 8 years ago

When attempting to boot a zArch based hercules instance, after IPL, I get the following segementation fault:

HHC01604I ipl a80
HHC00811I Processor CP00: architecture mode ESA/390
HHC00811I Processor CP01: architecture mode ESA/390
HHC00811I Processor CP03: architecture mode ESA/390
HHC00811I Processor CP02: architecture mode ESA/390
HHC00801I Processor CP00:  Special-operation exception code 0013  ilc 4
HHC02324I CP00: PSW=0008000080000616 INST=B2790000     SACF  0(0)
set_address_space_control_fast
HHC02326I CP00: R:00000000:K:06=00080000 800005FC 40404040 F0F04040  ........    00
HHC02269I CP00: GR00=00000000 GR01=00000000 GR02=00000000 GR03=00000000
HHC02269I CP00: GR04=00000000 GR05=00000000 GR06=00000000 GR07=00000000
HHC02269I CP00: GR08=00000000 GR09=00000000 GR10=00000000 GR11=00000000
HHC02269I CP00: GR12=00000000 GR13=00000000 GR14=00000000 GR15=00000000
HHC02271I CP00: CR00=01B00200 CR01=00000000 CR02=00000000 CR03=00000000
HHC02271I CP00: CR04=00000000 CR05=00000000 CR06=FE000000 CR07=00000000
HHC02271I CP00: CR08=00000000 CR09=00000000 CR10=00000000 CR11=00000000
HHC02271I CP00: CR12=00000000 CR13=00000000 CR14=C2000000 CR15=00000000
HHC00100I Thread id 00007f7c52c8a700, prio -20, name Read-ahead thread-1 started
HHC00100I Thread id 00007f7c52b89700, prio -20, name Read-ahead thread-2 started
HHC00814I Processor CP00: SIGP Unassigned                       (14) CP00, PARM 64000000: CC 1 status 00000002
HHC00814I Processor CP00: SIGP Set architecture mode            (12) CP00, PARM 00000001: CC 0
HHC00811I Processor CP00: architecture mode z/Arch
HHC00823I Processor CP00: check-stop due to host error: Segmentation fault
HHC02324I CP00: PSW=0400000080000000 000000002003C2D8 INST=58A0B591     L     10,1425(0,11)          load
HHC02326I CP00: V:000000002003C590:K:06=2005CB5C A003B386 A003B390 A003B464  ...*...f........     R1=000000002003C5A8  R3=0000000000000000
HHC02269I CP00: R4=00000000201263E8 R5=00000000000000B8
HHC02269I CP00: R6=000000002005D0CB R7=00000000000000B8
HHC02269I CP00: R8=0000000000000550 R9=000000000000018C
HHC02269I CP00: RA=000000002005CB5C RB=000000002003BFFF
HHC02269I CP00: RC=00000000A003B000 RD=000000002003C544
HHC02269I CP00: RE=00000000000000B8 RF=00000000201263E8

My hercules version info is:

HHC01413I Hercules version 4.00
HHC01414I (c) Copyright 1999-2015 by Roger Bowler, Jan Jaeger, and others
HHC01415I Build date: Feb 11 2016 at 20:39:33
HHC01417I Built with: GCC 4.9.3
HHC01417I Build type: GNU/Linux x86_64 host architecture build
HHC01417I Modes: S/370 ESA/390 z/Arch
HHC01417I Max CPU Engines: 8
HHC01417I Using setresuid() for setting privileges
HHC01417I Using POSIX threads Threading Model
HHC01417I Using Error-Checking Mutex Locking Model
HHC01417I With Syncio support
HHC01417I With Shared Devices support
HHC01417I With Dynamic loading support
HHC01417I Using shared libraries
HHC01417I With External GUI support
HHC01417I With IPV6 support
HHC01417I With HTTP Server support
HHC01417I With sqrtl support
HHC01417I With SIGABEND handler
HHC01417I With CCKD BZIP2 support
HHC01417I With HET BZIP2 support
HHC01417I With ZLIB support
HHC01417I With Regular Expressions support
HHC01417I Without Object REXX support
HHC01417I With Regina REXX support
HHC01417I With Automatic Operator support
HHC01417I Without National Language Support
HHC01417I Machine dependent assists: cmpxchg1 cmpxchg4 cmpxchg8
HHC01417I Running on: tezro (Linux-4.1.12-gentoo x86_64) MP=4
HHC01508I HDL: loadable module directory is /opt/hercules/h4/lib/hercules
HHC00150I Crypto module loaded (c) Copyright 2003-2015 by Bernard van der Helm
HHC00151I Activated facility: Message Security Assist
HHC00151I Activated facility: Message Security Assist Extension 1, 2, 3 and 4
HHC00100I Thread id 00007f44467ec700, prio 15, name Processor CP00 started
HHC00100I Thread id 00007f44466eb700, prio -20, name Timer started
HHC00811I Processor CP00: architecture mode z/Arch
HHC00100I Thread id 00007f4449f46700, prio 0, name Control panel started.
rubin55 commented 8 years ago

Ah, and my build flags:

./configure --enable-optimization=yes --enable-het-bzip2 --enable-cckd-bzip2 \
--enable-ipv6 --enable-regina-rexx --disable-interlocked-access-facility-2 \
--prefix=/opt/hercules/h4 --mandir=/opt/hercules/h4/ma
jphartmann commented 8 years ago

If you are running on a UNIX platform, please try with --enable-optimization='O2 -g'

If it produces a core file, you should be able to see where the failure occurs.

rubin55 commented 8 years ago

Compiling with these optimization flags makes the bug go away!

jphartmann commented 8 years ago

Ivan, Fish: You heard the man. Can we make -O2 the default optimisation?

ivan-w commented 8 years ago

I disagree

The only option I see would be to 1) Create a clear test case (not a hercules based test.. I mean a c or a couple of c programs embedded in an autoconf m4 macro) 2) Test with the compiler whether the test case segfaults 3) If it fails THEN and only THEN switch to -O2

--Ivan

On 2/12/2016 4:15 PM, John P. Hartmann wrote:

Ivan, Fish: You heard the man. Can we make -O2 the default optimisation?

— Reply to this email directly or view it on GitHub https://github.com/hercules-390/hyperion/issues/92#issuecomment-183369458.

jphartmann commented 8 years ago

Ivan, -O3 does not guarantee a faster program than -O2. On z we have seen cases of a 50% degradation when going from -O2 to -O3.

truda commented 8 years ago

Hello,

IIRC this is a bug in gcc 4.9 only and this problem does not occur in newer versions of gcc. If compiling with gcc 4.9 use -O2 if using newer versions of gcc then there is no problem as the bug was corrected. I cannot find the mail again but I remember I filed this with gcc developers and they confirmed it was a possible bug in gcc 4.9 which was subsequently resolved in later versions of gcc. If you want proof let me know I will search in my archives for the mail about this issue.

truda commented 8 years ago

I stand corrected this also still seams to appear in some newer versions of gcc

Fish-Git commented 8 years ago

I agree with Ivan: we should keep -O3 and create a configure.ac test case to detect "bad" versions of gcc and automatically fallback to -O2 only for them.

HOWEVER, the problem is, how do we detect it? Does anyone have a simple reproducible test case that we can stick into configure.ac?

Regardless, I am going to go ahead and close this issue since it's not a Hercules issue but rather a GCC issue.

ivan-w commented 8 years ago

I don't have one now (or yet). Just spent 8 hours trying to figure out the FORMSSI issue and why my VM/SP5 CMS wouldn't IPL under CMS on hyperion.

So I concur with closing the issue - and I'll reopen it once I have a solution (a broken gcc -O3 testcase OR if I can determine what makes -O3 break hercules - another strict aliasing issue somewhere perhaps ?)

(Right now I'm mostly using clang/llvm since it works MUCH better and seems to generate better code anyways).

(On a side note - can we have a new public forum where we can openly discuss issues without having to stick to any single issue at hand ?)

--Ivan

Le 20/04/2016 05:05, Fish-Git a écrit :

I agree with Ivan: we should keep -O3 and create a configure.ac test case to detect "bad" versions of gcc and automatically fallback to -O2 /only/ for them.

/HOWEVER/, the problem is, how do we detect it? Does anyone have a /simple/ reproducible test case that we can stick into configure.ac?

Regardless, I am going to go ahead and close this issue since it's not a Hercules issue but rather a GCC issue.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/hercules-390/hyperion/issues/92#issuecomment-212227349

Fish-Git commented 8 years ago

Agree strongly about clang!

jphartmann commented 8 years ago

CLANG is very interesting, I agree, but there are a number of incompatibilities between the too and CLANG issues different warnings. Not to mention all the C extensions the GCC has that CLANG does not; my favourite is nested functions.