Giter Club home page Giter Club logo

cgosymbolizer-test-app's Introduction

Understanding CGOSymbolizer

Results

goroutine 1 [syscall]:
crash_now
        /home/lima.linux/dev/cgosymbolizertest/crash.c:6 pc=0x481b88
runtime.cgocall(0x481b50, 0x4000057ee8)
        /usr/lib/go-1.19/src/runtime/cgocall.go:158 +0x54 fp=0x4000057eb0 sp=0x4000057e70 pc=0x404ca4
main._Cfunc_entryPoint()
        _cgo_gotypes.go:41 +0x34 fp=0x4000057ee0 sp=0x4000057eb0 pc=0x481a04
main.crash()
        /home/lima.linux/dev/cgosymbolizertest/crash.go:16 +0x1c fp=0x4000057ef0 sp=0x4000057ee0 pc=0x481a5c
main.main()
        /home/lima.linux/dev/cgosymbolizertest/crash.go:21 +0x64 fp=0x4000057f70 sp=0x4000057ef0 pc=0x481ae4
runtime.main()
        /usr/lib/go-1.19/src/runtime/proc.go:250 +0x254 fp=0x4000057fd0 sp=0x4000057f70 pc=0x435534
runtime.goexit()
        /usr/lib/go-1.19/src/runtime/asm_arm64.s:1172 +0x4 fp=0x4000057fd0 sp=0x4000057fd0 pc=0x45e894

This has one frame from C code, the actual function that crashes, crash_now.

Compared to GDB, this is not the full stack, there are some frames missing:

(gdb) bt
#0  0x0000000000481b88 in crash_now () at crash.c:6
#1  0x0000000000481bc4 in indirectionTwo (a=<optimized out>) at crash.c:15
#2  0x0000000000481bfc in indirectionOne (a=a@entry=44) at crash.c:23
#3  0x0000000000481c14 in entryPoint () at crash.c:27
#4  0x0000000000481b5c in _cgo_9bd6286f89e4_Cfunc_entryPoint (v=<optimized out>) at /tmp/go-build/cgo-gcc-prolog:49
#5  0x000000000045e6bc in runtime.asmcgocall () at /usr/lib/go-1.19/src/runtime/asm_arm64.s:973
#6  0x00000040000021a0 in ?? ()

Run Locally

./run.sh

Tested with go version go1.19.4 linux/arm64 on Ubuntu 22.04.1 LTS (Jammy Jellyfish)

Run in Docker

$ docker build . -t cgosymbolizertest
$ docker run --rm cgosymbolizertest

On linux arm64 I see no difference in the output.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.