Skip to content

运行几次后总会随机出现错误:out of bounds memory access #3846

@kamylee

Description

@kamylee

我在wasm中使用了thread,运行几次后总会随机出现错误:out of bounds memory access
我在wasm app中创建了一个线程A用来做http server. 另外又创建了一个线程B pthread_create,用来与外部的websocket服务器通信,线程A一直运行稳定,最近加了线程B后总是随机出现out of bounds memory access的错误。
线程B中用到了native本地提供的api,里面用到了WebSocket,
线程B中用到了jsoncpp库,用来解析Json数据,

运行环境:windows
总是在正常接收几次数据后随机出现:out of bounds memory access的错误,这是wasi线程的问题吗?
频繁调用wasm_runtime_module_malloc wasm_runtime_module_free 就容易出错

CALL_STACK:
#00: 0xd48a7bf4 - $f3908
#1: 0x0007 - free
#2: 0x0036 - $f3898
#3: 0x0036 - $f274
#4: 0x003f - $f272
#5: 0x00cd - $f269
#6: 0x0064 - $f1068
#7: 0x005e - $f1064
#8: 0x0113 - $f1059
#9: 0x0045 - $f851
#10: 0x0038 - $f780
#11: 0x0151 - $f778
#12: 0x0036 - $f777
#13: 0x004d - $f839
#14: 0x0038 - $f1070
#15: 0x0036 - $f1067
#16: 0x003f - $f1063
#17: 0x00f2 - $f1059
#18: 0x008e - $f1059
#19: 0x008e - $f1059
#20: 0x008e - $f1059
#21: 0x0045 - $f851
#22: 0x0038 - $f780
#23: 0x0151 - $f778
#24: 0x0036 - $f777
#25: 0x0a9a - $f1986
#26: 0x08f5 - $f1977
#27: 0x6785 - $f1971
#28: 0x372c - $f1840
#29: 0x0625 - $f1827
#30: 0x1fd0 - $f1826
#31: 0x589d - $f1825
#32: 0x009e - $f1305

#00: 0xfff5a4de - free

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions