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

linux运行wsserver出现段错误 #1

Open
TaijiGao opened this issue May 14, 2021 · 4 comments
Open

linux运行wsserver出现段错误 #1

TaijiGao opened this issue May 14, 2021 · 4 comments

Comments

@TaijiGao
Copy link

感谢作者的辛苦贡献,本人在centos7服务器运行一段时间后,wsserver会出现段错误导致服务崩溃,调试coredump文件见下面日志,疑似buf的内容和buflen长度不一致,还请作者解惑,不胜感激。
Core was generated by `./WSServer 9001'.
Program terminated with signal 11, Segmentation fault.
#0 0x0000000000000021 in ?? ()
(gdb) bt
#0 0x0000000000000021 in ?? ()
#1 0x000000000069a3b5 in RtspSource::SendWSData (this=0x55fb000) at RtspSource.cpp:422
#2 0x00000000006a0141 in boost::_mfi::mf0<void, RtspSource>::operator() (this=0x7fe109c96848, p=0x55fb000) at /usr/include/boost/bind/mem_fn_template.hpp:49
#3 0x00000000006a00a4 in boost::_bi::list1<boost::_bi::value<RtspSource*> >::operator()<boost::_mfi::mf0<void, RtspSource>, boost::_bi::list0> (this=0x7fe109c96858, f=..., a=...)
at /usr/include/boost/bind/bind.hpp:253
#4 0x000000000069fe47 in boost::_bi::bind_t<void, boost::_mfi::mf0<void, RtspSource>, boost::_bi::list1<boost::_bi::value<RtspSource*> > >::operator() (this=0x7fe109c96848)
at /usr/include/boost/bind/bind_template.hpp:20
#5 0x000000000069fb76 in boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf0<void, RtspSource>, boost::_bi::list1<boost::_bi::value<RtspSource*> > > >::run (this=0x7fe109c96690)
at /usr/include/boost/thread/detail/thread.hpp:117
#6 0x00007fe3c0ae425a in boost::(anonymous namespace)::thread_proxy (param=) at libs/thread/src/pthread/thread.cpp:165
#7 0x00007fe3bfc88ea5 in start_thread (arg=0x7fe3bdea7700) at pthread_create.c:307
#8 0x00007fe3bf9b19fd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb) f 1
#1 0x000000000069a3b5 in RtspSource::SendWSData (this=0x55fb000) at RtspSource.cpp:422
warning: Source file is more recent than executable.
422 delete fdata;
(gdb) p fdata->buf
$1 = (uint8_t *) 0x7fe23c000088 "\360^\325\032\341\177"
(gdb) p fdata->buflen
$2 = 32
(gdb)

@Garefield
Copy link
Owner

Garefield commented May 14, 2021 via email

@Garefield
Copy link
Owner

Garefield commented May 14, 2021 via email

@TaijiGao
Copy link
Author

感谢答复,这个问题不是内存泄露,即使websocket没有完全发送成功,av_fifo_generic_read这个函数已经完全读出了rtsp拉流数据,delete pdata理论上是与websocket发送多少字节没有关系的,所以不理解为何delete pdata销毁内存有时会越界。因个人对buf内的音视频数据不太熟悉,不清楚buf的内存数据是否与实际的buflen一致,作者如果方便可加下微信13862049340,进一步深入讨论,谢谢

@Garefield
Copy link
Owner

Garefield commented May 16, 2021 via email

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

2 participants