Coder Social home page Coder Social logo

跑协程测试发现的core about libgo HOT 5 CLOSED

yyzybb537 avatar yyzybb537 commented on June 1, 2024
跑协程测试发现的core

from libgo.

Comments (5)

moying050 avatar moying050 commented on June 1, 2024

跑测试跑了24个小时,出现4次core,原因都是一样,
有线程私有变量如下导致:
`
(gdb) p info
$145 = (co::ThreadLocalInfo &) @0x232e910: {
thread_id = 66,
sleep_ms = 0 '\000',
proc = 0x0
}
(gdb) pdequeue run_proc_list_
$146 = (co::Processer *) 0x23534a0
......
$211 = (co::Processer *) 0x23548f0
Dequeue size = 66

(gdb) p *(co::Processer *) 0x23548f0
$212 = {
......
id_ = 66,
static s_id_ = {
<std::__atomic_base> = {
_M_i = 66
}, }
}
`
thread_id为66,根据代码,proc不应该为0;
看代码中对deque取size有两处是不拿锁,一处是拿锁的,怀疑是size在不拿锁调用下有概率不准(偏大)

from libgo.

moying050 avatar moying050 commented on June 1, 2024

通过原子量维护run_proc_list_的size,使用默认的memory order,测试目前没有发现问题;
至于是内存乱序还是什么原因导致的问题暂时不细究

from libgo.

yyzybb537 avatar yyzybb537 commented on June 1, 2024

感谢指出问题,请提交一个pr修复这个问题吧

from libgo.

yyzybb537 avatar yyzybb537 commented on June 1, 2024

能否提供一下测试代码?

from libgo.

yyzybb537 avatar yyzybb537 commented on June 1, 2024

3.x版本不再有这个问题 关闭

from libgo.

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.