Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

与protobuf c扩展冲突,报Segmentation fault (core dumped) #439

Closed
liutaot opened this issue Sep 27, 2021 · 9 comments
Closed

与protobuf c扩展冲突,报Segmentation fault (core dumped) #439

liutaot opened this issue Sep 27, 2021 · 9 comments

Comments

@liutaot
Copy link

liutaot commented Sep 27, 2021

core堆栈:

#0  0x00007f2ad74eb7e9 in upb_malloc () from /usr/local/lib/php/extensions/no-debug-non-zts-20200930/skywalking.so
#1  0x00007f2ad74ebc9a in upb_arena_allocblock () from /usr/local/lib/php/extensions/no-debug-non-zts-20200930/skywalking.so
#2  0x00007f2ad74ebd20 in _upb_arena_slowmalloc () from /usr/local/lib/php/extensions/no-debug-non-zts-20200930/skywalking.so
#3  0x00007f2ad5f36174 in upb_arena_malloc (size=32, a=0x7f2ad35fe660) at /tmp/pear/temp/protobuf/php-upb.h:457
#4  decode_readstr (str=0x7f2ad3fba9a0, size=<optimized out>, 
    ptr=0x7f2ad2d9055d "protos/Example/example.proto\022\aexample\"\034\n\fHelloRequest\022\f\n\004name\030\001 \001(\t\"+\n\nHelloReply\022\f\n\004code\030\001 \001(\005\022\017\n\amessage\030\002 \001(\t2@\n\aexample\022\065\n\005hello\022\025.example.HelloRequest\032\023.example.HelloReply\"", d=0x7f2ad35fe610) at /tmp/pear/temp/protobuf/php-upb.c:582
#5  decode_tomsg (op=5, val=0x7f2ad35fe4b0, field=<optimized out>, submsgs=<optimized out>, msg=0x7f2ad3fba998, 
    ptr=0x7f2ad2d9055d "protos/Example/example.proto\022\aexample\"\034\n\fHelloRequest\022\f\n\004name\030\001 \001(\t\"+\n\nHelloReply\022\f\n\004code\030\001 \001(\005\022\017\n\amessage\030\002 \001(\t2@\n\aexample\022\065\n\005hello\022\025.example.HelloRequest\032\023.example.HelloReply\"", d=0x7f2ad35fe610) at /tmp/pear/temp/protobuf/php-upb.c:795
#6  decode_msg (d=d@entry=0x7f2ad35fe610, 
--Type <RET> for more, q to quit, c to continue without paging--
    4code\030\001 \001(\005\022\017\n\amessage\030\002 \001(\t2@\n\aexample\022\065\n\005hello\022\025.example.HelloRequest\032\023.example.HelloReply\"", 
    ptr@entry=0x7f2ad2d9055b "\n\034protos/Example/example.proto\022\aexample\"\034\n\fHelloRequest\022\f\n\004name\030\001 \001(\t\"+\n\nHelloReply\022\f\n\004code\030\001 \001(\005\022\017\n\amessage\030\002 \001(\t2@\n\aexample\022\065\n\005hello\022\025.example.HelloRequest\032\023.example.HelloReply\"", msg=<optimized out>, 
    layout=layout@entry=0x7f2ad5f53030 <google_protobuf_FileDescriptorProto_msginit>) at /tmp/pear/temp/protobuf/php-upb.c:901
#7  0x00007f2ad5f35cb5 in decode_tosubmsg (size=<optimized out>, field=<optimized out>, submsgs=<optimized out>, submsg=<optimized out>, ptr=<optimized out>, d=0x7f2ad35fe610)
    at /tmp/pear/temp/protobuf/php-upb.c:600
#8  decode_toarray (op=<optimized out>, val=0x7f2ad35fe560, field=<optimized out>, submsgs=<optimized out>, msg=0x7f2ad3fba948, ptr=<optimized out>, d=0x7f2ad35fe610)
    at /tmp/pear/temp/protobuf/php-upb.c:677
#9  decode_msg (d=d@entry=0x7f2ad35fe610, ptr=<optimized out>, 
    ptr@entry=0x7f2ad2d90558 "\n\274\001\n\034protos/Example/example.proto\022\aexample\"\034\n\fHelloRequest\022\f\n\004name\030\001 \001(\t\"+\n\nHelloReply\022\f\n\004code\030\001 \001(\005\022\017\n\amessage\030\002 \001(\t2@\n\aexample\022\065\n\005hello\022\025.example.HelloRequest\032\023.example.HelloReply\"", msg=msg@entry=0x7f2ad3fba948, 
    layout=layout@entry=0x7f2ad5f53050 <google_protobuf_FileDescriptorSet_msginit>) at /tmp/pear/temp/protobuf/php-upb.c:895
#10 0x00007f2ad5f363d7 in decode_top (l=0x7f2ad5f53050 <google_protobuf_FileDescriptorSet_msginit>, msg=0x7f2ad3fba948, 
    buf=0x7f2ad2d90558 "\n\274\001\n\034protos/Example/example.proto\022\aexample\"\034\n\fHelloRequest\022\f\n\004name\030\001 \001(\t\"+\n\nHelloReply\022\f\n\004code\030\001 \001(\005\022\017\n\amessage\030\002 \001(\t2@\n\aexample\022\065\n\005hello\022\025.example.HelloRequest\032\023.example.HelloReply\"", d=0x7f2ad35fe610)
    at /tmp/pear/temp/protobuf/php-upb.c:944
#11 _upb_decode (
    buf=buf@entry=0x7f2ad2d90558 "\n\274\001\n\034protos/Example/example.proto\022\aexample\"\034\n\fHelloRequest\022\f\n\004name\030\001 \001(\t\"+\n\nHelloReply\022\f\n\004code\030\001 \001(\005\022\017\n\amessage\030\002 \001(\t2@\n\aexample\022\065\n\005hello\022\025.example.HelloRequest\032\023.example.HelloReply\"", size=size@entry=191, 
    msg=msg@entry=0x7f2ad3fba948, l=l@entry=0x7f2ad5f53050 <google_protobuf_FileDescriptorSet_msginit>, extreg=extreg@entry=0x0, options=options@entry=0, arena=0x7f2ad3fbaa30)
    at /tmp/pear/temp/protobuf/php-upb.c:983
#12 0x00007f2ad5f24338 in upb_decode (arena=0x7f2ad3fbaa30, l=<optimized out>, msg=0x7f2ad3fba948, size=191, 
    buf=0x7f2ad2d90558 "\n\274\001\n\034protos/Example/example.proto\022\aexample\"\034\n\fHelloRequest\022\f\n\004name\030\001 \001(\t\"+\n\nHelloReply\022\f\n\004code\030\001 \001(\005\022\017\n\amessage\030\002 \001(\t2@\n\aexample\022\065\n\005hello\022\025.example.HelloRequest\032\023.example.HelloReply\"") at /tmp/pear/temp/protobuf/php-upb.h:708
#13 google_protobuf_FileDescriptorSet_parse (arena=0x7f2ad3fbaa30, size=191, 
    buf=0x7f2ad2d90558 "\n\274\001\n\034protos/Example/example.proto\022\aexample\"\034\n\fHelloRequest\022\f\n\004name\030\001 \001(\t\"+\n\nHelloReply\022\f\n\004code\030\001 \001(\00--Type <RET> for more, q to quit, c to continue without paging--
5\022\017\n\amessage\030\002 \001(\t2@\n\aexample\022\065\n\005hello\022\025.example.HelloRequest\032\023.example.HelloReply\"") at /tmp/pear/temp/protobuf/php-upb.h:2252
#14 add_descriptor_set (arena=0x7f2ad3fbaa30, data_len=191, 
    data=0x7f2ad2d90558 "\n\274\001\n\034protos/Example/example.proto\022\aexample\"\034\n\fHelloRequest\022\f\n\004name\030\001 \001(\t\"+\n\nHelloReply\022\f\n\004code\030\001 \001(\005\022\017\n\amessage\030\002 \001(\t2@\n\aexample\022\065\n\005hello\022\025.example.HelloRequest\032\023.example.HelloReply\"", pool=0x7f2ad7e63000)
    at /tmp/pear/temp/protobuf/def.c:934
#15 zim_DescriptorPool_internalAddGeneratedFile (execute_data=<optimized out>, return_value=<optimized out>) at /tmp/pear/temp/protobuf/def.c:987
#16 0x0000561a5dc0c5ad in execute_ex ()
#17 0x0000561a5dc0d313 in execute_ex ()
#18 0x0000561a5dc0d313 in execute_ex ()
#19 0x0000561a5dc0eb02 in execute_ex ()
#20 0x0000561a5dc0eb02 in execute_ex ()
#21 0x0000561a5dc0d313 in execute_ex ()
#22 0x0000561a5dc0d313 in execute_ex ()
#23 0x0000561a5dc0d313 in execute_ex ()
#24 0x0000561a5dc0d313 in execute_ex ()
#25 0x0000561a5dc0d313 in execute_ex ()
#26 0x0000561a5dc0d313 in execute_ex ()
#27 0x0000561a5dc0eb02 in execute_ex ()
#28 0x0000561a5dc0eb02 in execute_ex ()
#29 0x0000561a5dc0eb02 in execute_ex ()
#30 0x00007f2ad5bf0e27 in swoole::PHPCoroutine::main_func (arg=0x7ffda6550a40) at /tmp/swoole/ext-src/swoole_coroutine.cc:774
#31 0x00007f2ad5c7c18b in std::function<void (void*)>::operator()(void*) const (__args#0=<optimized out>, this=<optimized out>) at /usr/include/c++/10.3.1/bits/std_function.h:622
#32 swoole::coroutine::Context::context_func (arg=0x7f2ad3f25030) at /tmp/swoole/src/coroutine/context.cc:142
#33 0x00007f2ad5d01461 in make_fcontext () at /tmp/swoole/thirdparty/boost/asm/make_x86_64_sysv_elf_gas.S:64
#34 0x0000000000000000 in ?? ()
@heyanlong
Copy link
Member

冲突版本是什么?

@liutaot
Copy link
Author

liutaot commented Sep 27, 2021

冲突版本是什么?

php 8.0
protobuf 3.18
skywalking master

@heyanlong
Copy link
Member

protobuf是加载什么proto文件了吗?

@liutaot
Copy link
Author

liutaot commented Sep 27, 2021

protobuf是加载什么proto文件了吗?

proto文件内容如下:

syntax = "proto3";

package example;

service example {
    rpc hello (HelloRequest) returns (HelloReply) {
    }
}

message HelloRequest {
    string name = 1;
}

message HelloReply {
    int32 code = 1;
    string message = 2;
}

@heyanlong
Copy link
Member

是 HelloRequest 冲突了

@heyanlong
Copy link
Member

如果不是skywalking最新版本,目前无解。skywalking 最新版本修复了这个问题。

@heyanlong
Copy link
Member

PHP agent还没做升级最新版本

@liutaot
Copy link
Author

liutaot commented Sep 27, 2021

是 HelloRequest 冲突了

syntax = "proto3";

package example;

service example {
    rpc hello (AbcRequest) returns (AbcReply) {
    }
}

message AbcRequest {
    string name = 1;
}

message AbcReply {
    int32 code = 1;
    string message = 2;
}

这样也不行

@liutaot
Copy link
Author

liutaot commented Sep 27, 2021

skywalking 版本是 8.6

sky php agent 版本是master

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

No branches or pull requests

2 participants