quiniouben / vban

VBAN protocol open-source implementation
GNU General Public License v3.0
450 stars 63 forks source link

Segmentation fault #2

Closed tkgafs closed 8 years ago

tkgafs commented 8 years ago

Just trying code out on a raspberry pi b+

but get a segmentation fault when running binary

here is output from make

pi@raspberrypi:~/Downloads/vban/vban_receptor-master $ make Making all in src make[1]: Entering directory '/home/pi/Downloads/vban/vban_receptor-master/src' gcc -DPACKAGE_NAME=\"vban_receptor\" -DPACKAGE_TARNAME=\"vban_receptor\" -DPACKAGE_VERSION=\"v0.5\" -DPACKAGE_STRING=\"vban_receptor\ v0.5\" -DPACKAGE_BUGREPORT=\"quiniouben@yahoo.fr\" -DPACKAGE_URL=\"\" -DPACKAGE=\"vban_receptor\" -DVERSION=\"v0.5\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_ALSA_ASOUNDLIB_H=1 -DHAVE_LIBASOUND=1 -DHAVE_ARPA_INET_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_NETINET_IN_H=1 -DHAVE_STDDEF_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_INET_NTOA=1 -DHAVE_MEMSET=1 -DHAVE_SOCKET=1 -DHAVE_STRERROR=1 -I. -ansi -Wpedantic -Wall -Wno-multichar -O2 -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c mv -f .deps/main.Tpo .deps/main.Po gcc -DPACKAGE_NAME=\"vban_receptor\" -DPACKAGE_TARNAME=\"vban_receptor\" -DPACKAGE_VERSION=\"v0.5\" -DPACKAGE_STRING=\"vban_receptor\ v0.5\" -DPACKAGE_BUGREPORT=\"quiniouben@yahoo.fr\" -DPACKAGE_URL=\"\" -DPACKAGE=\"vban_receptor\" -DVERSION=\"v0.5\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_ALSA_ASOUNDLIB_H=1 -DHAVE_LIBASOUND=1 -DHAVE_ARPA_INET_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_NETINET_IN_H=1 -DHAVE_STDDEF_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_INET_NTOA=1 -DHAVE_MEMSET=1 -DHAVE_SOCKET=1 -DHAVE_STRERROR=1 -I. -ansi -Wpedantic -Wall -Wno-multichar -O2 -g -O2 -MT audio.o -MD -MP -MF .deps/audio.Tpo -c -o audio.o audio.c audio.c: In function ‘audio_write’: audio.c:327:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t’ [-Wformat=] printf("audio_write: short write (expected %lu, wrote %i)\n", size, ret); ^ mv -f .deps/audio.Tpo .deps/audio.Po gcc -DPACKAGE_NAME=\"vban_receptor\" -DPACKAGE_TARNAME=\"vban_receptor\" -DPACKAGE_VERSION=\"v0.5\" -DPACKAGE_STRING=\"vban_receptor\ v0.5\" -DPACKAGE_BUGREPORT=\"quiniouben@yahoo.fr\" -DPACKAGE_URL=\"\" -DPACKAGE=\"vban_receptor\" -DVERSION=\"v0.5\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_ALSA_ASOUNDLIB_H=1 -DHAVE_LIBASOUND=1 -DHAVE_ARPA_INET_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_NETINET_IN_H=1 -DHAVE_STDDEF_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_INET_NTOA=1 -DHAVE_MEMSET=1 -DHAVE_SOCKET=1 -DHAVE_STRERROR=1 -I. -ansi -Wpedantic -Wall -Wno-multichar -O2 -g -O2 -MT socket.o -MD -MP -MF .deps/socket.Tpo -c -o socket.o socket.c mv -f .deps/socket.Tpo .deps/socket.Po gcc -ansi -Wpedantic -Wall -Wno-multichar -O2 -g -O2 -lasound -o vban_receptor main.o audio.o socket.o -lasound make[1]: Leaving directory '/home/pi/Downloads/vban/vban_receptor-master/src' make[1]: Entering directory '/home/pi/Downloads/vban/vban_receptor-master' make[1]: Nothing to be done for 'all-am'. make[1]: Leaving directory '/home/pi/Downloads/vban/vban_receptor-master'

and command used to run binary

pi@raspberrypi:/usr/local/bin $ ./vban_receptor --ipaddress=192.168.0.43 --port=6980 --stream=Stream1 vban_receptor version v0.5 Segmentation fault

are there any debugging options which would help locate issue

tkgafs commented 8 years ago

just tried this again but using command line

./vban_receptor -i 192.168.0.43 -p 6980 -s Stream1

and it works correctly

quiniouben commented 8 years ago

Hi, sorry for the delay in my answer and thanks a lot for your feedback. As I understand, you can use the application thanks to your second comment's command line but the first one crashes. If I see it correctly, the difference is the usage of long-options instead of short ones. I will investigate this and give feedback asap. As for a debugging options, there is unfortunately none, but default compilation enables debug symbols in the binary, so you should be able to simply run the software in gdb and have a backtrace of the crash. If you are familiar with the usage of a debugger, it should not be a problem. If you are not, don't worry I will investigate first if I can reproduce this (I have some raspberry pi devices) and/or I can give you short instructions if you wish to try it out.

tkgafs commented 8 years ago

yes the fault occurs if you use the long-options, short options work fine

Tim

On 18-Jan-16 10:46 AM, quiniouben wrote:

Hi, sorry for the delay in my answer and thanks a lot for your feedback. As I understand, you can use the application thanks to your second comment's command line but the first one crashes. If I see it correctly, the difference is the usage of long-options instead of short ones. I will investigate this and give feedback asap. As for a debugging options, there is unfortunately none, but default compilation enables debug symbols in the binary, so you should be able to simply run the software in gdb and have a backtrace of the crash. If you are familiar with the usage of a debugger, it should not be a problem. If you are not, don't worry I will investigate first if I can reproduce this (I have some raspberry pi devices) and/or I can give you short instructions if you wish to try it out.

— Reply to this email directly or view it on GitHub https://github.com/quiniouben/vban_receptor/issues/2#issuecomment-172495091.


Avast logo https://www.avast.com/antivirus

This email has been checked for viruses by Avast antivirus software. www.avast.com https://www.avast.com/antivirus


This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

quiniouben commented 8 years ago

Ok, your long option --stream is invalid (it's --streamname) and my code was not handling wrong options correctly. fixed.