Hey Brian,

Thanks for the input. Yeah making the rx_streamers at the beginning and keeping 
them around resolves the issue in that test program -- no segfaults after 10000 
Rx iterations total from the two threads. Makes sense; if the issue is 
happening in rx_streamer creation, then we should do that as little as 
possible. We'd just have to re-create the streamers when we re-tune or some 
such.

I was perusing the docs and it also seems like there is also a more fundamental 
misunderstanding on my end. It looks like there can always only be one RX 
streamer at a time per multi_usrp object as per this little note in the docs: 
https://files.ettus.com/manual/classuhd_1_1device.html#a0a9e36f353dcce36b4dd8d394c8813e3
 unless I misunderstand. Curses! That seems to indicate that I am relying on 
undefined behavior in either case, even though everything seems to now work as 
expected.
Ideally the UHD would have complained that I was doing that! Ah well.

Time to re-architecture some stuff! 🙂


Thank you,
Andrew Fountain
Black River Systems Co., Inc.
162 Genesee Street
Utica, NY 13502


________________________________
From: Brian Padalino <bpadal...@gmail.com>
Sent: Tuesday, August 22, 2023 4:22 PM
To: Andrew Fountain <afount...@brsc.com>
Cc: usrp-users@lists.ettus.com <usrp-users@lists.ettus.com>
Subject: Re: [USRP-users] Re: UHD4 segmentation fault on creating rx_streamer

You don't often get email from bpadal...@gmail.com. Learn why this is 
important<https://aka.ms/LearnAboutSenderIdentification>
On Tue, Aug 22, 2023 at 4:16 PM Andrew Fountain via USRP-users 
<usrp-users@lists.ettus.com<mailto:usrp-users@lists.ettus.com>> wrote:
Here is the output of that program with a debug build of UHD v4.4.0.0 . It 
seems to point out this line 
https://github.com/EttusResearch/uhd/blob/UHD-4.4/host/lib/rfnoc/rfnoc_graph.cpp#L393<https://usg02.safelinks.protection.office365.us/?url=https%3A%2F%2Fgithub.com%2FEttusResearch%2Fuhd%2Fblob%2FUHD-4.4%2Fhost%2Flib%2Frfnoc%2Frfnoc_graph.cpp%23L393&data=05%7C01%7Cafountain%40brsc.com%7C080e13d2bdc743f6fddd08dba34d96b2%7C5ed13283606a46b1bd4f758a462df882%7C1%7C0%7C638283325860702606%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=DgXydmUT8Sx3Ut50BrPNkaBRYTbXTYO2O80zpAu%2F%2Fy4%3D&reserved=0>

It doesn't seem to be some weird threading issue related to getting multiple 
rx_streamers at the same time; adding a lock around that access to that 
get_rx_stream function still yields segmentation faults at the same point in 
get_rx_stream.

Are you sure?

Can you move the streamer creation to be outside of the for loop and just 
iterate on the stream args, issue command, and recv()?

Brian
_______________________________________________
USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-le...@lists.ettus.com

Reply via email to