LEDscape icon indicating copy to clipboard operation
LEDscape copied to clipboard

Running matrix-udp-rx without options causes a segfault

Open cibomahto opened this issue 10 years ago • 3 comments

Started in 6dbec3c10b04bd59cad94f5fe19a46a7cfb461bf when getoptified was added:

root@beaglebone:/home/debian/LEDscape# bin/matrix-udp-rx 512 x 64, UDP port 9999 AM33XX pru_init: PRU 0: data 0xb6c45000 @ 8192 bytes, DMA 0xb6bc5000 / 9f340000 @ 262144 bytes File ./lib/matrix.bin open passed waiting for response got response Segmentation fault

root@beaglebone:/home/debian/LEDscape# bin/matrix-udp-rx -c sign.config 512 x 64, UDP port 9999 read 8 bytes 'matrix16' read 9 bytes '0,7 U 0,0' read 10 bytes '0,6 U 32,0' read 10 bytes '0,5 U 64,0' read 10 bytes '0,4 U 96,0' read 11 bytes '0,3 U 128,0' AM33XX pru_init: PRU 0: data 0xb6c32000 @ 8192 bytes, DMA 0xb6bb2000 / 9f340000 @ 262144 bytes File ./lib/matrix.bin open passed waiting for response got response main:172: received 4 bytes main:207: WARNING: Received packet 4 bytes, expected 98305 933 usec avg, max 10718.11 fps, actual 0.10 fps (over 1 frames) 2553 usec avg, max 3916.96 fps, actual 57.70 fps (over 577 frames)

Fix is probably to either require some configuration, or give default options that don't cause it to crash.

cibomahto avatar May 22 '14 04:05 cibomahto

Yeah, there are some rough edges on the config changes. Somewhere in the receive code it assumes a 512x64 display, but the default config is 256x128. this should be prioritized to be fixed in the next round of updates.

osresearch avatar May 27 '14 01:05 osresearch

Maybe this is related- the current head (21b35c2a9f1fdbe40b15c0f150e118e1a6133f70) seems to be crashing, with or without a config file specified.

root@beaglebone:/home/debian/LEDscape# bin/matrix-udp-rx tall-cylinder.config 512 x 64, UDP port 9999 AM33XX pru_init: PRU 0: data 0xb6c45000 @ 8192 bytes, DMA 0xb6bc5000 / 9e5c0000 @ 262144 bytes File ./lib/matrix.bin open passed waiting for response got response Segmentation fault

gdb suggests it's an address out of bounds in ledscape_matrix_panel_copy:

root@beaglebone:/home/debian/LEDscape# gdb --args bin/matrix-udp-rx tall-cylinder.config GNU gdb (GDB) 7.4.1-debian Copyright (C) 2012 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 "arm-linux-gnueabihf". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /home/debian/LEDscape/bin/matrix-udp-rx...done. (gdb) run Starting program: /home/debian/LEDscape/bin/matrix-udp-rx tall-cylinder.config [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". 512 x 64, UDP port 9999 AM33XX pru_init: PRU 0: data 0xb6cf9000 @ 8192 bytes, DMA 0xb6c79000 / 9e5c0000 @ 262144 bytes File ./lib/matrix.bin open passed waiting for response got response

Program received signal SIGSEGV, Segmentation fault. ledscape_matrix_panel_copy (rot=0, config=0x137e8, in=0x34048, out=0xb6c79018 <Address 0xb6c79018 out of bounds>) at ledscape.c:239 239 const uint32_t col = *col_ptr; (gdb)

cibomahto avatar May 27 '14 05:05 cibomahto

Ok, specifying the new-style command line option here allows it to run without segfault: bin/matrix-udp-rx -W 256 -H 64 -c /home/debian/LEDscape/sign.config

cibomahto avatar May 27 '14 07:05 cibomahto