Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#357 closed баг (fixed)

Падение по ошибке сегментирования

Reported by: alx Owned by: dimag
Priority: major Milestone: 2 очередь
Component: ПО MC04-Dispatcher. Пульт диспетчера/техника Keywords: config, SIP port
Cc: san

Description

В конфигурации программы (r370) параметру "SIP порт" было задано такое значение порта, на котором другая программа уже слушает TCP сокет. В результате программа упала при старте. Вот что вывелось в консоль:

/usr/lib/x86_64-linux-gnu/qt4/plugins

rootStartElement
Characters
10:11:17.961 os_core_unix.c !pjlib 2.1 for POSIX initialized
8013003
UP 0 years, 0 days, 17 hours, 15 minutes, 22 seconds, 139 milliseconds, 239 microseconds
FreeSWITCH (Version 1.6.10 git 726448d 2016-08-24 21:54:04Z 64bit) is ready
118 session(s) since startup
0 session(s) - peak 13, last 5min 0 
0 session(s) per Sec out of max 30, peak 6, last 5min 0 
1000 session(s) max
min idle cpu 0.00/98.17
Current Stack Size/Max 240K/8192K
10:11:18.798 sip_endpoint.c !.Creating endpoint instance...
10:11:18.798          pjlib  .select() I/O Queue created (0x7f861400ee60)
10:11:18.799 sip_endpoint.c  .Module "mod-msg-print" registered
10:11:18.799 sip_transport.  .Transport manager created.
10:11:18.799   pjsua_core.c  .PJSUA state changed: NULL --> CREATED
10:11:18.799 sip_endpoint.c  .Module "mod-pjsua-log" registered
10:11:18.799 sip_endpoint.c  .Module "mod-tsx-layer" registered
10:11:18.799 sip_endpoint.c  .Module "mod-stateful-util" registered
10:11:18.799 sip_endpoint.c  .Module "mod-ua" registered
10:11:18.799 sip_endpoint.c  .Module "mod-100rel" registered
10:11:18.799 sip_endpoint.c  .Module "mod-pjsua" registered
10:11:18.799 sip_endpoint.c  .Module "mod-invite" registered
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_card_driver returned error: Нет такого файла или каталога
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_concat returned error: Нет такого файла или каталога
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: Нет такого файла или каталога
ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: Нет такого файла или каталога
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM sysdefault
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_card_driver returned error: Нет такого файла или каталога
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_concat returned error: Нет такого файла или каталога
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: Нет такого файла или каталога
ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: Нет такого файла или каталога
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM sysdefault
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_card_driver returned error: Нет такого файла или каталога
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_concat returned error: Нет такого файла или каталога
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: Нет такого файла или каталога
ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: Нет такого файла или каталога
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_card_driver returned error: Нет такого файла или каталога
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_concat returned error: Нет такого файла или каталога
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: Нет такого файла или каталога
ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: Нет такого файла или каталога
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_card_driver returned error: Нет такого файла или каталога
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_concat returned error: Нет такого файла или каталога
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: Нет такого файла или каталога
ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: Нет такого файла или каталога
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM dmix
Cannot connect to server socket err = Нет такого файла или каталога
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
10:11:18.808       pa_dev.c  ..PortAudio sound library initialized, status=0
10:11:18.808       pa_dev.c  ..PortAudio host api count=2
10:11:18.808       pa_dev.c  ..Sound device count=0
10:11:18.808          pjlib  ..select() I/O Queue created (0x7f8614030638)
10:11:18.816 sip_endpoint.c  .Module "mod-evsub" registered
10:11:18.816 sip_endpoint.c  .Module "mod-presence" registered
10:11:18.816 sip_endpoint.c  .Module "mod-mwi" registered
10:11:18.816 sip_endpoint.c  .Module "mod-refer" registered
10:11:18.816 sip_endpoint.c  .Module "mod-pjsua-pres" registered
10:11:18.816 sip_endpoint.c  .Module "mod-pjsua-im" registered
10:11:18.816 sip_endpoint.c  .Module "mod-pjsua-options" registered
10:11:18.816   pjsua_core.c  .1 SIP worker threads created
10:11:18.816   pjsua_core.c  .pjsua version 2.1 for Linux-4.4.0.22/x86_64/glibc-2.17 initialized
10:11:18.816   pjsua_core.c  .PJSUA state changed: CREATED --> INIT
10:11:18.817   pjsua_core.c  SIP UDP socket reachable at 192.168.0.63:8080
10:11:18.817 udp0x7f861404c  SIP UDP transport started, published address is 192.168.0.63:8080
10:11:18.817         tcplis  SIP TCP listener destroyed
10:11:18.817   pjsua_core.c  Error creating SIP TCP listener: Адрес уже используется [status=120098]
10:11:18.817   pjsua_core.c  Shutting down, flags=0...
10:11:18.817   pjsua_core.c  PJSUA state changed: INIT --> CLOSING
10:11:18.826   pjsua_call.c  .Hangup all calls..
10:11:18.826   pjsua_pres.c  .Shutting down presence..
10:11:18.826  pjsua_media.c  .Shutting down media..
10:11:18.826  pjsua_media.c  ..Call 0: deinitializing media..
10:11:18.826  pjsua_media.c  ..Call 1: deinitializing media..
10:11:18.826  pjsua_media.c  ..Call 2: deinitializing media..
10:11:18.826  pjsua_media.c  ..Call 3: deinitializing media..
10:11:19.308       pa_dev.c  ..PortAudio sound library shutting down..
10:11:20.318   pjsua_core.c  .Destroying...
10:11:20.318 sip_transactio  .Stopping transaction layer module
10:11:20.318 sip_transactio  .Stopped transaction layer module
10:11:20.318 sip_endpoint.c  .Module "mod-pjsua-options" unregistered
10:11:20.318 sip_endpoint.c  .Module "mod-pjsua-im" unregistered
10:11:20.318 sip_endpoint.c  .Module "mod-pjsua-pres" unregistered
10:11:20.318 sip_endpoint.c  .Module "mod-pjsua" unregistered
10:11:20.318 sip_endpoint.c  .Module "mod-stateful-util" unregistered
10:11:20.318 sip_endpoint.c  .Module "mod-refer" unregistered
10:11:20.318 sip_endpoint.c  .Module "mod-mwi" unregistered
10:11:20.318 sip_endpoint.c  .Module "mod-presence" unregistered
10:11:20.318 sip_endpoint.c  .Module "mod-evsub" unregistered
10:11:20.318 sip_endpoint.c  .Module "mod-invite" unregistered
10:11:20.318 sip_endpoint.c  .Module "mod-100rel" unregistered
10:11:20.318 sip_endpoint.c  .Module "mod-ua" unregistered
10:11:20.318 sip_transactio  .Transaction layer module destroyed
10:11:20.318 sip_endpoint.c  .Module "mod-tsx-layer" unregistered
10:11:20.318 sip_endpoint.c  .Module "mod-msg-print" unregistered
10:11:20.318 sip_endpoint.c  .Module "mod-pjsua-log" unregistered
10:11:20.319 sip_endpoint.c  .Endpoint 0x7f8614004348 destroyed
10:11:20.319   pjsua_core.c  .PJSUA state changed: CLOSING --> NULL
10:11:20.319   pjsua_core.c  .PJSUA destroyed...
QThread: Destroyed while thread is still running
Ошибка сегментирования (сделан дамп памяти)

Конфиг прилагаю.

Attachments (1)

Config.xml (1.2 KB ) - added by alx 8 years ago.

Download all attachments as: .zip

Change History (5)

by alx, 8 years ago

Attachment: Config.xml added

comment:1 by alx, 8 years ago

Вот стэк в месте получения сигнала под отладчиком (падение выглядит немного иначе чем в описании тикета):

...
QThread: Destroyed while thread is still running
QWaitCondition::wakeAll(): mutex lock failure: Недопустимый аргумент
*** Error in `/home/alx/src/dispatcher/MC04Dispatcher': malloc(): smallbin double linked list corrupted: 0x00000000007c2730 ***
...
(gdb) bt
#0  0x00007ffff4ac2418 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff4ac401a in __GI_abort () at abort.c:89
#2  0x00007ffff4b0472a in __libc_message (do_abort=do_abort@entry=2, 
    fmt=fmt@entry=0x7ffff4c1d6b0 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff4b0ef01 in malloc_printerr (ar_ptr=0x3, ptr=<optimized out>, 
    str=0x7ffff4c1dae0 "malloc(): smallbin double linked list corrupted", action=3) at malloc.c:5007
#4  _int_malloc (av=av@entry=0x7ffff4e50b20 <main_arena>, bytes=bytes@entry=56) at malloc.c:3387
#5  0x00007ffff4b105a4 in __GI___libc_malloc (bytes=56) at malloc.c:2914
#6  0x00007ffff5402e78 in operator new(unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x00007ffff64cb50a in QRegion::QRegion(QRect const&, QRegion::RegionType) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#8  0x00007ffff654860a in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#9  0x00007ffff636727e in QWidget::update(QRect const&) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#10 0x00007ffff6367333 in QWidget::update() () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#11 0x00007ffff6752fdf in QLineEdit::changeEvent(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#12 0x00007ffff63777bb in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#13 0x00007ffff6752a63 in QLineEdit::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#14 0x00007ffff6320fdc in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#15 0x00007ffff6327f16 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#16 0x00007ffff5a9e90d in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#17 0x00007ffff666d67d in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#18 0x00007ffff666d7a6 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#19 0x00000000004c7b28 in CStartupDlg::ErrorReport(QString const&) ()
#20 0x00007ffff5ab8db1 in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#21 0x00007ffff6377d3c in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#22 0x00007ffff6320fdc in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#23 0x00007ffff6327f16 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#24 0x00007ffff5a9e90d in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#25 0x00007ffff5aa23c6 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#26 0x00007ffff5acf13e in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#27 0x00007ffff1f371a7 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007ffff1f37400 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x00007ffff1f374ac in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#30 0x00007ffff5acf2ae in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#31 0x00007ffff63ce616 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#32 0x00007ffff5a9d18f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
---Type <return> to continue, or q <return> to quit---
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#33 0x00007ffff5a9d4f5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#34 0x00007ffff6803a3c in QDialog::exec() () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#35 0x00000000004188e1 in main ()

comment:2 by alx, 8 years ago

А вот другое падение, так падает чаще всего:

QThread: Destroyed while thread is still running

Thread 2 "InitializationT" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffeaf52700 (LWP 32240)]
0x00007ffff5ab2d99 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
(gdb) bt
#0  0x00007ffff5ab2d99 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#1  0x00007ffff598dd7f in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007ffff598ee5b in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#3  0x00007ffff56fe6fa in start_thread (arg=0x7fffeaf52700) at pthread_create.c:333
#4  0x00007ffff4b93b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

comment:3 by dimag, 8 years ago

Keywords: config SIP port added
Resolution: fixed
Status: newclosed

r374.
Причина данного явления в том, что я посылал emit Error_Report и после него ещё деинициализиловал объекты и потом только завершал основную функцию потока Run. Так как деинициализация может занимать достаточно много времени, то главный поток успевал получить сообщение и первым приказать совершить потоку инициализации, пока он работал. Ошибка явео из-за этого и удалось воспроизвести подобную ситуацию.

comment:4 by san, 7 years ago

Milestone: Текущее2 очередь

Milestone renamed

Note: See TracTickets for help on using tickets.