Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用官方镜像编译wasm时报错runtime/cgo: pthread_create failed: Operation not permitted #1384

Closed
elvenlegolas opened this issue Oct 11, 2024 · 2 comments

Comments

@elvenlegolas
Copy link

elvenlegolas commented Oct 11, 2024

If you are reporting any crash or any potential security issue, do not
open an issue in this repo. Please report the issue via ASRC(Alibaba Security Response Center) where the issue will be triaged appropriately.

  • [√ ] I have searched the issues of this repository and believe that this is not a duplicate.

Ⅰ. Issue Description

如题
我的build命令:
docker build --build-arg BUILDER=${harbor地址}/wasm-go-builder:go1.20.14-tinygo0.29.0-oras1.0.0 --build-arg GOPROXY=${代理} --build-arg EXTRA_TAGS=proxy_wasm_version_0_2_100 -t ${harbor地址}/rediswasm:v1.0 .

Ⅱ. Describe what happened

执行build后报错

runtime/cgo: pthread_create failed: Operation not permitted
SIGABRT: abort
PC=0x7fec49a5fb1c m=0 sigcode=18446744073709551610

goroutine 0 [idle]:
runtime: g 0: unknown pc 0x7fec49a5fb1c
The command '/bin/sh -c go mod tidy' returned a non-zero code: 2

If there is an exception, please attach the exception trace:

stack: frame={sp:0x7ffcc01f2110, fp:0x0} stack=[0x7ffcbf9f35b0,0x7ffcc01f25c0)
0x00007ffcc01f2010:  0x0000000000e9c68c  0x0000000000000000
0x00007ffcc01f2020:  0x0000000000a464c4  0x0000000000000006
0x00007ffcc01f2030:  0x0000000000e9c68a  0x0000000000000000
0x00007ffcc01f2040:  0x0000000000a455b7  0x0000000000000004
0x00007ffcc01f2050:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f2060:  0x000000000000002e  0x00007ffcc01f2170
0x00007ffcc01f2070:  0x00007ffcc01f20c0  0x00007fec49a54bca
0x00007ffcc01f2080:  0x0000000000000000  0x000000000000002e
0x00007ffcc01f2090:  0x0000000000000000  0x00007ffcc01f2140
0x00007ffcc01f20a0:  0x000000000000002e  0x00007fec49bc3030
0x00007ffcc01f20b0:  0x00007ffcc01f2140  0x00007fec49bc54e0
0x00007ffcc01f20c0:  0x0000000000000002  0x0000000000000000
0x00007ffcc01f20d0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f20e0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f20f0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f2100:  0x0000000000000000  0x00007fec49a5fb0e
0x00007ffcc01f2110: <0x0000000000000000  0x652025300f3e6000
0x00007ffcc01f2120:  0x0000000000000000  0x0000000000000006
0x00007ffcc01f2130:  0x00007fec499be740  0x00007ffcc01f2400
0x00007ffcc01f2140:  0x0000000000e6c140  0x0000000000000001
0x00007ffcc01f2150:  0x00007ffcc01f2170  0x00007fec49a0626e
0x00007ffcc01f2160:  0x0000000000000000  0x00007fec49bc5b50
0x00007ffcc01f2170:  0x00007ffcc01f2230  0x00007fec499e98ff
0x00007ffcc01f2180:  0x0000000000000020  0x0000000000000000
0x00007ffcc01f2190:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f21a0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f21b0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f21c0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f21d0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f21e0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f21f0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f2200:  0x0000000100000000  0x00007fec49bc56a0
runtime: g 0: unknown pc 0x7fec49a5fb1c
stack: frame={sp:0x7ffcc01f2110, fp:0x0} stack=[0x7ffcbf9f35b0,0x7ffcc01f25c0)
0x00007ffcc01f2010:  0x0000000000e9c68c  0x0000000000000000
0x00007ffcc01f2020:  0x0000000000a464c4  0x0000000000000006
0x00007ffcc01f2030:  0x0000000000e9c68a  0x0000000000000000
0x00007ffcc01f2040:  0x0000000000a455b7  0x0000000000000004
0x00007ffcc01f2050:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f2060:  0x000000000000002e  0x00007ffcc01f2170
0x00007ffcc01f2070:  0x00007ffcc01f20c0  0x00007fec49a54bca
0x00007ffcc01f2080:  0x0000000000000000  0x000000000000002e
0x00007ffcc01f2090:  0x0000000000000000  0x00007ffcc01f2140
0x00007ffcc01f20a0:  0x000000000000002e  0x00007fec49bc3030
0x00007ffcc01f20b0:  0x00007ffcc01f2140  0x00007fec49bc54e0
0x00007ffcc01f20c0:  0x0000000000000002  0x0000000000000000
0x00007ffcc01f20d0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f20e0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f20f0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f2100:  0x0000000000000000  0x00007fec49a5fb0e
0x00007ffcc01f2110: <0x0000000000000000  0x652025300f3e6000
0x00007ffcc01f2120:  0x0000000000000000  0x0000000000000006
0x00007ffcc01f2130:  0x00007fec499be740  0x00007ffcc01f2400
0x00007ffcc01f2140:  0x0000000000e6c140  0x0000000000000001
0x00007ffcc01f2150:  0x00007ffcc01f2170  0x00007fec49a0626e
0x00007ffcc01f2160:  0x0000000000000000  0x00007fec49bc5b50
0x00007ffcc01f2170:  0x00007ffcc01f2230  0x00007fec499e98ff
0x00007ffcc01f2180:  0x0000000000000020  0x0000000000000000
0x00007ffcc01f2190:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f21a0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f21b0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f21c0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f21d0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f21e0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f21f0:  0x0000000000000000  0x0000000000000000
0x00007ffcc01f2200:  0x0000000100000000  0x00007fec49bc56a0

goroutine 1 [running]:
runtime.systemstack_switch()
        /usr/local/go/src/runtime/asm_amd64.s:463 fp=0xc000046780 sp=0xc000046778 pc=0x467320
runtime.main()
        /usr/local/go/src/runtime/proc.go:170 +0x6d fp=0xc0000467e0 sp=0xc000046780 pc=0x43942d
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000467e8 sp=0xc0000467e0 pc=0x469541

rax    0x0
rbx    0x6
rcx    0xffffffffffffffff
rdx    0x6
rdi    0x6
rsi    0x6
rbp    0x7ffcc01f2150
rsp    0x7ffcc01f2110
r8     0x0
r9     0x0
r10    0x8
r11    0x246
r12    0x6
r13    0x7ffcc01f2400
r14    0x16
r15    0x1
rip    0x7fec49a5fb1c
rflags 0x246
cs     0x33
fs     0x0
gs     0x0

Ⅲ. Describe what you expected to happen

麻烦帮忙看下问题原因,提供解决思路或方法

Ⅳ. How to reproduce it (as minimally and precisely as possible)

Ⅴ. Anything else we need to know?

我的dockerfile为

ARG BUILDER=higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/wasm-go-builder:go1.19-tinygo0.28.1-oras1.0.0
FROM $BUILDER as builder

ARG GOPROXY
ENV GOPROXY=${GOPROXY}

ARG EXTRA_TAGS=""
ENV EXTRA_TAGS=${EXTRA_TAGS}

WORKDIR /workspace
COPY . .
RUN go mod tidy
RUN tinygo build -o /main.wasm -scheduler=none -gc=custom -tags="custommalloc nottinygc_finalizer $EXTRA_TAGS" -target=wasi ./main.go

FROM scratch as output
COPY --from=builder /main.wasm plugin.wasm

Ⅵ. Environment:

  • Higress version: 无
  • OS :Red Hat Enterprise Linux Server 7.6 (Maipo)
  • Kernal: Linux 3.10.0-957.el7.x86_64
  • Others:
@CH3CHO
Copy link
Collaborator

CH3CHO commented Oct 11, 2024

看一下这个:docker-library/golang#467

@elvenlegolas
Copy link
Author

看一下这个:docker-library/golang#467

如大佬所说,是这个issue里的问题,docker20以下的版本可能会导致这个问题,我原有的docker版本为19.03.9,升级为24.0.7后该问题解决。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants