View Issue Details

IDProjectCategoryView StatusLast Update
0002900Ham Radio DeluxeBugpublic2018-11-11 00:34
ReporterK7ZCZ 
Assigned ToK7ZCZ 
PrioritynormalSeveritycrashReproducibilityhave not tried
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version6.4.0.902 
Summary0002900: Digital Master: May crash while trying to post message from HRD Interface
DescriptionTicket 508543 contains several minidumps; DigitalMaster_20180916_180608.mdmp shows a crash when one of the background processing threads tries to call into HRDInterface and fails. In response, it tries to add a message to the Logfile window. That action causes the crash.
Steps To ReproduceNo repro steps have been provided.
Additional Information
0:003> .ecxr
eax=07b60020 ebx=ffffffff ecx=6c7333b0 edx=00000000 esi=0658ae38 edi=01eb00b4
eip=6c59481b esp=0da1b8b0 ebp=0da1b8f4 iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010246
HRDInterface001!CHRDInterface001App::SendLogfileMessage+0x1cb:
6c59481b ff7020          push    dword ptr [eax+20h]  ds:002b:07b60040=????????
0:003> kp
  *** Stack trace for last set context - .thread/.cxr resets it
 # ChildEBP RetAddr  
00 0da1b8f4 6c594616 HRDInterface001!CHRDInterface001App::SendLogfileMessage(class ATL::CStringT<wchar_t,StrTraitMFC<wchar_t,ATL::ChTraitsCRT<wchar_t> > > * strText = 0x00000091)+0x1cb [c:\ham radio\digital master\hrdinterface001\messages.cpp @ 122] 
01 0da1b928 6c5922f6 HRDInterface001!CHRDInterface001App::AddError(wchar_t * lpszFormat = 0x0658eaa8 "Error connecting to 'localhost' port 7809 - No connection could be made because the target machine actively refused it. ")+0x106 [c:\ham radio\digital master\hrdinterface001\messages.cpp @ 89] 
02 0da1bc3c 0024722e HRDInterface001!HRDInterfaceConnect(wchar_t * lpszAddress = 0x0656c258 "localhost", unsigned short wPort = 0x1e81)+0x606 [c:\ham radio\digital master\hrdinterface001\hrdinterface001.cpp @ 227] 
03 0da1bcc4 0024a5d5 Digital_Master!CBackgroundProcessingThread::HRDData(struct HWND__ * hWnd = 0x00120d0c, struct RADIO_PANE_DATA * pData = 0x13561a60)+0x23e [c:\ham radio\digital master\digital master\backgroundprocessingthreadhrd.cpp @ 226] 
04 0da1fde0 00249d01 Digital_Master!CBackgroundProcessingThread::ProcessData(class CBkgPacket * pPkt = 0x0cca67f0)+0x875 [c:\ham radio\digital master\digital master\backgroundprocessingthreadpacket.cpp @ 1493] 
05 0da1fe1c 003e4635 Digital_Master!CBackgroundProcessingThread::DoWork(void)+0xd1 [c:\ham radio\digital master\digital master\backgroundprocessingthreadpacket.cpp @ 1069] 
06 0da1fe44 003e46c6 Digital_Master!CThinThread::Run(void)+0x85 [c:\ham radio\digital master\digital master\thinthread.cpp @ 182] 
07 0da1fe80 00423dc2 Digital_Master!CThinThread::Start(void * pv = 0x009e4ac8)+0x46 [c:\ham radio\digital master\digital master\thinthread.cpp @ 234] 
08 0da1ff28 0054d42f Digital_Master!_AfxThreadEntry(void * pParam = 0x0020d50c)+0xff [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 109] 
09 0da1ff60 0054d557 Digital_Master!_callthreadstartex(void)+0x1b [f:\dd\vctools\crt\crtw32\startup\threadex.c @ 376] 
0a 0da1ff6c 7548343d Digital_Master!_threadstartex(void * ptd = <Value unavailable error>)+0x7c [f:\dd\vctools\crt\crtw32\startup\threadex.c @ 354] 
0b 0da1ff78 779b9802 kernel32!BaseThreadInitThunk+0xe
0c 0da1ffb8 779b97d5 ntdll!__RtlUserThreadStart+0x70
0d 0da1ffd0 00000000 ntdll!_RtlUserThreadStart+0x1b
0:003> kb
  *** Stack trace for last set context - .thread/.cxr resets it
 # ChildEBP RetAddr  Args to Child              
00 0da1b8f4 6c594616 00000091 eef9d989 07e9c488 HRDInterface001!CHRDInterface001App::SendLogfileMessage+0x1cb [c:\ham radio\digital master\hrdinterface001\messages.cpp @ 122] 
01 0da1b928 6c5922f6 6c7333b0 0658eaa8 6c733384 HRDInterface001!CHRDInterface001App::AddError+0x106 [c:\ham radio\digital master\hrdinterface001\messages.cpp @ 89] 
02 0da1bc3c 0024722e 0656c258 00001e81 e458f2b9 HRDInterface001!HRDInterfaceConnect+0x606 [c:\ham radio\digital master\hrdinterface001\hrdinterface001.cpp @ 227] 
03 0da1bcc4 0024a5d5 00120d0c 13561a60 e458b39d Digital_Master!CBackgroundProcessingThread::HRDData+0x23e [c:\ham radio\digital master\digital master\backgroundprocessingthreadhrd.cpp @ 226] 
04 0da1fde0 00249d01 0cca67f0 e458b38d 0cd13cb0 Digital_Master!CBackgroundProcessingThread::ProcessData+0x875 [c:\ham radio\digital master\digital master\backgroundprocessingthreadpacket.cpp @ 1493] 
05 0da1fe1c 003e4635 e458b039 0000048c 022707d0 Digital_Master!CBackgroundProcessingThread::DoWork+0xd1 [c:\ham radio\digital master\digital master\backgroundprocessingthreadpacket.cpp @ 1069] 
06 0da1fe44 003e46c6 e458b0fd 0cd13cb0 0000048c Digital_Master!CThinThread::Run+0x85 [c:\ham radio\digital master\digital master\thinthread.cpp @ 182] 
07 0da1fe80 00423dc2 009e4ac8 e458b155 00000000 Digital_Master!CThinThread::Start+0x46 [c:\ham radio\digital master\digital master\thinthread.cpp @ 234] 
08 0da1ff28 0054d42f 0020d50c e458b11d 00000000 Digital_Master!_AfxThreadEntry+0xff [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 109] 
09 0da1ff60 0054d557 00000000 0da1ff78 7548343d Digital_Master!_callthreadstartex+0x1b [f:\dd\vctools\crt\crtw32\startup\threadex.c @ 376] 
0a 0da1ff6c 7548343d 0cc9e278 0da1ffb8 779b9802 Digital_Master!_threadstartex+0x7c [f:\dd\vctools\crt\crtw32\startup\threadex.c @ 354] 
0b 0da1ff78 779b9802 0cc9e278 70b3070d 00000000 kernel32!BaseThreadInitThunk+0xe
0c 0da1ffb8 779b97d5 0054d4db 0cc9e278 00000000 ntdll!__RtlUserThreadStart+0x70
0d 0da1ffd0 00000000 0054d4db 0cc9e278 00000000 ntdll!_RtlUserThreadStart+0x1b



TagsNo tags attached.
ModuleDM780
Sub-ModuleInterfacing
Testing Not Tested

Relationships

related to 0002845 closedWA9PIE V6.4.0.876 - Random crashes\Lockups\closing of LB and DM where both are affected at the same time. 

Activities

K7ZCZ

2018-09-18 09:10

manager   ~0006218

Looks like the m_pWndLogFile member is pointing at a deleted CWnd object in CHRDInterface001App::SendLogfileMessage().

In reviewing the code, I find that the m_pWndLogFile member is set by the LogFileWnd() accessor. The only call to that accessor is from the HRDInterfaceLogfileMessage() function, which is an API exposed from the HRDInterface001 DLL. The only calls to that API occur at the startup of the Logbook and Digital Master applications.

Conspicuously absent are any calls that disconnect the window when it is destroyed. The HRDInterfaceDisconnect() API might handle this implicitly, or the client code should be updated to notify the HRDInterface001 module that the window is no longer available and that further messages can't be / shouldn't be sent.

K7ZCZ

2018-09-18 09:31

manager   ~0006220

The dump for bug is in the archive "OSTicket #508543 DigitalMaster_20180917_161340.zip" in the Mantis2845 directory of the Google Drive dumps folder.

K7ZCZ

2018-09-20 08:52

manager   ~0006227

At startup, DM and the Logbook inform the "HRDInterface" library of a message ID and a CWnd object to use to pass messages. At shutdown, the window is destroyed and becomes invalid, but no provision is made in the HRDInterface library to inform the library that further notifications should be sent to the window. This is a pretty obvious oversight in the design of the library: there's a way to connect it, but no way to disconnect it.

I've added an API to the HRDInterface library to provide a mechanism for informing the library that the window has been closed. The new HRDInterfaceLogfileMessageOff API is now called when the window which receives the messages closes, which should improve matters.

This fix is shelved here:
https://hrdsoftware.visualstudio.com/HRD/_versionControl/shelveset?ss=HRDInterface%20close%20API%202900%3Bmikeblas%40msn.com

K7ZCZ

2018-10-20 12:43

manager   ~0006311

Last edited: 2018-10-20 12:43

View 2 revisions

Fixed with this checkin
https://hrdsoftware.visualstudio.com/HRD/_versionControl/changeset/4381

g3ucq

2018-10-21 04:29

viewer   ~0006320

Unable to test. Not a problem.

WA9PIE

2018-11-05 11:47

administrator   ~0006376

Accepted without testing, due to the nature of the change.

Issue History

Date Modified Username Field Change
2018-09-18 09:10 K7ZCZ New Issue
2018-09-18 09:10 K7ZCZ Note Added: 0006218
2018-09-18 09:24 K7ZCZ Relationship added related to 0002845
2018-09-18 09:31 K7ZCZ Note Added: 0006220
2018-09-20 08:52 K7ZCZ Note Added: 0006227
2018-10-20 12:43 K7ZCZ Assigned To => K7ZCZ
2018-10-20 12:43 K7ZCZ Status new => resolved
2018-10-20 12:43 K7ZCZ Resolution open => fixed
2018-10-20 12:43 K7ZCZ Sub-Module (select) => Interfacing
2018-10-20 12:43 K7ZCZ Note Added: 0006311
2018-10-20 12:43 K7ZCZ Note Edited: 0006311 View Revisions
2018-10-20 22:19 K7ZCZ Fixed in Version => 6.4.0.899
2018-10-21 04:29 g3ucq Note Added: 0006320
2018-11-04 07:49 K7ZCZ Fixed in Version 6.4.0.899 => 6.4.0.900
2018-11-05 11:47 WA9PIE Status resolved => closed
2018-11-05 11:47 WA9PIE Description Updated View Revisions
2018-11-05 11:47 WA9PIE Additional Information Updated View Revisions
2018-11-05 11:47 WA9PIE Testing Not Started => Not Tested
2018-11-05 11:47 WA9PIE Note Added: 0006376
2018-11-11 00:34 WA9PIE Fixed in Version 6.4.0.900 => 6.4.0.902
2018-11-11 00:34 WA9PIE Project 3 - Current Dev List => Ham Radio Deluxe