You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 10 (v7l)
BogoMIPS : 6.45
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x2
CPU part : 0xc09
CPU revision : 10
processor : 1
model name : ARMv7 Processor rev 10 (v7l)
BogoMIPS : 6.45
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x2
CPU part : 0xc09
CPU revision : 10
processor : 2
model name : ARMv7 Processor rev 10 (v7l)
BogoMIPS : 6.45
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x2
CPU part : 0xc09
CPU revision : 10
processor : 3
model name : ARMv7 Processor rev 10 (v7l)
BogoMIPS : 6.45
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x2
CPU part : 0xc09
CPU revision : 10
I'm building go application that should be run on CortexA9 CPU and uses 3 different C/C++ shared libraries (I use C wrapper to call C++ code), when calling one of them (Clips rules engine http://www.clipsrules.net/) I accidentally get SIGSEGV, Segmentation fault, the library itself is quite old and well tested, also the same code works well on amd64 arch. The place where error occurs looks quite random, if I rewrite code to avoid the specific code lines, it will occur in the middle of an other function.
How I build lib
I use arm-buildroot-linux-gnueabi toolchain and arm-buildroot-linux-gnueabihf-gcc as C compiler, so is built with this CFLAGS: -Wall -std=c99 -O3 -fno-strict-aliasing -fPIC -march=armv7-a -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard --sysroot=${some path}
If I build Clips as standalone binary (with this toolchain) and run some rules on it, it works well.
How I build golang app
I build app on docker golang:1.16-buster, where my toolchanin is placed
go clean && env CGO_CFLAGS="-march=armv7-a -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9 --sysroot={soem path}" CGO_ENABLED=1 GOOS="linux" GOARM=7 GOARCH=arm go build --tags=with_libs,arm -o ./out/$app_name .
CC is set to arm-buildroot-linux-gnueabihf-gcc
While app is running, when I perform cgo calls from so library I get this (from gdb): Thread 1 "myapp-arm" received signal SIGSEGV, Segmentation fault.
gdb: backtrace:
#0 0x76d6fa6c in PrintTemplateFact (theEnv=0x4c8b90, logicalName=0x76d79184 "FactPPForm", theFact=0x4c6dd8, seperateLines=0, ignoreDefaults=0) at /myapp/clips_source/tmpltutl.c:387
#1 0x76cbfa70 in PrintFact (theEnv=0x4c8b90, logicalName=0x76d79184 "FactPPForm", factPtr=0x4c6dd8, seperateLines=0, ignoreDefaults=0) at /myapp/clips_source/factmngr.c:445
#2 0x76cbf704 in PrintFactWithIdentifier (theEnv=0x4c8b90, logicalName=0x76d79184 "FactPPForm", factPtr=0x4c6dd8) at /myapp/clips_source/factmngr.c:328
#3 0x76cc1950 in EnvGetFactPPForm (theEnv=0x4c8b90, buffer=0x535290 "f--1 (attribute (id ) (comment ) (code ) (path", bufferLength=1023, theFact=0x4c6dd8) at /myapp/clips_source/factmngr.c:1590
#4 0x002661e8 in _cgo_4cadad88d928_Cfunc_EnvGetFactPPForm ()
#5 0x000823d8 in runtime.asmcgocall () at /usr/local/go/src/runtime/asm_arm.s:596
#6 0x00a16050 in ?? ()
What version of Go are you using (
go version
)?On Host machine:
Build with docker: golang:1.16-buster
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?On Host machine:
go env
OutputOn Target machine:
cat /proc/cpuinfo
OutputOn Target machine:
cat /etc/os-release
OutputWhat did you do?
I'm building go application that should be run on CortexA9 CPU and uses 3 different C/C++ shared libraries (I use C wrapper to call C++ code), when calling one of them (Clips rules engine http://www.clipsrules.net/) I accidentally get
SIGSEGV, Segmentation fault
, the library itself is quite old and well tested, also the same code works well on amd64 arch. The place where error occurs looks quite random, if I rewrite code to avoid the specific code lines, it will occur in the middle of an other function.How I build lib
I use
arm-buildroot-linux-gnueabi
toolchain andarm-buildroot-linux-gnueabihf-gcc
as C compiler, so is built with this CFLAGS:-Wall -std=c99 -O3 -fno-strict-aliasing -fPIC -march=armv7-a -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard --sysroot=${some path}
If I build Clips as standalone binary (with this toolchain) and run some rules on it, it works well.
How I build golang app
I build app on docker golang:1.16-buster, where my toolchanin is placed
go clean && env CGO_CFLAGS="-march=armv7-a -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9 --sysroot={soem path}" CGO_ENABLED=1 GOOS="linux" GOARM=7 GOARCH=arm go build --tags=with_libs,arm -o ./out/$app_name .
CC is set to
arm-buildroot-linux-gnueabihf-gcc
To add library to project I have
arm.go
file:What did you expect to see?
I expect to see no unexpected signals.
What did you see instead?
While app is running, when I perform cgo calls from so library I get this (from gdb):
Thread 1 "myapp-arm" received signal SIGSEGV, Segmentation fault.
gdb: backtrace:
On Target machine:
gdb disas
If this helpsThe text was updated successfully, but these errors were encountered: