Skip to content

链接jemalloc后在bthread中启动的pthread在结束时crash #588

@niukuo

Description

@niukuo

Describe the bug (描述bug)

To Reproduce (复现方法)

  1. brpc server端
  2. 链接了 jemalloc
  3. usercode_in_pthread=false
  4. 在 rpc method 代码中使用std::thread启动了新的线程并detach
  5. 新启动的线程中会同步调用其它rpc服务。
  6. 线程在结束时crash,stack在jemalloc清理tcache(应该和thread local storage有关)时一个pthread_unlock。
  7. 设置usercode_in_pthread=true后到目前没有发现进程挂掉的情况

Expected behavior (期望行为)

Versions (各种版本)
OS: centos 5u7
Compiler: gcc-4.9.2
brpc:
protobuf: 2.4.1

Additional context/screenshots (更多上下文/截图)
coredump和stack暂时没有 如果需要可以复现一下。
在bthread文档中大概找了一下,猜测可能与stacktype有关。能否提供一些调查方向?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions