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
Expand all | Collapse all

go build fails

  • 1.  go build fails

    Posted Tue November 08, 2022 09:14 AM
    Hi,

    Build fails with the following:

    bash-4.3$ go build test.go
    fatal error: unexpected signal during runtime execution
    [signal SIGSEGV: segmentation violation code=0x35 addr=0x960 pc=0x960]

    goroutine 1 [running]:
    runtime.throw({0x291a40a0, 0x2a})
    /home/zosgo/go-build/build-2/src/runtime/panic_zos.go:1003 +0x76 fp=0xc0004cacd0 sp=0xc0004caca8 pc=0x28b5854e
    runtime.sigpanic()
    /home/zosgo/go-build/build-2/src/runtime/sigpanic_zos.go:31 +0x296 fp=0xc0004cad00 sp=0xc0004cacd0 pc=0x28b73dce
    internal/bpx.bpxcall({0xc0004cadc0, 0x6, 0x6}, 0x1f8)
    /home/zosgo/go-build/build-2/src/internal/bpx/bpxsvc_zos.s:31 +0x33 fp=0xc0004cad08 sp=0xc0004cad08 pc=0x28b9501b
    bash-4.3$ cat test.go
    package main
    import "fmt"
    func main(){
    fmt.Println("Dette er en test.")
    }
    bash-4.3$ go version
    go version go1.18.6 zos/s390x
    bash-4.3$ /bin/strings $(type -p go) | /bin/awk '/License/{ for(i=0;i<7;i++) {print;getline}}'
    Licensed Materials - Property of IBM
    IBM Open Enterprise SDK for Go, V1.18
    5655-GOZ
    Copyright IBM Corp. 2021, 2022.
    US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

    BUILT-DATE: 20220929, VERSION: c288b8e011

    ------------------------------
    Njål Sletten
    ------------------------------


  • 2.  RE: go build fails

    Posted Wed November 09, 2022 09:32 AM

    Hello,

    Have you run envsetup?

    Also what version of the OS do you have?



    ------------------------------
    Hyder Naqvi
    ------------------------------



  • 3.  RE: go build fails

    Posted Thu November 10, 2022 07:54 AM
    Hi,

    yes I've added envsetup to .bashrc.

    We're at z/os 2.4

    /Njaal

    ------------------------------
    Njål Sletten
    ------------------------------



  • 4.  RE: go build fails

    Posted Mon November 14, 2022 12:43 PM

    Hi, 

    That may be the source of the error. Simply adding envsetup to .bashrc is unlikely to achieve the desired result. 

    It's key to "source" envsetup - i.e. either . envsetup or source envsetup

    Please let me know if that works. 



    ------------------------------
    Hyder Naqvi
    ------------------------------



  • 5.  RE: go build fails

    Posted Tue November 15, 2022 01:49 AM
    Hi,

    Sorry, I was a bit unclear about that, I've "configured the COMPILER_PATH environment variable and source the envsetup script in your .bash" as explained in Installing and configuring the PAX edition (Installing and configuring the PAX edition - IBM Documentation)




    ------------------------------
    Njål Sletten
    ------------------------------



  • 6.  RE: go build fails

    Posted Tue November 15, 2022 10:15 AM
    Edited by Hyder Naqvi Tue November 15, 2022 02:04 PM

    Hello, 

    Which PAX files did you use for installation? Perhaps there was an issue during installation.

    edit:
    there's an installation test script that you can try. Please try the following:

    ....installpath/go/install_test.sh



    ------------------------------
    Hyder Naqvi
    ------------------------------



  • 7.  RE: go build fails

    Posted Wed November 16, 2022 02:30 PM
    Edited by Bill O'Farrell Wed November 16, 2022 02:32 PM
    Hi. Any luck as yet?



  • 8.  RE: go build fails

    Posted Thu November 17, 2022 03:59 AM
    Hi,

    I used HAMF1H0.nonsmpe.pax.Z

    upload to /tmp/oego118, then

    cd ~/oego118
    pax -p p -r -f /tmp/oego118/HAMF1H0.nonsmpe.pax.Z

    Did not see any "issues".

    bash-4.3$ oego118/usr/lpp/IBM/cvg/v1r18/go/install_test.sh
    go version go1.18.6 zos/s390x
    fatal error: unexpected signal during runtime execution
    [signal SIGSEGV: segmentation violation code=0x35 addr=0x960 pc=0x960]

    goroutine 1 [running]:
    runtime.throw({0x291a40a0, 0x2a})
    /home/zosgo/go-build/build-2/src/runtime/panic_zos.go:1003 +0x76 fp=0xc0004cacd0 sp=0xc0004caca8 pc=0x28b5854e
    runtime.sigpanic()
    /home/zosgo/go-build/build-2/src/runtime/sigpanic_zos.go:31 +0x296 fp=0xc0004cad00 sp=0xc0004cacd0 pc=0x28b73dce
    internal/bpx.bpxcall({0xc0004cadc0, 0x6, 0x6}, 0x1f8)
    /home/zosgo/go-build/build-2/src/internal/bpx/bpxsvc_zos.s:31 +0x33 fp=0xc0004cad08 sp=0xc0004cad08 pc=0x28b9501b
    go build failed

    :(


    ------------------------------
    Njål Sletten
    ------------------------------



  • 9.  RE: go build fails

    Posted Tue November 22, 2022 02:41 PM

    Could you please try running:
    *the last line should point to your go installation directory

    #!/bin/env bash
    if [[ -z $TMPDIR ]]; then
        TMP=/tmp
    else
        TMP="${TMPDIR}"
    fi
    F="${TMP}/__$$"
    H=${HOME}
    /bin/sh -c 'set' > "${F}"
    readarray -t a < "${F}"
    unlink "${F}"
    for i in "${a[@]}"
      do
        b=${i%%=*}
        unset $b 2>/dev/null
      done
    unset a
    unset i
    unset F
    export HOME=${H}
    unset H
    export PATH=/bin:/usr/bin
    export _BPXK_AUTOCVT='ON'
    export PS1=#
    
    go/install_test.sh --test


    ------------------------------
    Hyder Naqvi
    ------------------------------



  • 10.  RE: go build fails

    Posted Wed November 23, 2022 03:25 AM
    Hi,

    Not sure what you mean by running, should I put the whole "thing" on one command?

    Tried:

    bash-4.3$ #!/bin/env bash if [[ -z $TMPDIR ]]; then TMP=/tmp else TMP="${TMPDIR}" fi F="${TMP}/__$$" H=${HOME} /bin/sh -c 'set' > "${F}" readarray -t a < "${F}" unlink "${F}" for i in "${a[@]}" do b=${i%%=*} unset $b 2>/dev/null done unset a unset i unset F export HOME=${H} unset H export PATH=/bin:/usr/bin export _BPXK_AUTOCVT='ON' export PS1=# /home/et2247/oego118/usr/lpp/IBM/cvg/v1r18/go/install_test.sh --test

    But got no output.

    ------------------------------
    Njål Sletten
    ------------------------------



  • 11.  RE: go build fails

    Posted Wed November 23, 2022 02:36 PM
    Edited by Hyder Naqvi Wed November 23, 2022 03:53 PM

    Hello,

    the script is a bash script, and should be placed in a file ending in .sh such as filename.sh

    and you can run it using this method

    . filename.sh

    Please let me know what you get. If you're not getting a hello world test at the end of the script, please try running the go build test.go command from your original post after running the bash script.



    ------------------------------
    Hyder Naqvi
    ------------------------------



  • 12.  RE: go build fails

    Posted Fri November 25, 2022 08:01 AM
    same error :(

    fatal error: unexpected signal during runtime execution
    [signal SIGSEGV: segmentation violation code=0x35 addr=0x960 pc=0x960]

    goroutine 1 [running]:
    runtime.throw({0x291a40a0, 0x2a})
    /home/zosgo/go-build/build-2/src/runtime/panic_zos.go:1003 +0x76 fp=0xc001592cd0 sp=0xc001592ca8 pc=0x28b5854e
    runtime.sigpanic()
    /home/zosgo/go-build/build-2/src/runtime/sigpanic_zos.go:31 +0x296 fp=0xc001592d00 sp=0xc001592cd0 pc=0x28b73dce
    internal/bpx.bpxcall({0xc001592dc0, 0x6, 0x6}, 0x1f8)
    /home/zosgo/go-build/build-2/src/internal/bpx/bpxsvc_zos.s:31 +0x33 fp=0xc001592d08 sp=0xc001592d08 pc=0x28b9501b


    ------------------------------
    Njål Sletten
    ------------------------------



  • 13.  RE: go build fails

    Posted Fri November 25, 2022 03:37 PM

    thank you for trying.

    Could you please tell me which IBM z mainframe model you're using? This could be something like z14 or z15



    ------------------------------
    Hyder Naqvi
    ------------------------------



  • 14.  RE: go build fails

    Posted Sun November 27, 2022 04:20 AM
    z14

    ------------------------------
    Njål Sletten
    ------------------------------



  • 15.  RE: go build fails

    Posted Mon November 28, 2022 04:27 PM
    Could you please check your installation process to make sure there aren't any issues there. For example it might be helpful to  unpax the pax file in the test directory and retest

    ------------------------------
    Hyder Naqvi
    ------------------------------



  • 16.  RE: go build fails

    Posted Wed November 30, 2022 06:10 AM
    Have you had any success with retrying the installation?

    ------------------------------
    Hyder Naqvi
    ------------------------------



  • 17.  RE: go build fails

    Posted Wed November 30, 2022 06:59 AM
    No, same result :(

    ------------------------------
    Njål Sletten
    ------------------------------



  • 18.  RE: go build fails

    Posted Thu December 01, 2022 07:29 AM
    Edited by Hyder Naqvi Thu December 01, 2022 09:35 AM
    The next step would be to open a case. You open a case here - https://www.ibm.com/mysupport/s/?language=en_US, so we can safely exchange information for further analysis.  

    Select "Open Enterprise SDK for Go" as a product.


    Edit: included link for opening case

    ------------------------------
    Hyder Naqvi
    ------------------------------



  • 19.  RE: go build fails

    Posted Thu December 01, 2022 10:03 PM
    Could you also please tell me if you're using nfs mounted drives or a real z file system?

    ------------------------------
    Hyder Naqvi
    ------------------------------



  • 20.  RE: go build fails

    Posted Fri December 09, 2022 07:58 AM
    Have you had any success on your end? Please let me know if you're able to determine whether you're using nfs mounted drives or a real z file system

    ------------------------------
    Hyder Naqvi
    ------------------------------