Trying to debug in issue in my code
Hi, I am trying to debug an issue in my code, and want to gain a bit more visibility on the issue.
My crash is:
Thread 1 "connectwave" received signal SIGSEGV, Segmentation fault. 0x00007ffff7dbfae2 in alsa_lib_resampler_process_int () from /lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_speexrate.so (gdb) bt #0 0x00007ffff7dbfae2 in alsa_lib_resampler_process_int () at /lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_speexrate.so #1 0x00007ffff7dbfd79 in alsa_lib_resampler_process_interleaved_int () at /lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_speexrate.so #2 0x00007ffff7dbe22d in () at /lib/x86_64-linux-gnu/alsa-lib/libasound_module_rate_speexrate.so #3 0x00007ffff7d2ac52 in do_convert (dst_areas=0x5555558b4820, dst_offset=0, dst_frames=45812269, src_areas=<optimized out>, src_offset=<optimized out>, src_frames=1024, channels=2, rate=0x5555558b4650) at pcm_rate.c:526 #4 0x00007ffff7d2ba30 in snd_pcm_rate_read_areas1 (slave_offset=<optimized out>, slave_areas=<optimized out>, offset=0, areas=0x5555558b4820, pcm=0x5555558af8e0) at pcm_rate.c:557 #5 snd_pcm_rate_grab_next_period (hw_offset=0, pcm=0x5555558af8e0) at pcm_rate.c:826 #6 snd_pcm_rate_avail_update_capture (slave_size=1056, pcm=0x5555558af8e0) at pcm_rate.c:971 #7 snd_pcm_rate_avail_update (pcm=0x5555558af8e0) at pcm_rate.c:996 #8 0x00007ffff7d101e2 in __snd_pcm_avail_update (pcm=0x5555558af8e0, pcm=0x5555558af8e0) at pcm_local.h:436 #9 snd1_pcm_read_areas (pcm=pcm@entry=0x5555558af8e0, areas=areas@entry=0x7fffffffd5d0, offset=offset@entry=0, size=size@entry=512, func=func@entry=0x7ffff7d1c110 <snd_pcm_mmap_read_areas>) at pcm.c:7437 #10 0x00007ffff7d1c560 in snd_pcm_mmap_readi (pcm=0x5555558af8e0, buffer=<optimized out>, size=512) at pcm_mmap.c:203 #11 0x00007ffff7de5bea in rdalsapcmin (p=21, buff=0x7fffffffd6a0 "\250\327TVUU", len=512) at linux/sound.c:1735 #12 0x00007ffff7dec5a3 in pa_rdwave (p=21, buff=0x7fffffffd6a0 "\250\327TVUU", len=512) at linux/sound.c:5462 #13 0x00005555555555a4 in main (argc=3, argv=0x7fffffffdfb8) at sound_programs/connectwave.c:106
I gather that the target routine of the crash, alsa_lib_resampler_process_int(), is in the alsa-plugins module, so I downloaded alsa-plugins-1.2.5 just so I could gain some insight into what the code is doing when it crashes. I should state quickly here that I believe the crash is my fault, but I am just trying to figure out why it is happening.
I was unable to find the routine alsa_lib_resampler_process_int() in that package. Also a ./configure followed by make does not work on it (goes to the idea of substituting my own compiled .so for debug purposes):
/home/samiam/projects/alsa/alsa-plugins-1.2.5/usb_stream/pcm_usb_stream.c:480: undefined reference to `snd_config_get_card'
Although obviously I didn't put a lot of effort into making it work.
DId the routine alsa_lib_resampler_process_int() get eliminated in later editions of the plugins? or am I looking in the wrong place?
Thanks in advance,
Scott Franco San Jose, CA
On Sat, Jul 24, 2021 at 8:58 AM samiam moorecad.com samiam@moorecad.com wrote:
Hi, I am trying to debug an issue in my code, and want to gain a bit more visibility on the issue.
Hello, Scott!
I gather that the target routine of the crash, alsa_lib_resampler_process_int(), is in the alsa-plugins module, so I downloaded alsa-plugins-1.2.5 just so I could gain some insight into what the code is doing when it crashes. I should state quickly here that I believe the crash is my fault, but I am just trying to figure out why it is happening.
I was unable to find the routine alsa_lib_resampler_process_int() in that package. Also a ./configure followed by make does not work on it (goes to the idea of substituting my own compiled .so for debug purposes):
/home/samiam/projects/alsa/alsa-plugins-1.2.5/usb_stream/pcm_usb_stream.c:480: undefined reference to `snd_config_get_card'
snd_config_get_card is a new function in alsa-lib 1.2.5 and you're probably linking against an old version of alsa-lib which won't work! See: https://www.alsa-project.org/wiki/Changes_v1.2.4_v1.2.5
Although obviously I didn't put a lot of effort into making it work.
DId the routine alsa_lib_resampler_process_int() get eliminated in later editions of the plugins? or am I looking in the wrong place?
See https://github.com/alsa-project/alsa-plugins/blob/master/pph/speex_resampler... and https://github.com/alsa-project/alsa-plugins/blob/3bd62394e75835df5dd0a9874c...
From my understanding of that code, it renames
speex_resampler_process_int to alsa_lib_resampler_process_int to avoid symbol name clashes.
Regards, Geraldo Nascimento
participants (2)
-
Geraldo Nascimento
-
samiam moorecad.com