Skip to content

Segfault in amqscb #75

@joy4eg

Description

@joy4eg

Hey Folks,

Here is the environment information:

$ go version
go version go1.11.4 linux/amd64
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/userx/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/userx/work/golang"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/golang"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/userx/work/golang/src/github.com/<cut>/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build420169263=/tmp/go-build -gno-record-gcc-switches"
$ gcc --version
gcc (GCC) 8.2.1 20181215 (Red Hat 8.2.1-6)
$ dspmqver
Name:        IBM MQ
Version:     9.1.0.1
Level:       p910-001-181108
BuildType:   IKAP - (Production)
Platform:    IBM MQ for Linux (x86-64 platform)
Mode:        64-bit
O/S:         Linux 4.19.14-300.fc29.x86_64
InstName:    Installation1
InstDesc:    
Primary:     No
InstPath:    /opt/mqm
DataPath:    /var/mqm
MaxCmdLevel: 910

The issue:

  • Build amqscb from master
  • Run

Expected result:

  • Consume some messages from given queue

Actual result:

  • Segfault

Logs:

Sample AMQSCB.GO start
Connected to queue manager QM1
Opened queue DEV.QUEUE.1
signal 11 received but handler not on signal stack
fatal error: non-Go code set up signal handler without SA_ONSTACK flag

runtime stack:
runtime: unexpected return pc for runtime.sigtramp called from 0x7f13cf1aae67
stack: frame={sp:0xc00004e4a8, fp:0xc00004e500} stack=[0xc0000463f8,0xc00004e7f8)
000000c00004e3a8:  000000c00004e3b0  00000000004550d0 <runtime.throw.func1+0> 
000000c00004e3b8:  00000000004e906f  0000000000000039 
000000c00004e3c8:  000000c00004e3e8  000000000044113f <runtime.sigNotOnStack+127> 
000000c00004e3d8:  00000000004e906f  0000000000000039 
000000c00004e3e8:  000000c00004e498  0000000000440974 <runtime.sigtrampgo+788> 
000000c00004e3f8:  000000000000000b  000000c00004e480 
000000c00004e408:  000000c00004e700  0000000000000000 
000000c00004e418:  0000000000000000  000000c00004e4a8 
000000c00004e428:  0000000000000000  0000000000000000 
000000c00004e438:  0000000000000000  0000000000000000 
000000c00004e448:  0000000000000000  000000c000000780 
000000c00004e458:  0000000000000000  0000000000000000 
000000c00004e468:  0000000000000000  0000000000000000 
000000c00004e478:  0000000000000000  000000c000042000 
000000c00004e488:  0000000000000000  0000000000008000 
000000c00004e498:  000000c00004e4f0  000000000045a023 <runtime.sigtramp+67> 
000000c00004e4a8: <000000000000000b  000000c00004e830 
000000c00004e4b8:  000000c00004e700  000000c00004e700 
000000c00004e4c8:  000000c00004e830  0000000000000001 
000000c00004e4d8:  000000000000000b  000000c00004e4f0 
000000c00004e4e8:  00007f13cfb313c0  0000000000f39e20 
000000c00004e4f8: !00007f13cf1aae67 >0000000000000000 
000000c00004e508:  0000000000000000  0000000000000000 
000000c00004e518:  0000000000000000  0000000000000000 
000000c00004e528:  0000000000000000  0000000000000000 
000000c00004e538:  0000000000000000  0000000000000000 
000000c00004e548:  0000000000000000  0000000000000000 
000000c00004e558:  0000000000000000  0000000000000000 
000000c00004e568:  0000000000000000  0000000000000000 
000000c00004e578:  0000000000000000  0000000000000000 
000000c00004e588:  0000000000000000  0000000000000000 
000000c00004e598:  0000000000f39e20  000000c00004edd0 
000000c00004e5a8:  0000000000000008  0000000000000011 
000000c00004e5b8:  00000000004f5654  0000000000000000 
000000c00004e5c8:  00007f13cf1ab665  0000000041534d58 
000000c00004e5d8:  000000000000000b  0000000000000000 
000000c00004e5e8:  0000000000000000  000000c00004e690 
000000c00004e5f8:  0000000000000000 
runtime.throw(0x4e906f, 0x39)
        /usr/lib/golang/src/runtime/panic.go:608 +0x72
runtime.sigNotOnStack(0xb)
        /usr/lib/golang/src/runtime/signal_unix.go:576 +0x7f
runtime.sigtrampgo(0xb, 0xc00004e830, 0xc00004e700)
        /usr/lib/golang/src/runtime/signal_unix.go:334 +0x314
runtime: unexpected return pc for runtime.sigtramp called from 0x7f13cf1aae67
stack: frame={sp:0xc00004e4a8, fp:0xc00004e500} stack=[0xc0000463f8,0xc00004e7f8)
000000c00004e3a8:  000000c00004e3b0  00000000004550d0 <runtime.throw.func1+0> 
000000c00004e3b8:  00000000004e906f  0000000000000039 
000000c00004e3c8:  000000c00004e3e8  000000000044113f <runtime.sigNotOnStack+127> 
000000c00004e3d8:  00000000004e906f  0000000000000039 
000000c00004e3e8:  000000c00004e498  0000000000440974 <runtime.sigtrampgo+788> 
000000c00004e3f8:  000000000000000b  000000c00004e480 
000000c00004e408:  000000c00004e700  0000000000000000 
000000c00004e418:  0000000000000000  000000c00004e4a8 
000000c00004e428:  0000000000000000  0000000000000000 
000000c00004e438:  0000000000000000  0000000000000000 
000000c00004e448:  0000000000000000  000000c000000780 
000000c00004e458:  0000000000000000  0000000000000000 
000000c00004e468:  0000000000000000  0000000000000000 
000000c00004e478:  0000000000000000  000000c000042000 
000000c00004e488:  0000000000000000  0000000000008000 
000000c00004e498:  000000c00004e4f0  000000000045a023 <runtime.sigtramp+67> 
000000c00004e4a8: <000000000000000b  000000c00004e830 
000000c00004e4b8:  000000c00004e700  000000c00004e700 
000000c00004e4c8:  000000c00004e830  0000000000000001 
000000c00004e4d8:  000000000000000b  000000c00004e4f0 
000000c00004e4e8:  00007f13cfb313c0  0000000000f39e20 
000000c00004e4f8: !00007f13cf1aae67 >0000000000000000 
000000c00004e508:  0000000000000000  0000000000000000 
000000c00004e518:  0000000000000000  0000000000000000 
000000c00004e528:  0000000000000000  0000000000000000 
000000c00004e538:  0000000000000000  0000000000000000 
000000c00004e548:  0000000000000000  0000000000000000 
000000c00004e558:  0000000000000000  0000000000000000 
000000c00004e568:  0000000000000000  0000000000000000 
000000c00004e578:  0000000000000000  0000000000000000 
000000c00004e588:  0000000000000000  0000000000000000 
000000c00004e598:  0000000000f39e20  000000c00004edd0 
000000c00004e5a8:  0000000000000008  0000000000000011 
000000c00004e5b8:  00000000004f5654  0000000000000000 
000000c00004e5c8:  00007f13cf1ab665  0000000041534d58 
000000c00004e5d8:  000000000000000b  0000000000000000 
000000c00004e5e8:  0000000000000000  000000c00004e690 
000000c00004e5f8:  0000000000000000 
runtime.sigtramp(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /usr/lib/golang/src/runtime/sys_linux_amd64.s:353 +0x43

goroutine 34 [syscall, locked to thread]:
runtime.goexit()
        /usr/lib/golang/src/runtime/asm_amd64.s:1333 +0x1 fp=0xc0000cefe8 sp=0xc0000cefe0 pc=0x458441

goroutine 1 [sleep]:
fatal error: unexpected signal during runtime execution
panic during panic
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x44d78b]

runtime stack:
runtime: unexpected return pc for runtime.sigtramp called from 0x7f13cf1aae67
stack: frame={sp:0xc00004e4a8, fp:0xc00004e500} stack=[0xc0000463f8,0xc00004e7f8)
000000c00004e3a8:  000000c00004e3b0  00000000004550d0 <runtime.throw.func1+0> 
000000c00004e3b8:  00000000004e906f  0000000000000039 
000000c00004e3c8:  000000c00004e3e8  000000000044113f <runtime.sigNotOnStack+127> 
000000c00004e3d8:  00000000004e906f  0000000000000039 
000000c00004e3e8:  000000c00004e498  0000000000440974 <runtime.sigtrampgo+788> 
000000c00004e3f8:  000000000000000b  000000c00004e480 
000000c00004e408:  000000c00004e700  0000000000000000 
000000c00004e418:  0000000000000000  000000c00004e4a8 
000000c00004e428:  0000000000000000  0000000000000000 
000000c00004e438:  0000000000000000  0000000000000000 
000000c00004e448:  0000000000000000  000000c000000780 
000000c00004e458:  0000000000000000  0000000000000000 
000000c00004e468:  0000000000000000  0000000000000000 
000000c00004e478:  0000000000000000  000000c000042000 
000000c00004e488:  0000000000000000  0000000000008000 
000000c00004e498:  000000c00004e4f0  000000000045a023 <runtime.sigtramp+67> 
000000c00004e4a8: <000000000000000b  000000c00004e830 
000000c00004e4b8:  000000c00004e700  000000c00004e700 
000000c00004e4c8:  000000c00004e830  0000000000000001 
000000c00004e4d8:  000000000000000b  000000c00004e4f0 
000000c00004e4e8:  00007f13cfb313c0  0000000000f39e20 
000000c00004e4f8: !00007f13cf1aae67 >0000000000000000 
000000c00004e508:  0000000000000000  0000000000000000 
000000c00004e518:  0000000000000000  0000000000000000 
000000c00004e528:  0000000000000000  0000000000000000 
000000c00004e538:  0000000000000000  0000000000000000 
000000c00004e548:  0000000000000000  0000000000000000 
000000c00004e558:  0000000000000000  0000000000000000 
000000c00004e568:  0000000000000000  0000000000000000 
000000c00004e578:  0000000000000000  0000000000000000 
000000c00004e588:  0000000000000000  0000000000000000 
000000c00004e598:  0000000000f39e20  000000c00004edd0 
000000c00004e5a8:  0000000000000008  0000000000000011 
000000c00004e5b8:  00000000004f5654  0000000000000000 
000000c00004e5c8:  00007f13cf1ab665  0000000041534d58 
000000c00004e5d8:  000000000000000b  0000000000000000 
000000c00004e5e8:  0000000000000000  000000c00004e690 
000000c00004e5f8:  0000000000000000 
runtime.throw(0x4e831b, 0x2a)
        /usr/lib/golang/src/runtime/panic.go:608 +0x72
runtime.sigpanic()
        /usr/lib/golang/src/runtime/signal_unix.go:374 +0x2f2
runtime.gentraceback(0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0xc000000300, 0x0, 0x0, 0x64, 0x0, 0x0, 0x0, ...)
        /usr/lib/golang/src/runtime/traceback.go:249 +0x155b
runtime.traceback1(0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0xc000000300, 0x0)
        /usr/lib/golang/src/runtime/traceback.go:728 +0xf3
runtime.traceback(0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0xc000000300)
        /usr/lib/golang/src/runtime/traceback.go:682 +0x52
runtime.tracebackothers(0xc0000be180)
        /usr/lib/golang/src/runtime/traceback.go:947 +0x187
runtime.dopanic_m(0xc0000be180, 0x42de02, 0xc00004e3a8, 0x1)
        /usr/lib/golang/src/runtime/panic.go:805 +0x2aa
runtime.fatalthrow.func1()
        /usr/lib/golang/src/runtime/panic.go:663 +0x5f
runtime.fatalthrow()
        /usr/lib/golang/src/runtime/panic.go:660 +0x57
runtime.throw(0x4e906f, 0x39)
        /usr/lib/golang/src/runtime/panic.go:608 +0x72
runtime.sigNotOnStack(0xb)
        /usr/lib/golang/src/runtime/signal_unix.go:576 +0x7f
runtime.sigtrampgo(0xb, 0xc00004e830, 0xc00004e700)
        /usr/lib/golang/src/runtime/signal_unix.go:334 +0x314
runtime: unexpected return pc for runtime.sigtramp called from 0x7f13cf1aae67
stack: frame={sp:0xc00004e4a8, fp:0xc00004e500} stack=[0xc0000463f8,0xc00004e7f8)
000000c00004e3a8:  000000c00004e3b0  00000000004550d0 <runtime.throw.func1+0> 
000000c00004e3b8:  00000000004e906f  0000000000000039 
000000c00004e3c8:  000000c00004e3e8  000000000044113f <runtime.sigNotOnStack+127> 
000000c00004e3d8:  00000000004e906f  0000000000000039 
000000c00004e3e8:  000000c00004e498  0000000000440974 <runtime.sigtrampgo+788> 
000000c00004e3f8:  000000000000000b  000000c00004e480 
000000c00004e408:  000000c00004e700  0000000000000000 
000000c00004e418:  0000000000000000  000000c00004e4a8 
000000c00004e428:  0000000000000000  0000000000000000 
000000c00004e438:  0000000000000000  0000000000000000 
000000c00004e448:  0000000000000000  000000c000000780 
000000c00004e458:  0000000000000000  0000000000000000 
000000c00004e468:  0000000000000000  0000000000000000 
000000c00004e478:  0000000000000000  000000c000042000 
000000c00004e488:  0000000000000000  0000000000008000 
000000c00004e498:  000000c00004e4f0  000000000045a023 <runtime.sigtramp+67> 
000000c00004e4a8: <000000000000000b  000000c00004e830 
000000c00004e4b8:  000000c00004e700  000000c00004e700 
000000c00004e4c8:  000000c00004e830  0000000000000001 
000000c00004e4d8:  000000000000000b  000000c00004e4f0 
000000c00004e4e8:  00007f13cfb313c0  0000000000f39e20 
000000c00004e4f8: !00007f13cf1aae67 >0000000000000000 
000000c00004e508:  0000000000000000  0000000000000000 
000000c00004e518:  0000000000000000  0000000000000000 
000000c00004e528:  0000000000000000  0000000000000000 
000000c00004e538:  0000000000000000  0000000000000000 
000000c00004e548:  0000000000000000  0000000000000000 
000000c00004e558:  0000000000000000  0000000000000000 
000000c00004e568:  0000000000000000  0000000000000000 
000000c00004e578:  0000000000000000  0000000000000000 
000000c00004e588:  0000000000000000  0000000000000000 
000000c00004e598:  0000000000f39e20  000000c00004edd0 
000000c00004e5a8:  0000000000000008  0000000000000011 
000000c00004e5b8:  00000000004f5654  0000000000000000 
000000c00004e5c8:  00007f13cf1ab665  0000000041534d58 
000000c00004e5d8:  000000000000000b  0000000000000000 
000000c00004e5e8:  0000000000000000  000000c00004e690 
000000c00004e5f8:  0000000000000000 
runtime.sigtramp(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /usr/lib/golang/src/runtime/sys_linux_amd64.s:353 +0x43

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions