Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coredump - lua_pushlstring - markvalue(g, o) 随机出现 #561

Closed
yingnierxiao opened this issue Dec 1, 2016 · 3 comments
Closed

coredump - lua_pushlstring - markvalue(g, o) 随机出现 #561

yingnierxiao opened this issue Dec 1, 2016 · 3 comments

Comments

@yingnierxiao
Copy link

yingnierxiao commented Dec 1, 2016

Program terminated with signal 11, Segmentation fault.
#0 0x00000000004154a8 in traversethread (th=0x7f10c56943e8, g=0x7f10c570c1d8) at lgc.c:548
548 markvalue(g, o);
(gdb) where
#0 0x00000000004154a8 in traversethread (th=0x7f10c56943e8, g=0x7f10c570c1d8) at lgc.c:548
#1 propagatemark (g=g@entry=0x7f10c570c1d8) at lgc.c:599
#2 0x00000000004161a0 in propagateall (g=) at lgc.c:615
#3 atomic (L=0x7f10c56943e8) at lgc.c:1005
#4 singlestep (L=L@entry=0x7f10c56943e8) at lgc.c:1073
#5 0x000000000041657e in luaC_step (L=L@entry=0x7f10c56943e8) at lgc.c:1145
#6 0x0000000000410487 in lua_pushlstring (L=L@entry=0x7f10c56943e8, s=s@entry=0x7f10c1233000 "D3"\021R", len=len@entry=1392) at lapi.c:486
#7 0x00007f10c2df485c in kcp_output_callback (buf=0x7f10c1233000 "D3"\021R", len=1392, kcp=, arg=) at 3rd/lua-kcp/src/lkcp.c:53
#8 0x00007f10c2df3f9f in ikcp_flush (kcp=0x7f10c122e000) at 3rd/kcp/ikcp.c:942
#9 0x00007f10c2df4ca9 in lkcp_update (L=0x7f10c1e0f0e8) at 3rd/lua-kcp/src/lkcp.c:147
#10 0x00000000004135ff in luaD_precall (L=L@entry=0x7f10c1e0f0e8, func=func@entry=0x7f10c1e16320, nresults=nresults@entry=0) at ldo.c:365
#11 0x000000000041ed2e in luaV_execute (L=L@entry=0x7f10c1e0f0e8) at lvm.c:1146
#12 0x0000000000413890 in unroll (L=0x7f10c1e0f0e8, ud=) at ldo.c:555
#13 0x0000000000412e4c in luaD_rawrunprotected (L=L@entry=0x7f10c1e0f0e8, f=f@entry=0x4138a0 , ud=ud@entry=0x7f10c73f47cc) at ldo.c:142
#14 0x0000000000413a90 in lua_resume (L=L@entry=0x7f10c1e0f0e8, from=from@entry=0x7f10c570c108, nargs=nargs@entry=3) at ldo.c:662
#15 0x0000000000426d87 in auxresume (L=L@entry=0x7f10c570c108, co=co@entry=0x7f10c1e0f0e8, narg=3) at lcorolib.c:39
#16 0x00000000004270b7 in luaB_coresume (L=0x7f10c570c108) at lcorolib.c:60
#17 0x00000000004135ff in luaD_precall (L=L@entry=0x7f10c570c108, func=func@entry=0x7f10c561b140, nresults=nresults@entry=-1) at ldo.c:365
#18 0x000000000041ed2e in luaV_execute (L=L@entry=0x7f10c570c108) at lvm.c:1146
#19 0x00000000004139df in luaD_call (L=L@entry=0x7f10c570c108, func=, nResults=) at ldo.c:496
#20 0x0000000000413a31 in luaD_callnoyield (L=0x7f10c570c108, func=, nResults=) at ldo.c:506
#21 0x0000000000412e4c in luaD_rawrunprotected (L=L@entry=0x7f10c570c108, f=f@entry=0x40fbd0 <f_call>, ud=ud@entry=0x7f10c73f4ac0) at ldo.c:142
#22 0x0000000000413c7d in luaD_pcall (L=L@entry=0x7f10c570c108, func=func@entry=0x40fbd0 <f_call>, u=u@entry=0x7f10c73f4ac0, old_top=176, ef=) at ldo.c:727
#23 0x000000000041106c in lua_pcallk (L=L@entry=0x7f10c570c108, nargs=5, nresults=nresults@entry=-1, errfunc=errfunc@entry=0, ctx=ctx@entry=0,
k=k@entry=0x425e00 ) at lapi.c:969
#24 0x0000000000425f90 in luaB_pcall (L=0x7f10c570c108) at lbaselib.c:424
#25 0x00000000004135ff in luaD_precall (L=L@entry=0x7f10c570c108, func=func@entry=0x7f10c561b090, nresults=nresults@entry=2) at ldo.c:365
#26 0x000000000041ed2e in luaV_execute (L=L@entry=0x7f10c570c108) at lvm.c:1146
#27 0x00000000004139df in luaD_call (L=L@entry=0x7f10c570c108, func=, nResults=) at ldo.c:496
#28 0x0000000000413a31 in luaD_callnoyield (L=0x7f10c570c108, func=, nResults=) at ldo.c:506
#29 0x0000000000412e4c in luaD_rawrunprotected (L=L@entry=0x7f10c570c108, f=f@entry=0x40fbd0 <f_call>, ud=ud@entry=0x7f10c73f4d70) at ldo.c:142
#30 0x0000000000413c7d in luaD_pcall (L=L@entry=0x7f10c570c108, func=func@entry=0x40fbd0 <f_call>, u=u@entry=0x7f10c73f4d70, old_top=48, ef=) at ldo.c:727
#31 0x000000000041106c in lua_pcallk (L=L@entry=0x7f10c570c108, nargs=nargs@entry=5, nresults=nresults@entry=0, errfunc=errfunc@entry=1, ctx=ctx@entry=0, k=k@entry=0x0)
at lapi.c:969
#32 0x00007f10c3bebd99 in _cb (context=0x7f10c564bc30, ud=0x7f10c570c108, type=1, session=3006, source=0, msg=0x0, sz=0) at lualib-src/lua-skynet.c:50
#33 0x0000000000409da8 in dispatch_message (ctx=0x7f10c564bc30, msg=0x7f10c73f4e40) at skynet-src/skynet_server.c:259
#34 0x000000000040a7f0 in skynet_context_message_dispatch (sm=sm@entry=0x7f10ca6167e0, q=0x7f10c573a540, q@entry=0x0, weight=weight@entry=-1)
at skynet-src/skynet_server.c:313
#35 0x000000000040af0d in thread_worker (p=) at skynet-src/skynet_start.c:162
#36 0x00007f10cb505dc5 in start_thread (arg=0x7f10c73f5700) at pthread_create.c:308
#37 0x00007f10cab24ced in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

@yingnierxiao yingnierxiao changed the title coredump coredump - lua_pushlstring - markvalue(g, o) 随机出现 Dec 2, 2016
@cloudwu
Copy link
Owner

cloudwu commented Dec 2, 2016

gc 过程中的 coredump 不会是 lua 本身实现引起的,通常是由于你的内存分配器出错导致的;最大的可能行是多次 free 同一个指针这种。比如你写的代码中不幸多次释放同一个对象。

你可以把 jemalloc 去掉,libc 自带的 malloc 有侦测这种情况的能力。

@acynothia
Copy link

可以去掉 jemalloc, 每次都强制 gc, 然后用 valgrind 扫一下.

@yingnierxiao
Copy link
Author

yingnierxiao commented Dec 2, 2016

mac上是关闭jc的,也没看出来比较明显的报错信息。我在继续看下代码。关键是每次出现的时间段都不一样

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

No branches or pull requests

3 participants