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

Running matrix-udp-rx without options causes a segfault #10

Open
cibomahto opened this issue May 22, 2014 · 3 comments
Open

Running matrix-udp-rx without options causes a segfault #10

cibomahto opened this issue May 22, 2014 · 3 comments

Comments

@cibomahto
Copy link
Collaborator

Started in 6dbec3c 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.

@osresearch
Copy link
Owner

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.

@cibomahto
Copy link
Collaborator Author

Maybe this is related- the current head (21b35c2) 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
Copy link
Collaborator Author

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

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