[USRP-users] Access violation in Debug UHD version in Windows

Vladimir www2008_2 at mail.ru
Thu Mar 31 13:53:37 EDT 2016

 Seems that I found at least workaround for this case. The problem place is around the line 903 in max287x.hpp:

    _write_all_regs = false;

That _write seems not to be able to handle empty "regs" (size() == 0 in destructor), so it was enough to put

    if (regs.size() > 0)

Don't know if this is proper way to fix it, but at least it stopped those nasty exceptions for me. I checked in VS2010/2012 for Win32/64 with both uhd_usrp_probe and rx_samples_to_file - now debug version exit normally.


>Четверг, 31 марта 2016, 15:55 +03:00 от Vladimir via USRP-users <usrp-users at lists.ettus.com>:
>I'm trying to get Debug version of uhd to work, using MSVS 2012. Generally, everything works, but I keep getting very stable exception at the exit of example programs (I started with uhd_usrp_probe, and tried rx_samples_to_file with the same result). I mean that programs themself work just fine, but access violation appears every time at the exit.
>Particularly, it says:
>Unhandled exception at 0x0F83DECC (uhd.dll) in uhd_usrp_probe.exe: 0xC0000005: access violation trying to read memory at 0xFEEEFEFB. (Original text is in Russian, it's my translation.)
>Initially, I started to build under VS 2010, then switched to 2012 to meet requirements listed on the web site. The error is very stable (the same in 2012 and 2010), exception arises only in Debug version at program exit (I build the whole BUILD_ALL and INSTALL projects as instructed on your site, Release version works fine).
>My config is the following:
>Windows 7 x64
>USRP X300 with UBX-160
>Intel X520-2 card
>MSVS 2010/2012
>UHD maint branch - 3.9.3
>From what I tried to trace and saw in the call stack, it crashes somewhere deep in one of the calls to ~max287x<max2871_regs_t> destructor. I'm not sure if the maillist allows to do attachements? - will try to attach the call stack log and uhd_probe log with this letter.
>I tried to isolate the simplest case - allow uhd_usrp_probe only to do dboard init and do series of returns up to the app level, starting right after this block:
>        //create the xcvr object for each subdevice
>        BOOST_FOREACH(const std::string &subdev, subdevs){
>            db_ctor_args.sd_name = subdev;
>            db_ctor_args.rx_id = rx_dboard_id;
>            db_ctor_args.tx_id = tx_dboard_id;
>            db_ctor_args.rx_subtree = subtree->subtree("rx_frontends/" + subdev);
>            db_ctor_args.tx_subtree = subtree->subtree("tx_frontends/" + subdev);
>            dboard_base::sptr xcvr_dboard = dboard_ctor(&db_ctor_args);
>            _rx_dboards[subdev] = xcvr_dboard;
>            _tx_dboards[subdev] = xcvr_dboard;
>        }
>in dboard_manager.cpp. I've had to make some patches to avoid exceptions from some uninitialized vars, but the code seems to act very predictable. It looks like the problem reproduces if we make a dboard_ctor() call and then try to exit the application using successive returns from all the funcs - then it crashes in the destructor of the dboard at the exit. If I try to "unwind" returns just before the above block - it exts form the app just fine, w/o access violation.
>Can you doublecheck that Debug version of uhd works without a glitch at your setup with this hardware (I beleive the main factor is UBX board)? What kind of workaround can I try to do here?
>Thank you in advance!
>USRP-users mailing list
>USRP-users at lists.ettus.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20160331/398ac1f1/attachment-0002.html>

More information about the USRP-users mailing list