brpc icon indicating copy to clipboard operation
brpc copied to clipboard

开启contention出错

Open GOGOYAO opened this issue 5 years ago • 17 comments

Describe the bug (描述bug) 在mysql源码中,使用了brpc的client端,随后了dummy server,然后在brpc的页面中开启contention,排查锁的竞态,结果出现以下错误:

Argument "MSWin32" isn't numeric in numeric eq (==) at ./rpc_data/profiling/pprof.pl line 4898.
Argument "linux" isn't numeric in numeric eq (==) at ./rpc_data/profiling/pprof.pl line 4898.
Using local file ./rpc_data/profiling/87f6bfda5c2866e586e4c8041b288efb/20200820.170012.contention.
No nodes to print

To Reproduce (复现方法) 见bug描述

Expected behavior (期望行为) contention功能可用。

Versions (各种版本) OS: centos 7 Compiler: gcc 8 brpc: 11da9c8cbdc2ec8c0da728aedb4ed906717d6e0f protobuf: 3.11

Additional context/screenshots (更多上下文/截图)

GOGOYAO avatar Aug 20 '20 09:08 GOGOYAO

malloc用的是tcmalloc吗?链接的是 libtcmalloc_and_profiler 吧

gydong avatar Aug 20 '20 09:08 gydong

malloc用的是tcmalloc吗?链接的是 libtcmalloc_and_profiler 吧

应该不是。但是看文档,contention不需要tcmalloc吧? image

GOGOYAO avatar Aug 20 '20 10:08 GOGOYAO

@gydong @jamesge @chenzhangyi 求帮忙看下。

GOGOYAO avatar Aug 21 '20 03:08 GOGOYAO

是通过so加载的吗?

chenzhangyi avatar Aug 21 '20 06:08 chenzhangyi

是通过so加载的吗?

是的。自己的代码是mysql的一个so插件加载进去的。brpc的代码就放在so里面,bvar什么的是可以用的

GOGOYAO avatar Aug 21 '20 06:08 GOGOYAO

这个是因为已经链接了glibc里面的pthread_mutex_lock实现,导致brpc里面的hook没有生效

chenzhangyi avatar Aug 21 '20 06:08 chenzhangyi

这个是因为已经链接了glibc里面的pthread_mutex_lock实现,导致brpc里面的hook没有生效

那在mysql自身代码(非so中)中引入brpc就可以了吧?

GOGOYAO avatar Aug 21 '20 07:08 GOGOYAO

这个是因为已经链接了glibc里面的pthread_mutex_lock实现,导致brpc里面的hook没有生效

我在braft的server上用contention也是出现了这个错误了。

[20200828.170959.contention] Using local file /home/work/storage_node_service. Argument "MSWin32" isn't numeric in numeric eq (==) at ./rpc_data/profiling/pprof.pl line 4898. Argument "linux" isn't numeric in numeric eq (==) at ./rpc_data/profiling/pprof.pl line 4898. Using local file ./rpc_data/profiling/a33592089b394bec362ef13e1492d1dc/20200828.170959.contention. No nodes to print

求指导

GOGOYAO avatar Aug 28 '20 09:08 GOGOYAO

这次是直接链接的brpc吗?

gydong avatar Aug 31 '20 01:08 gydong

这次是直接链接的brpc吗?

对的。是一个brpc的server,不是dummy server了。但也没有连接tcmalloc的。

GOGOYAO avatar Sep 01 '20 02:09 GOGOYAO

方便的话,留下你的微信号,我拉你到开发者群里

gydong avatar Sep 04 '20 02:09 gydong

方便的话,留下你的微信号,我拉你到开发者群里

已经发送到你的gmail

GOGOYAO avatar Sep 10 '20 02:09 GOGOYAO

没收到呢

gydong avatar Sep 10 '20 12:09 gydong

没收到呢

[email protected] 发的这个邮箱。邮件主题是 微信号

GOGOYAO avatar Sep 14 '20 02:09 GOGOYAO

请问这个怎么解决呀?@gydong @jamesge @chenzhangyi 我也遇到了这个问题

zcuder avatar Nov 16 '20 08:11 zcuder

这个是因为已经链接了glibc里面的pthread_mutex_lock实现,导致brpc里面的hook没有生效

请教下brpc为什么要hook glibc的实现?

jiang4357291 avatar Feb 18 '22 10:02 jiang4357291

先用远程的好像可以

./pprof --text localhost:{port}/pprof/profile

就是看不了图

day253 avatar Jun 12 '22 03:06 day253