Go

Go on z/OS

Go on z/OS

This group is a space for open discussions and sharing technical information, and also provides a connection to the wider Go open source community for anyone who is interested in Go on z/OS

 View Only
  • 1.  install_test.sh fails

    Posted Thu December 08, 2022 01:17 AM
    I am on z/OS 2.5. I installed the pax version Go 1.19.3 i.e. HAMF1J0.nonsmpe.pax.Z.  
    After this I try to run the install_test.sh shell script which is in ~/go directory I get the following error:-
    bash-4.3$ ./install_test.sh
    go version go1.19.3 zos/s390x
    SIGILL: illegal instruction
    PC=0xc00158acd4 m=0 sigcode=11
    instruction bytes @ 0xc00158accc
    0x1 0x58 0xad 0x78 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x6 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x6 0x0 0x0 0x0 0x0 0x0 0x0 0x1 0xf8 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x80 0xc1 0xe3 0xe3 0x40 0x0 0x3 0x0 0x0 0x0 0x0 0x40 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
    r0 0x3338000 r1 0xc00158ad78
    r2 0x1f8 r3 0xc00158acf8
    r4 0xc00158ace8 r5 0xc00158ad78
    r6 0x0 r7 0x36c98110
    r8 0xc00158acc0 r9 0x31fb8a10
    r10 0x3770bf9c r11 0x50
    r12 0x3733c830 r13 0xc0000041a0
    r14 0x36c99e7a r15 0xc00158acc0
    pc 0xc00158acd4 link 0x36c99e7a
    ar0 0x0 ar1 0x0
    ar2 0x0 ar3 0x0
    ar4 0x0 ar5 0x0
    ar6 0x0 ar7 0x0
    ar8 0x0 ar9 0x0
    ar10 0x0 ar11 0x0
    ar12 0x0 ar13 0x0
    ar14 0x0 ar15 0x0
    
    goroutine 1 [running]:
    runtime: g 1: unknown pc 0xc00158acd4
    stack: frame={sp:0xc00158acc0, fp:0x0} stack=[0xc001588000,0xc00158c000)
    0x000000c00158abc0: 0x0000000036d8806e <regexp.mergeRuneSets+0x0000000000000556> 0x000000c001530b10
    0x000000c00158abd0: 0x000000003770b978 0x0000000000000000
    0x000000c00158abe0: 0x000000c001530b10 0x0000000000000004
    0x000000c00158abf0: 0x0000000000000002 0x0000000000000000
    0x000000c00158ac00: 0x0000000000000008 0x0000000036d8858c <regexp.mergeRuneSets+0x0000000000000a74>
    0x000000c00158ac10: 0x0000000036d894c4 <regexp.makeOnePass.func1+0x00000000000003cc> 0x000000003722cfb8
    0x000000c00158ac20: 0x000000003770b978 0x0000000000000000
    0x000000c00158ac30: 0x0000000000000000 0x0000000000000001
    0x000000c00158ac40: 0x000000c001530b10 0x0000000000000000
    0x000000c00158ac50: 0x0000000000000002 0x0000000000000001
    0x000000c00158ac60: 0x0000000000000100 0x0000003900000030
    0x000000c00158ac70: 0x0000000000000002 0x0000000000000000
    0x000000c00158ac80: 0x0000000000000001 0x0000000000000000
    0x000000c00158ac90: 0x0000000000000002 0x000000c001530b10
    0x000000c00158aca0: 0x0000000000000001 0x0000000000000002
    0x000000c00158acb0: 0x000000c001530b08 0x0000000000000002
    0x000000c00158acc0: <0x0000000036c982b6 <internal/bpx.Pipe+0x000000000000009e> 0x000000c00158ad78
    0x000000c00158acd0: 0x0000000000000006 0x0000000000000006
    0x000000c00158ace0: 0x00000000000001f8 0x0000000000000000
    0x000000c00158acf0: 0x0000000000000080 0xc1e3e34000030000
    0x000000c00158ad00: 0x0000400000000000 0x0000000000000000
    0x000000c00158ad10: 0x0000000000000000 0x0000000000000000
    0x000000c00158ad20: 0x0000000000000000 0x0000000000000000
    0x000000c00158ad30: 0x0000000000000000 0x0000000003338000
    0x000000c00158ad40: 0x0000000000000000 0x0000000000000000
    0x000000c00158ad50: 0x0000000000000000 0x0000000000000000
    0x000000c00158ad60: 0x0000000000000000 0x0000000000000000
    0x000000c00158ad70: 0x0000000000000000 0x000000c00158adb0
    0x000000c00158ad80: 0x000000c00158acf4 0x000000c00158acf8
    0x000000c00158ad90: 0x000000c00158ace8 0x000000c00158acf0
    0x000000c00158ada0: 0x000000c00158acec 0x0000000036c54ddc <runtime.nonblockingPipe+0x0000000000000024>
    0x000000c00158adb0: 0x0000000400000333 0x0100000000000005
    runtime: g 1: unknown pc 0xc00158acd4
    stack: frame={sp:0xc00158acc0, fp:0x0} stack=[0xc001588000,0xc00158c000)
    0x000000c00158abc0: 0x0000000036d8806e <regexp.mergeRuneSets+0x0000000000000556> 0x000000c001530b10
    0x000000c00158abd0: 0x000000003770b978 0x0000000000000000
    0x000000c00158abe0: 0x000000c001530b10 0x0000000000000004
    0x000000c00158abf0: 0x0000000000000002 0x0000000000000000
    0x000000c00158ac00: 0x0000000000000008 0x0000000036d8858c <regexp.mergeRuneSets+0x0000000000000a74>
    0x000000c00158ac10: 0x0000000036d894c4 <regexp.makeOnePass.func1+0x00000000000003cc> 0x000000003722cfb8
    0x000000c00158ac20: 0x000000003770b978 0x0000000000000000
    0x000000c00158ac30: 0x0000000000000000 0x0000000000000001
    0x000000c00158ac40: 0x000000c001530b10 0x0000000000000000
    0x000000c00158ac50: 0x0000000000000002 0x0000000000000001
    0x000000c00158ac60: 0x0000000000000100 0x0000003900000030
    0x000000c00158ac70: 0x0000000000000002 0x0000000000000000
    0x000000c00158ac80: 0x0000000000000001 0x0000000000000000
    0x000000c00158ac90: 0x0000000000000002 0x000000c001530b10
    0x000000c00158aca0: 0x0000000000000001 0x0000000000000002
    0x000000c00158acb0: 0x000000c001530b08 0x0000000000000002
    0x000000c00158acc0: <0x0000000036c982b6 <internal/bpx.Pipe+0x000000000000009e> 0x000000c00158ad78
    0x000000c00158acd0: 0x0000000000000006 0x0000000000000006
    0x000000c00158ace0: 0x00000000000001f8 0x0000000000000000
    0x000000c00158acf0: 0x0000000000000080 0xc1e3e34000030000
    0x000000c00158ad00: 0x0000400000000000 0x0000000000000000
    0x000000c00158ad10: 0x0000000000000000 0x0000000000000000
    0x000000c00158ad20: 0x0000000000000000 0x0000000000000000
    0x000000c00158ad30: 0x0000000000000000 0x0000000003338000
    0x000000c00158ad40: 0x0000000000000000 0x0000000000000000
    0x000000c00158ad50: 0x0000000000000000 0x0000000000000000
    0x000000c00158ad60: 0x0000000000000000 0x0000000000000000
    0x000000c00158ad70: 0x0000000000000000 0x000000c00158adb0
    0x000000c00158ad80: 0x000000c00158acf4 0x000000c00158acf8
    0x000000c00158ad90: 0x000000c00158ace8 0x000000c00158acf0
    0x000000c00158ada0: 0x000000c00158acec 0x0000000036c54ddc <runtime.nonblockingPipe+0x0000000000000024>
    0x000000c00158adb0: 0x0000000400000333 0x0100000000000005
    
    goroutine 2 [force gc (idle)]:
    runtime.gopark(0x3733cda8, 0x376cb3c8, 0x11, 0x14, 0x1)
    /home/zosgo/go-build/build-3/src/runtime/proc.go:363 +0x134 fp=0xc00046a7b0 sp=0xc00046a798 pc=0x36c5e8cc
    runtime.goparkunlock(...)
    /home/zosgo/go-build/build-3/src/runtime/proc.go:369
    runtime.forcegchelper()
    /home/zosgo/go-build/build-3/src/runtime/proc.go:302 +0xc2 fp=0xc00046a7d8 sp=0xc00046a7b0 pc=0x36c5e70a
    runtime.goexit()
    /home/zosgo/go-build/build-3/src/runtime/asm_zos_s390x.s:788 +0x2 fp=0xc00046a7d8 sp=0xc00046a7d8 pc=0x36c9478a
    created by runtime.init.5
    /home/zosgo/go-build/build-3/src/runtime/proc.go:290 +0x30
    
    goroutine 3 [GC sweep wait]:
    runtime.gopark(0x3733cda8, 0x376cbf58, 0xc, 0x14, 0x1)
    /home/zosgo/go-build/build-3/src/runtime/proc.go:363 +0x134 fp=0xc00046afa0 sp=0xc00046af88 pc=0x36c5e8cc
    runtime.goparkunlock(...)
    /home/zosgo/go-build/build-3/src/runtime/proc.go:369
    runtime.bgsweep(0xc000480000)
    /home/zosgo/go-build/build-3/src/runtime/mgcsweep.go:278 +0xa0 fp=0xc00046afc8 sp=0xc00046afa0 pc=0x36c46318
    runtime.gcenable.func1()
    /home/zosgo/go-build/build-3/src/runtime/mgc.go:178 +0x5e fp=0xc00046afd8 sp=0xc00046afc8 pc=0x36c388a6
    runtime.goexit()
    /home/zosgo/go-build/build-3/src/runtime/asm_zos_s390x.s:788 +0x2 fp=0xc00046afd8 sp=0xc00046afd8 pc=0x36c9478a
    created by runtime.gcenable
    /home/zosgo/go-build/build-3/src/runtime/mgc.go:178 +0xa8
    
    goroutine 4 [GC scavenge wait]:
    runtime.gopark(0x3733cda8, 0x376cc458, 0xd, 0x14, 0x2)
    /home/zosgo/go-build/build-3/src/runtime/proc.go:363 +0x134 fp=0xc00046b780 sp=0xc00046b768 pc=0x36c5e8cc
    runtime.goparkunlock(...)
    /home/zosgo/go-build/build-3/src/runtime/proc.go:369
    runtime.(*scavengerState).park(0x376cc458)
    /home/zosgo/go-build/build-3/src/runtime/mgcscavenge.go:389 +0x72 fp=0xc00046b7a8 sp=0xc00046b780 pc=0x36c43d4a
    runtime.bgscavenge(0xc000480000)
    /home/zosgo/go-build/build-3/src/runtime/mgcscavenge.go:622 +0x5a fp=0xc00046b7c8 sp=0xc00046b7a8 pc=0x36c44412
    runtime.gcenable.func2()
    /home/zosgo/go-build/build-3/src/runtime/mgc.go:179 +0x5e fp=0xc00046b7d8 sp=0xc00046b7c8 pc=0x36c38826
    runtime.goexit()
    /home/zosgo/go-build/build-3/src/runtime/asm_zos_s390x.s:788 +0x2 fp=0xc00046b7d8 sp=0xc00046b7d8 pc=0x36c9478a
    created by runtime.gcenable
    /home/zosgo/go-build/build-3/src/runtime/mgc.go:179 +0x10e
    
    goroutine 18 [finalizer wait]:
    runtime.gopark(0x3733cda8, 0x3770b880, 0x10, 0x14, 0x1)
    /home/zosgo/go-build/build-3/src/runtime/proc.go:363 +0x134 fp=0xc000468718 sp=0xc000468700 pc=0x36c5e8cc
    runtime.goparkunlock(...)
    /home/zosgo/go-build/build-3/src/runtime/proc.go:369
    runtime.runfinq()
    /home/zosgo/go-build/build-3/src/runtime/mfinal.go:180 +0x132 fp=0xc0004687d8 sp=0xc000468718 pc=0x36c375ca
    runtime.goexit()
    /home/zosgo/go-build/build-3/src/runtime/asm_zos_s390x.s:788 +0x2 fp=0xc0004687d8 sp=0xc0004687d8 pc=0x36c9478a
    created by runtime.createfing
    /home/zosgo/go-build/build-3/src/runtime/mfinal.go:157 +0x64
    
    go build failed
    bash-4.3$ cat install_test.sh
    #!/bin/sh
    #
    # Licensed Materials - Property of IBM
    # IBM Open Enterprise SDK for Go, V1.19
    # 5655-GOZ
    # Copyright IBM Corp. 2022.
    # US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
    #
    me=`/bin/ps -o pid,args= | /bin/awk '$1 == "'$$'" {print $2}'`
    if [ "$me" = "bash" ]; then
    true
    else
    bsh=$(type bash 2>/dev/null)
    if [ $? -ne 0 ]; then
    echo bash is not found on PATH.
    exit 1
    else
    exec bash $0 "$@"
    fi
    fi
    #--------------
    # bash
    #--------------
    declare -a args
    testmode=0
    while [[ $# -gt 0 ]]; do
    case "$1" in
    -t) ;&
    --test)
    testmode=1
    shift
    ;;
    *)
    args+=("$1")
    shift
    ;;
    esac
    done
    
    set -- "${args[@]}"
    
    die() {
    echo $@
    exit 1
    }
    trap "[[ -r hello_$$ ]] && rm hello_$$; [[ -r hello_$$.go ]] && rm hello_$$.go" INT TERM EXIT
    
    envsetupfile="$(dirname $0)/etc/envsetup"
    if ! [[ -r "$envsetupfile" ]]; then
    die $envsetupfile not found
    fi
    
    if [[ $testmode -eq 1 ]]; then
    source "$envsetupfile"
    
    if [[ $? -ne 0 ]]; then
    die $envsetupfile setup failed
    fi
    fi
    TMPD=/tmp
    if [[ -d "${TMPDIR}" ]] && [[ -w "${TMPDIR}" ]]; then
    TMPD="${TMPDIR}"
    fi
    cd $TMPD || die "Cannot change to $TMPD"
    
    
    b=$(echo 1 | /bin/od -x -N2 -An | /bin/tr -cd "0-9A-F")
    
    if [[ "$b" == "310A" ]]; then
    cmd="/bin/cat"
    else
    cmd="/bin/iconv -f 1047 -t 819"
    fi
    
    $cmd >hello_$$.go <<"END"
    package main
    
    import "fmt"
    
    func main() {
    fmt.Println("\n\nHello World!\n")
    }
    END
    chtag -tc 819 hello_$$.go
    tgo=$(type go 2>/dev/null)
    if [ $? -ne 0 ]; then
    echo go is not found on PATH. Environment not setup.
    exit 1
    fi
    go version
    go build hello_$$.go || die "go build failed"
    ./hello_$$ || die "program failed"


    ------------------------------
    NAGARAJ SESHAGIRI PUDUKOTAI
    ------------------------------


  • 2.  RE: install_test.sh fails

    Posted Fri December 09, 2022 09:33 AM
    I'm sorry you are having problems. Can you tell us the machine model you are running on and also the results of executing "ulimit -a" ? Thanks.

    ------------------------------
    Bill O'Farrell
    Team Lead, Go on z/OS
    ------------------------------



  • 3.  RE: install_test.sh fails

    Posted Fri December 09, 2022 09:44 AM
    Hi Bill
    The output of ulimit -a is:-
    bash-4.3$ ulimit -a
    core file         8192b
    cpu time          unlimited
    data size         unlimited
    file size         unlimited
    stack size        unlimited
    file descriptors  64000
    address space     524288k
    memory above bar  2048m​
    The machine model I am running this on is 8561-778 (z15) with 12 zIIPs

    ------------------------------
    NAGARAJ SESHAGIRI PUDUKOTAI
    ------------------------------



  • 4.  RE: install_test.sh fails

    Posted Mon December 12, 2022 09:30 AM
    Go does not run on zIIPs, but I suspect the problem might be "memory above bar" being 2G.
    According to your output, the PSW was pointing at storage above 2G. Currently no Go code is loaded above 2G. A wild branch might have happened.

    I am not able to test "memory above bar" being 2G, I wonder if you can create a test ID to try with the following.
    core file 8192b
    cpu time unlimited
    data size unlimited
    file size 17179869176b
    stack size unlimited
    file descriptors 64000
    address space unlimited
    memory above bar 6144m

    ------------------------------
    Cw Cheung
    ------------------------------