majestic icon indicating copy to clipboard operation
majestic copied to clipboard

RTSP client connection causes segmentation fault on XM530

Open tERB00 opened this issue 2 months ago • 1 comments

Required information

  • Camera board id: 30678
  • OpenIPC version: 2.4.03.21-lite
  • Commit: 5e19ba2
  • Branch: master
  • Tag:
  • installation method: uboot upload
  • modified majestic.yaml: yes
root@openipc-xm530:~# cat /dev/kmsg
6,0,0,-;Booting Linux on physical CPU 0x0
5,1,0,-;Linux version 3.10.103+ (runner@fv-az1501-513) (buildroot-gcc-12.3.0) #2 SMP Thu Mar 21 21:07:46 UTC 2024
3,2,0,-;CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c53c7d
3,3,0,-;CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
3,4,0,-;Machine: xm530
3,5,0,-;Memory policy: ECC disabled, Data cache writealloc
7,6,0,-;On node 0 totalpages: 8960
7,7,0,-;free_area_init_node: node 0, pgdat c0348640, node_mem_map c035c000
7,8,0,-;  Normal zone: 70 pages used for memmap
7,9,0,-;  Normal zone: 0 pages reserved
7,10,0,-;  Normal zone: 8960 pages, LIFO batch:1
6,11,0,-;PERCPU: Embedded 7 pages/cpu @c03a7000 s6272 r8192 d14208 u32768
7,12,0,-;pcpu-alloc: s6272 r8192 d14208 u32768 alloc=8*4096
7,13,0,-;pcpu-alloc: [0] 0 [0] 1
3,14,0,-;Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8890
5,15,0,-;Kernel command line: mem=35M console=ttyAMA0,115200 panic=20 root=/dev/mtdblock3 rootfstype=squashfs init=/init mtdparts=xm_sfc:256k(boot),64k(env),2048k(kernel),5120k(rootfs),-(rootfs_data)
6,16,0,-;PID hash table entries: 256 (order: -2, 1024 bytes)
6,17,0,-;Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
6,18,0,-;Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
6,19,0,-;Memory: 35MB = 35MB total
5,20,0,-;Memory: 31984k/31984k available, 3856k reserved, 0K highmem
5,21,0,-;Virtual kernel memory layout:\x0a    vector  : 0xffff0000 - 0xffff1000   (   4 kB)\x0a    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)\x0a    vmalloc : 0xc2800000 - 0xff000000   ( 968 MB)\x0a    lowmem  : 0xc0000000 - 0xc2300000   (  35 MB)\x0a    modules : 0xbf000000 - 0xc0000000   (  16 MB)\x0a      .text : 0xc0008000 - 0xc0301e64   (3048 kB)\x0a      .init : 0xc0302000 - 0xc0327880   ( 151 kB)\x0a      .data : 0xc0328000 - 0xc0348ee0   ( 132 kB)\x0a       .bss : 0xc0348ee0 - 0xc035bf64   (  77 kB)
6,22,0,-;SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
6,23,0,-;Hierarchical RCU implementation.
6,24,0,-;NR_IRQS:96
6,25,0,-;sched_clock: 32 bits at 12MHz, resolution 83ns, wraps every 357913ms
6,26,115,-;Calibrating delay loop... 298.59 BogoMIPS (lpj=1492992)
6,27,70136,-;pid_max: default: 32768 minimum: 301
6,28,70532,-;Mount-cache hash table entries: 512
6,29,72135,-;CPU: Testing write buffer coherency: ok
6,30,72898,-;Setting up static identity map for 0xc02a3b78 - 0xc02a3bd0
6,31,72952,-;L310 cache controller enabled
6,32,72973,-;l2x0: 8 ways, CACHE_ID 0x410000c9, AUX_CTRL 0x32420000, Cache size: 131072 B
3,33,74398,-;CPU1: Booted secondary processor
6,34,142988,-;Brought up 2 CPUs
6,35,143008,-;SMP: Total of 2 processors activated (598.42 BogoMIPS).
6,36,143014,-;CPU: All CPU(s) started in SVC mode.
6,37,144066,-;devtmpfs: initialized
6,38,148249,-;NET: Registered protocol family 16
6,39,148817,-;DMA: preallocated 256 KiB pool for atomic coherent allocations
6,40,150956,-;Serial: AMBA PL011 UART driver
6,41,151086,-;uart:0: ttyAMA0 at MMIO 0x10030000 (irq = 32) is a PL011 rev1
6,42,353219,-;console [ttyAMA0] enabled
6,43,356175,-;uart:1: ttyAMA1 at MMIO 0x10040000 (irq = 33) is a PL011 rev1
6,44,383913,-;bio: create slab <bio-0> at 0
6,45,389375,-;usbcore: registered new interface driver usbfs
6,46,393921,-;usbcore: registered new interface driver hub
6,47,398323,-;usbcore: registered new device driver usb
6,48,404753,-;Switching to clocksource timer0
6,49,412438,-;NET: Registered protocol family 2
6,50,417329,-;TCP established hash table entries: 512 (order: 0, 4096 bytes)
6,51,423012,-;TCP bind hash table entries: 512 (order: 0, 4096 bytes)
6,52,428055,-;TCP: Hash tables configured (established 512 bind 512)
6,53,433005,-;TCP: reno registered
6,54,434949,-;UDP hash table entries: 256 (order: 1, 8192 bytes)
6,55,439598,-;UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
6,56,445060,-;NET: Registered protocol family 1
6,57,448673,-;RPC: Registered named UNIX socket transport module.
6,58,453300,-;RPC: Registered udp transport module.
6,59,456699,-;RPC: Registered tcp transport module.
6,60,460145,-;RPC: Registered tcp NFSv4.1 backchannel transport module.
6,61,485394,-;squashfs: version 4.0 (2009/01/31) Phillip Lougher
6,62,492086,-;jffs2: version 2.2. (NAND) \xc2\xa9 2001-2006 Red Hat, Inc.
6,63,498066,-;fuse init (API version 7.22)
6,64,502072,-;msgmni has been set to 62
6,65,506905,-;Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
6,66,513072,-;io scheduler noop registered
6,67,515695,-;io scheduler deadline registered (default)
6,68,519622,-;io scheduler cfq registered
6,69,528479,-;dma-pl330 dma-pl330: Loaded driver for PL330 DMAC-267056
 SUBSYSTEM=amba
 DEVICE=+amba:dma-pl330
6,70,533550,-;dma-pl330 dma-pl330: \x09DBUFF-32x8bytes Num_Chans-4 Num_Peri-24 Num_Events-4
 SUBSYSTEM=amba
 DEVICE=+amba:dma-pl330
6,71,541031,-;uart-pl011 uart:0: no DMA platform data
 SUBSYSTEM=amba
 DEVICE=+amba:uart:0
6,72,544621,-;uart-pl011 uart:1: no DMA platform data
 SUBSYSTEM=amba
 DEVICE=+amba:uart:1
6,73,566200,-;brd: module loaded
6,74,577659,-;loop: module loaded
7,75,581159,-;XM Spi Flash Controller Device Driver Version 1.0
6,76,581771,-;XMSFCV2: flash name:W25Q64CV size:0x800000
5,77,586014,-;5 cmdlinepart partitions found on MTD device xm_sfc
5,78,590693,-;5 cmdlinepart partitions found on MTD device xm_sfc
5,79,595316,-;Creating 5 MTD partitions on "xm_sfc":
5,80,598869,-;0x000000000000-0x000000040000 : "boot"
5,81,604760,-;0x000000040000-0x000000050000 : "env"
5,82,610542,-;0x000000050000-0x000000250000 : "kernel"
5,83,616468,-;0x000000250000-0x000000750000 : "rootfs"
5,84,622502,-;0x000000750000-0x000000800000 : "rootfs_data"
6,85,629069,-;tun: Universal TUN/TAP device driver, 1.6
6,86,632824,-;tun: (C) 1999-2004 Max Krasnyansky <[email protected]>
6,87,639458,-;XMMMAC driver:\x0a\x09platform registration...
6,88,643124,-;\x09done!
6,89,645449,-;\x09eth0 - (dev. name: xmmaceth - id: -1, IRQ #35\x0a\x09IO base addr: 0xfe010000)
6,90,654364,-;libphy: XMMMAC MII Bus: probed
6,91,657170,-;eth0: PHY ID 00010000 at 1 IRQ 0 (0:01) active
6,92,662384,-;TCP: cubic registered
6,93,664409,-;NET: Registered protocol family 17
5,94,667764,-;Key type dns_resolver registered
6,95,670860,-;VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
6,96,678734,-;registered taskstats version 1
6,97,684264,-;VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
6,98,694714,-;devtmpfs: mounted
6,99,697022,-;Freeing unused kernel memory: 148K (c0302000 - c0327000)
5,100,1361769,-;jffs2: notice: (351) jffs2_build_xattr_subsystem: complete building xattr subsystem, 6 of xdatum (0 unchecked, 6 orphan) and 6 of xref (0 dead, 6 orphan) found.
3,101,1438829,-;devpts: called with bogus options
6,102,4027850,-;libphy: 0:01 - Link is Up - 100/Full
6,103,9018402,-;xm_i2c init is ok!
6,104,9052599,-;mmz: init ok start=0x82300000, size=0x1d00000
6,105,9063895,-;VI: init ok!
0,106,9105796,-;IspKo: ispDev_init start!
0,107,9107008,-;IspKo: ispDev_init OK!
6,108,9126601,-;hx280enc: module init - base_port=0x20070000 irq=77
6,109,9127557,-;hx280enc: HW at base <0x20070000> with ID <0x82900760>
6,110,9127652,-;hx280enc: module inserted. Major <0>
6,111,9137945,-;xm_rtc init is ok!
6,112,9148444,-;xm_wdt init is ok!
6,113,9245348,-;acodec init is ok!
3,114,9259018,-;MVE: Failed to create 'mve' dir.
3,115,9259037,-;MVE: Failed to create 'dmesg' dir.
3,116,9259090,-;MVE: Failed to create 'ram0' dir.
3,117,9259100,-;MVE: Failed to create 'ram0/msg.
3,118,9259107,-;MVE: Failed to create 'generic' dir.
3,119,9259113,-;MVE: Failed to create 'scheduler' dir.
3,120,9259120,-;MVE: Failed to create 'firmware_interface' dir.
3,121,9259126,-;MVE: Failed to create 'session' dir.
0,122,9260275,-;MVE resource driver loaded successfully (nlsid=4, cores=1, version=0x56550002)
0,123,9311398,-;MVE base driver loaded successfully
3,124,10833599,-;i2c_write timeout 0x2
3,125,10875623,-;i2c_write timeout 0x2
3,126,10917662,-;i2c_write timeout 0x2
3,127,10959817,-;i2c_write timeout 0x2
3,128,11001860,-;i2c_write timeout 0x2
3,129,11046119,-;i2c_write timeout 0x2
3,130,11088274,-;i2c_write timeout 0x2
0,131,11602956,-;IspKo: [IspDrv]: Memery Init Buffer!Num[2]
3,132,23003309,-;i2c_write timeout 0x2
3,133,23045737,-;i2c_write timeout 0x2
3,134,23088567,-;i2c_write timeout 0x2
3,135,23154022,-;i2c_write timeout 0x2
3,136,23196408,-;i2c_write timeout 0x2
3,137,23239083,-;i2c_write timeout 0x2
3,138,149221039,-;i2c_write timeout 0x2
3,139,149263065,-;i2c_write timeout 0x2
3,140,149305101,-;i2c_write timeout 0x2
3,141,149347225,-;i2c_write timeout 0x2
3,142,149389282,-;i2c_write timeout 0x2
3,143,149433527,-;i2c_write timeout 0x2
3,144,149475605,-;i2c_write timeout 0x2
3,145,219155636,-;i2c_write timeout 0x2
3,146,219197671,-;i2c_write timeout 0x2
3,147,219239786,-;i2c_write timeout 0x2
3,148,219281893,-;i2c_write timeout 0x2
3,149,219323927,-;i2c_write timeout 0x2
3,150,219368166,-;i2c_write timeout 0x2
3,151,219410269,-;i2c_write timeout 0x2
3,152,275583373,-;i2c_write timeout 0x2
3,153,275625419,-;i2c_write timeout 0x2
3,154,275667518,-;i2c_write timeout 0x2
3,155,275709614,-;i2c_write timeout 0x2
3,156,275751668,-;i2c_write timeout 0x2
3,157,275795907,-;i2c_write timeout 0x2
3,158,275837984,-;i2c_write timeout 0x2
3,159,370417035,-;i2c_write timeout 0x2
3,160,370459075,-;i2c_write timeout 0x2
3,161,370501197,-;i2c_write timeout 0x2
3,162,370543303,-;i2c_write timeout 0x2
3,163,370585337,-;i2c_write timeout 0x2
3,164,370629582,-;i2c_write timeout 0x2
3,165,370671670,-;i2c_write timeout 0x2
3,166,471707969,-;i2c_write timeout 0x2
3,167,471749996,-;i2c_write timeout 0x2
3,168,471792240,-;i2c_write timeout 0x2
3,169,471834364,-;i2c_write timeout 0x2
3,170,471876407,-;i2c_write timeout 0x2
3,171,471920650,-;i2c_write timeout 0x2
3,172,471962752,-;i2c_write timeout 0x2
login as: root
[email protected]'s password:

    /######                                    /######  /#######    /######
   /##__  ##                                  |_  ##_/ | ##__  ##  /##__  ##
  | ##  \ ##   /######    /######   /#######    | ##   | ##  \ ## | ##  \__/
  | ##  | ##  /##__  ##  /##__  ## | ##__  ##   | ##   | #######/ | ##
  | ##  | ## | ##  \ ## | ######## | ##  \ ##   | ##   | ##____/  | ##
  | ##  | ## | ##  | ## | ##_____/ | ##  | ##   | ##   | ##       | ##    ##
  |  ######/ | #######/ |  ####### | ##  | ##  /###### | ##       |  ######/
   \______/  | ##____/   \_______/ |__/  |__/ |______/ |__/        \______/
             | ##
             | ##                              build
             |__/                              master+5e19ba2, 2024-03-21

 Please help the OpenIPC Project to cover the cost of development and
 long-term maintenance of what we believe is going to become a stable,
 flexible Open IP Network Camera Framework for users worldwide.

 Your contributions could help us to advance the development and keep
 you updated on improvements and new features more regularly.

 Please visit https://openipc.org/sponsor/ to learn more. Thank you.

root@openipc-xm530:~# killall majestic
root@openipc-xm530:~# ulimit -c unlimited
root@openipc-xm530:~# echo /tmp/%e.%p.%s.%t.core > /proc/sys/kernel/core_pattern
root@openipc-xm530:~# majestic
LIBH264: Complied at Apr 30 2019 16:55:22
11:15:57  <       majestic> [    main] main@240                      Majestic Lite for Xiongmai, version master+18c71e2, built on 2024-03-21
11:15:57  <       majestic> [watchdog] watchdog_start@111            Watchdog timeout set to 300 seconds
11:15:57  <       majestic> [   httpd] start_web_server@381          Set server path: /var/www
11:15:57  <       majestic> [   httpd] new_http_server@369           HTTP server started on 0.0.0.0:80
11:15:57  <       majestic> [    main] init_sdk@66                   Loading main configuration: /etc/majestic.yaml
DEBUG: [ISP_SDK]BUILD TIME:Sep 21 2021 11:58:04
DEBUG: OSC:12M
11:15:57  <       majestic> [     log] printf@292                    SYS/VI set in      [ Sofia ]
11:15:57  <       majestic> [     log] printf@292                    Vstd_init  [ PAL ]
11:15:57  <       majestic> [     log] printf@292                    Rslt       [ 0 ]
11:15:57  <       majestic> [     log] printf@292                    IPC_Venc:  [ H.264 ]
11:15:57  <       majestic> [     log] printf@292                    Sns_IF:    [ By src ]

DEBUG: sensor_get_chip:
11:15:58  <       majestic> [     log] printf@292                    0x1a
 11:15:58  <       majestic> [     log] printf@292                    0x2
 11:15:58  <       majestic> [     log] printf@292                    0x1
 11:15:58  <       majestic> [     log] printf@292                    0x34
11:15:58  <       majestic> [    puts]
ERR: open /mnt/mtd/Config/SensorType.bat failed
DEBUG: Venc(264):495
DEBUG: DspChip:XM530
DEBUG: SnsIF:MIPI
DEBUG: Vstd:PAL[25fps]
DEBUG: ------------- IMX307 2M 30fps  init ok! (@201812111)----------------
DEBUG: sensor_init Ok!
DEBUG: cmos_fps_set IMX307 2M 25fps
DEBUG: cmos_fps_set IMX307 2M 25fps
DEBUG: Init over ~~~~~~~~
DEBUG: ProductType: 0x0
DEBUG: libfvideo: IMX307!
DEBUG: isp_sample end!
DEBUG: imageStyle XM!
11:15:58  <       majestic> [     sdk] ViChnConfig@164               ViChn = 0, enSize = 14
11:15:58  <       majestic> [     sdk] ViChnConfigEx@188             ViChn = 1, enSize = 0
11:15:58  <       majestic> [     sdk] COMM_VENC_Start@249           VencChn = 0, enType = 96, enSize = 14 (1920x1080), enRcMode = 1
11:15:58  <move_detect_pro> [    puts]                               XM_MPI_ISP_MemInit OK...
11:15:58  <       majestic> [     sdk] COMM_VENC_Start@249           VencChn = 1, enType = 96, enSize = 0 (704x576), enRcMode = 1
11:15:58  <       majestic> [     sdk] COMM_VENC_Start@249           VencChn = 2, enType = 26, enSize = 0 (704x576), enRcMode = 1
11:15:58  <       majestic> [    rtsp] rtsp_init@28                  RTSP server started on port 554
DEBUG: black and white
DEBUG: EShutter 1/1
DEBUG: gu8OemStyle: 0
DEBUG: color
11:16:02  <       majestic> [     sdk] sdk_take_jpeg@866             take jpeg venc_chn(2)   0x0  q:50
11:16:02  <       majestic> [  on_jpg] send_regular_jpeg@55          JPEG was sent to client
DEBUG: Delay Over !!!
11:17:05  <       majestic> [     sdk] sdk_take_jpeg@866             take jpeg venc_chn(2)   0x0  q:50
11:17:05  <       majestic> [  on_jpg] send_regular_jpeg@55          JPEG was sent to client
11:17:23  <       majestic> [  client] RtspClient_before@402         RTSP OPTIONS rtsp://10.10.10.114:554/stream=0 CSeq=1 from 10.10.10.130:36808
11:17:23  <       majestic> [  client] RtspClient_before@402         RTSP OPTIONS rtsp://10.10.10.114:554/stream=0 CSeq=2 from 10.10.10.130:36808
11:17:23  <       majestic> [  client] RtspClient_before@402         RTSP DESCRIBE rtsp://10.10.10.114:554/stream=0 CSeq=3 from 10.10.10.130:36808
11:17:23  <       majestic> [     nal] NalCodec_describe@117         RTSP chn 0 sps_len 0
11:17:23  <       majestic> [     nal] NalCodec_describe@120         RTSP chn 0 pps_len 0
11:17:23  <       majestic> [     nal] NalCodec_describe@128         RTSP chn 0 profile_level_id 000000
11:17:23  <       majestic> [  client] RtspClient_before@402         RTSP SETUP rtsp://10.10.10.114:554/stream=0/video CSeq=4 from 10.10.10.130:36808
11:17:23  <       majestic> [  client] RtspClient_setup@313          TCP RTSP SETUP done, stream_id=0 from 10.10.10.130:36808
11:17:23  <       majestic> [  client] RtspClient_before@402         RTSP PLAY rtsp://10.10.10.114:554/stream=0 CSeq=5 from 10.10.10.130:36808
11:17:23  <       majestic> [  levent] libevent_log_cb@24            Epoll ADD(4) on fd 34 failed. Old events were 0; read change was 0 (none); write change was 1 (add); close change was 0 (none): Bad file descriptor
Segmentation fault
root@openipc-xm530:~#

No files was created in the /tmp/ folder for core dump

Issue description

Any RTSP client causes segmentation fault crash of majestic. Tried this old build of OpenIPC to see if the new buildroot causes the problem but it seems it is not the case. The latest OpenIPC build acts exactly the same.

Expectations

Expect it not to segfault! :-P

Steps to reproduce

  1. firstboot
  2. enable video1
  3. connect rtsp client

Information to attach

majestic.yaml.txt

tERB00 avatar May 01 '24 11:05 tERB00