Giter Club home page Giter Club logo

Comments (5)

jamesge avatar jamesge commented on July 23, 2024

什么系统?
我在linux-mint 17.4里试了下你的代码,是ok的:
gejun@gejun-virtual-machine ~/github_brpc/example/test_bth $ ./test
128

from brpc.

chenzhangyi avatar chenzhangyi commented on July 23, 2024

是你的程序段错误还是gdb段错误? 最好贴一下栈

from brpc.

shibing avatar shibing commented on July 23, 2024

程序直接运行没有段错误,是gdb调试的时候段错误,栈如下:

(gdb) s
bthread_start_urgent (tid=0x7fffffffe448, attr=0x0, fn=0x40b1cd <work(void*)>, arg=0x80) at src/bthread/bthread.cpp:139
139         bthread::TaskGroup* g = bthread::tls_task_group;
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
bthread_start_urgent (tid=0x7fffffffe448, attr=0x0, fn=0x40b1cd <work(void*)>, arg=0x80) at src/bthread/bthread.cpp:139
139         bthread::TaskGroup* g = bthread::tls_task_group;
(gdb) bt
#0  bthread_start_urgent (tid=0x7fffffffe448, attr=0x0, fn=0x40b1cd <work(void*)>, arg=0x80) at src/bthread/bthread.cpp:139
#1  0x000000000040b229 in main () at b.cpp:14
(gdb)

栈好像也没有啥有用的信息,gdb的版本是:

[abs@abs brpc]$ gdb -v
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-94.el7

操作系统是:

CentOS Linux release 7.3.1611 (Core)

from brpc.

shibing avatar shibing commented on July 23, 2024

将链接brpc的方式改为动态链接就没有上面的问题,如果与libbrpc.a链接就会有问题

from brpc.

jamesge avatar jamesge commented on July 23, 2024

你看看默认方式编译的example/echo_c++能不能跑

from brpc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.