i4tv / gstreamill

encoder with hls output based on gstreamer.
GNU General Public License v3.0
247 stars 84 forks source link

SIGBUS bug #86

Closed zhangping closed 8 years ago

zhangping commented 8 years ago

主进程挂掉,通过core文件发现是由于SIGBUS:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `gstreamill'.
Program terminated with signal SIGBUS, Bus error.
#0  0x000000000040c9b2 in msg_thread (data=0x1717c90) at gstreamill.c:860
860                 encoder_output->last_timestamp = encoder_output_rap_timestamp (encoder_output, *(encoder_output->last_rap_addr));
(gdb) bt
#0  0x000000000040c9b2 in msg_thread (data=0x1717c90) at gstreamill.c:860
#1  0x00007f97a4769f05 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f97a42de182 in start_thread (arg=0x7f97a1cd1700) at pthread_create.c:312
#3  0x00007f97a393047d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

发现是在处理CCTV1HD的时候挂掉的:

(gdb) print *encoder_output
$2 = {
  name = "CCTV1HD.encoder.0\000\000p\227\177\000\000\020\255\000p\227\177\000\000 .\000p\227\177\000\000`\256\000p\227\177\000\000\377\377\377\377\377\377\377\377\001\000\000\000\000\000\000\000\060 0 0 0 !\000\000\000\000\000\000\000\260\255\000p\227\177\000\000Ю\000p\227\177\000\000p\000\000\000\000\000\000\000\064\000\000\000\000\000\000\000\020\257\000p\227\177\000\000\001\006\000\000\000\000\000\000\020\264\000p\227\177\000\000x\000\000p\227\177", '\000' <repeats 18 times>, "\060\255\000p\227\177\000\000@\260\000p\227\177\000\000\377\377\377\377\377\377\377\377\001\000\000\000\000\000\000\000P\256\000p\227\177\000\000A"..., semaphore = 0x7f97a5bcd000,
  heartbeat = 0x7f9753ffd910, eos = 0x7f9753ffd918,
  cache_addr = 0x7f9753ffe144 <error: Cannot access memory at address 0x7f9753ffe144>, cache_size = 67108864,
  total_count = 0x7f9753ffe13c, head_addr = 0x7f9757ffe144, tail_addr = 0x7f9757ffe14c, last_rap_addr = 0x7f9757ffe154,
  stream_count = 2, streams = 0x7f9753ffd91c, m3u8_playlist = 0x18b8550, segment_duration = 5000000000, last_timestamp = 0,
  system_clock = 0x18ae160, record_path = 0x7f9770001140 "/var/lib/gstreamill/dvr/CCTV1HD/0", sequence = 225830,
  dvr_duration = 604800}

CCTV1HD的日志显示,这个频道但是重启失败,失败的原因是获取锁失败:

May 12 06:23:22.834476 WARN   gstreamill encoder.c:312: sendto segment msg error: Resource temporarily unavailable

*** May 12 06:23:24 : job CCTV1HD starting ***

May 12 06:23:24.959981 INFO   gstreamill main.c:420: Initializing job ...
May 12 06:23:26.962138 ERROR  gstreamill job.c:332: sem_timedwait failure: Connection timed out
May 12 06:23:26.962234 ERROR  gstreamill main.c:422: initialize job failure, exit