AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
  • 1.  Google Go 1.23.3 coredump in the net module

    Posted Tue February 11, 2025 03:52 AM

    Hi,

    the "working" code:

    package main
    
    import (
      "fmt"
    )
    
    func main() {
      fmt.Println("Hello world")
    }

    Compile (go build), run, and everything works perfectly.

    Adding net module to the code, produces core dump:

    package main
    
    import (
      "fmt"
    
      _ "net"
    )
    
    func main() {
      fmt.Println("Hello world")
    }

    Memory fault(coredump)

    AIX 7.3 TL3 SP0, Power10

    If I compile the same code on Linux with GOOS=aix GOARCH=ppc64 and then copy it to AIX, it works without problems.



    ------------------------------
    Andrey Klyachkin

    https://www.power-devops.com
    ------------------------------


  • 2.  RE: Google Go 1.23.3 coredump in the net module

    Posted Mon March 31, 2025 05:52 PM

    One month later, another debugging session. The problem is not in the "net" module, but in cgo AIX code. That's why the previous example worked if it was cross-compiled on Linux.

    package main
    
    /*
    #include <netdb.h>
    */
    import "C"
    
    import "fmt"
    
    package main() {
      fmt.Println(C.AI_ALL)
    }

    The problem is still there in all Go versions, including the latest 1.24.1. It doesn't matter which CPU architecture (P8, P9, P10) or GCC (10, 12) is used.

    The only difference is that the message changed to "illegal instruction" in 1.24.



    ------------------------------
    Andrey Klyachkin

    https://www.power-devops.com
    ------------------------------



  • 3.  RE: Google Go 1.23.3 coredump in the net module

    Posted Tue April 01, 2025 01:07 AM

    Thanks @Andrey Klyachkin for reporting this. We will check on this. 



    ------------------------------
    Ayappan P
    ------------------------------



  • 4.  RE: Google Go 1.23.3 coredump in the net module

    Posted Tue April 01, 2025 04:01 PM

    Thank you Ayappan! 

    I did one more test today.

    I deployed AIX 7.2 TL5 SP5 and installed Google Go 1.23.3 from the Toolbox. It compiled the code without any problems, and it can be executed on both AIX 7.2 and 7.3.

    I updated AIX consequently to AIX 7.2 TL5 SP9, AIX 7.3 TL0 SP1, AIX 7.3 TL1 SP1, AIX 7.3 TL2 SP1, AIX 7.3 TL2 SP2, AIX 7.3 TL2 SP3, and AIX 7.3 TL3 SP0. After each update, I compiled the code and executed it. It worked well till the last update. After the update to AIX 7.3 TL3 SP0, the fresh compiled code doesn't work anymore. 

    My conclusion is that the problem exists only on AIX 7.3 TL3. 



    ------------------------------
    Andrey Klyachkin

    https://www.power-devops.com
    ------------------------------



  • 5.  RE: Google Go 1.23.3 coredump in the net module

    Posted Tue April 01, 2025 05:26 PM

    To make it complete, I tested each Golang version from https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc-7.3/golang/ on AIX 7.3 TL3 and every version failed. 



    ------------------------------
    Andrey Klyachkin

    https://www.power-devops.com
    ------------------------------



  • 6.  RE: Google Go 1.23.3 coredump in the net module

    Posted Wed April 02, 2025 12:27 AM

    Thanks for isolating the problem to AIX 7.3 TL3. We will check on this. 



    ------------------------------
    Ayappan P
    ------------------------------



  • 7.  RE: Google Go 1.23.3 coredump in the net module

    Posted 16 days ago

    This is caused because of some linker changes that went in AIX 7.3 TL3. It affects code compiled using gcc/g++ compiler with "-mcmodel=large" option (cgo compilation uses it). 
    As a workaround, one can pass the linker flag "-Wl,-blgloadtoadd:-normal:-tls" to avoid this issue. 
    The issue is being fixed now and a fix will be available soon for the AIX linker/binder. 



    ------------------------------
    Ayappan P
    ------------------------------