SDIO cannot use on ...
 
Notifications
Clear all

We had a major storm through here recently and we suffered damage to the house roof and ceilings. I just received the quote to repair. I’m hoping that a small fraction of the 80,000 odd people that download SDIO and/or Desktop Info every month won’t mind chipping in a few dollars to help out. Click on the big blue button at the bottom of the page to help us keep a roof over our heads, literally!

Guests have read-only access to our forums. If you wish to participate you will need to register. Be sure to activate your account from the email sent to you when you register.

[Closed] SDIO cannot use on Windows 11 23H2 because "Exception: std::bad_cast" error

57 Posts
12 Users
8 Reactions
23.2 K Views
Glenn
(@glenn)
Member Admin
Joined: 7 years ago
Posts: 1546
 

@dandelionsprout It appears to have survived downloading the .torrent file and successfully read it. It looks like it's crashing on the 'while' loop downloading the torrent contents and not at the explicit cast I was expecting. Is the while loop actually an implicit cast?

while(downloadmangar_exitflag==DOWNLOAD_STATUS_DOWLOADING_DATA&&hSession)

I've put debug immediately before and immediately after this line to confirm.  Can you try the new build please.

https://www.glenn.delahoy.com/downloads/sdio/DEBUG_1152813_2.zip


   
(@dandelionsprout)
Active Member Registered
Joined: 2 months ago
Posts: 8
 

Indeed I can, and I think I've done so now. (The attachment.)


   
Glenn
(@glenn)
Member Admin
Joined: 7 years ago
Posts: 1546
 

@dandelionsprout Thanks. The while statement isn't the problem evidently. There's only two (or more) other possibilities. Can you run number 3 please.

https://www.glenn.delahoy.com/downloads/sdio/DEBUG_1152813_3.zip


   
(@dandelionsprout)
Active Member Registered
Joined: 2 months ago
Posts: 8
 

I think I've done so now, though the logger's results look similar to the previous one from what little I can tell.


   
Glenn
(@glenn)
Member Admin
Joined: 7 years ago
Posts: 1546
 

@dandelionsprout Thanks for that.

So here's what we have

        Log.print_debug("\n  while(downloadmangar_exitflag==DOWNLOAD_STATUS_DOWLOADING_DATA&&hSession)  \n");

        while(downloadmangar_exitflag==DOWNLOAD_STATUS_DOWLOADING_DATA&&hSession)
        {
        Log.print_debug("  inside the while loop  \n");
            Sleep(500);
        Log.print_debug("  short snooze  \n");

the log shows the first two debug lines and not the third.

This is the end of the log file:

{torrent_start

  while(downloadmangar_exitflag==DOWNLOAD_STATUS_DOWLOADING_DATA&&hSession)  
  inside the while loop  
ERROR: Exception: std::bad_cast

}stop logging

 

It would seem as though it's crashing on the Sleep(500) command. I would say that's probably the most innocuous line of code in the whole project.

Right now I'm open to any ideas from anyone that understands C++

 


   
Glenn
(@glenn)
Member Admin
Joined: 7 years ago
Posts: 1546
 

This afternoon I read this:

https://learn.microsoft.com/en-us/cpp/cpp/bad-cast-exception?view=msvc-170

So I did a big search for "dynamic_cast" and put a debug log entry before each one. Here's number 4!

https://www.glenn.delahoy.com/downloads/sdio/DEBUG_1152813_4.zip


   
Glenn
(@glenn)
Member Admin
Joined: 7 years ago
Posts: 1546
 

fyi: you can add "-preservecfg"  to the sdio.cfg file to prevent it from rewriting the cfg file when it closes.


   
Glenn
(@glenn)
Member Admin
Joined: 7 years ago
Posts: 1546
 

Posted by: @glenn

This afternoon I read this:

https://learn.microsoft.com/en-us/cpp/cpp/bad-cast-exception?view=msvc-170

So I did a big search for "dynamic_cast" and put a debug log entry before each one. Here's number 4!

https://www.glenn.delahoy.com/downloads/sdio/DEBUG_1152813_4.zip

Anyone????

 


   
(@nikitavoz)
New Member Registered
Joined: 8 months ago
Posts: 2
 

Posted by: @glenn

https://www.glenn.delahoy.com/downloads/sdio/DEBUG_1152813_4.zip

That archive was not easy to unpack, Windows 10 Explorer and WinRAR 7.10 failed. 7-Zip succeeded.

Here's the logs after error:

 


   
Glenn reacted
Glenn
(@glenn)
Member Admin
Joined: 7 years ago
Posts: 1546
 

Thanks for that. I'll have to study this. On the face of it, it makes no sense.


   
(@nikitavoz)
New Member Registered
Joined: 8 months ago
Posts: 2
 

By the way, SDI 1.25.3 (R2503) have the same issue.


   
Glenn reacted
Glenn
(@glenn)
Member Admin
Joined: 7 years ago
Posts: 1546
 

Just tested on new installs of 22H2 and 23H2 and it worked perfectly. Maybe it has something to do with the specific network driver?


   
Page 4 / 4
Glenn's Page