GithubHelp home page GithubHelp logo

Segfault in write_channel about ardb HOT 3 CLOSED

yinqiwen avatar yinqiwen commented on September 18, 2024
Segfault in write_channel

from ardb.

Comments (3)

sscarduzio avatar sscarduzio commented on September 18, 2024

I already run gdb:

ubuntu@ip-10-49-11-32:~$ gdb ardb/src/ardb-server /tmp/core
GNU gdb (GDB) 7.6.1-ubuntu
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/ubuntu/ardb/src/ardb-server...done.
[New LWP 3437]
[New LWP 3434]
[New LWP 3435]
[New LWP 3438]
[New LWP 3436]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `src/ardb-server ardb.conf'.
Program terminated with signal 11, Segmentation fault.
#0  SendDownstream<ardb::MessageEvent<ardb::codec::RedisReply> > (event=..., this=<optimized out>) at channel/all_includes.hpp:134
134         ChannelHandlerContext* ctx = GetActualDownstreamContext(m_tail);
(gdb) backtrace
#0  SendDownstream<ardb::MessageEvent<ardb::codec::RedisReply> > (event=..., this=<optimized out>) at channel/all_includes.hpp:134
#1  ardb::write_channel<ardb::codec::RedisReply> (channel=0x0, message=message@entry=0x7f87089e5960, destructor=destructor@entry=0x0)
    at ./channel/channel_helper.hpp:75
#2  0x0000000000431835 in Write<ardb::codec::RedisReply> (msg=..., this=<optimized out>) at ./channel/channel.hpp:313
#3  ardb::ArdbServer::AsyncWriteBlockListReply (ch=<optimized out>, data=data@entry=0x7f87089e5950) at lists.cpp:44
#4  0x00000000004ff709 in ardb::ChannelService::OnSoftSignal (this=0x7f87f00ca480, soft_signo=<optimized out>, appendinfo=<optimized out>)
    at channel/channel_service.cpp:165
#5  0x000000000050fbf4 in ardb::SoftSignalChannel::FireSignalReceived (this=<optimized out>, signo=4, append_info=1) at channel/signal/soft_signal_channel.cpp:73
#6  0x000000000050f853 in HandleStreamEvent (e=..., ctx=..., this=<optimized out>) at ./channel/channel_upstream_handler.hpp:133
#7  ardb::ChannelPipeline::SendUpstream<unsigned long> (ctx=<optimized out>, e=..., this=<optimized out>) at ./channel/all_includes.hpp:89
#8  0x0000000000510b4f in SendUpstream<ardb::MessageEvent<unsigned long> > (this=<optimized out>, this=<optimized out>, e=...) at ./channel/all_includes.hpp:164
#9  fire_message_received<unsigned long> (destructor=0x0, message=0x7f87edffcca8, ctx=...) at ./channel/channel_helper.hpp:91
#10 CallDecode (cumulation=..., channel=0x7f87f00ca5c0, context=..., this=0x7f87f00ca6c8) at ./channel/codec/stack_frame_decoder.hpp:102
#11 ardb::codec::StackFrameDecoder<unsigned long>::MessageReceived (this=0x7f87f00ca6c8, ctx=..., e=...) at ./channel/codec/stack_frame_decoder.hpp:157
#12 0x00000000004f7ee3 in HandleStreamEvent (e=..., ctx=..., this=<optimized out>) at ./channel/channel_upstream_handler.hpp:133
#13 ardb::ChannelPipeline::SendUpstream<ardb::Buffer> (ctx=<optimized out>, e=..., this=<optimized out>) at ./channel/all_includes.hpp:89
#14 0x00000000004f7fbf in SendUpstream<ardb::MessageEvent<ardb::Buffer> > (event=..., this=0x7f87f00ca5f8) at ./channel/all_includes.hpp:128
#15 fire_message_received<ardb::Buffer> (destructor=0x0, message=0x7f87f00ca628, channel=0x7f87f00ca5c0) at ./channel/channel_helper.hpp:83
#16 ardb::Channel::OnRead (this=0x7f87f00ca5c0) at channel/channel.cpp:472
#17 0x00000000004f7d0d in ardb::Channel::IOEventCallback (eventLoop=<optimized out>, fd=<optimized out>, clientData=0x7f87f00ca5c0, mask=1) at channel/channel.cpp:50
#18 0x0000000000514580 in aeProcessEvents (eventLoop=eventLoop@entry=0x7f87f0041888, flags=flags@entry=3) at channel/redis/ae.c:429
#19 0x000000000051486b in aeMain (eventLoop=0x7f87f0041888) at channel/redis/ae.c:485
#20 0x00000000004e26a0 in ardb::Thread::ThreadFunc (data=0x7f87eff477f0) at util/thread/thread.cpp:38
#21 0x00007f87f15e6f6e in start_thread (arg=0x7f87edffd700) at pthread_create.c:311
#22 0x00007f87f0af39cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

from ardb.

yinqiwen avatar yinqiwen commented on September 18, 2024

It's caused by the 'lpush' command which waking the blocking client, while at the same time the connection is closing.
Just commit a fix for it.

from ardb.

sscarduzio avatar sscarduzio commented on September 18, 2024

Thanks, this works. Good job!

from ardb.

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.