View Issue Details

IDProjectCategoryView StatusLast Update
0002260Ham Radio DeluxeBugpublic2018-04-09 14:37
ReporterPD9FER 
Assigned ToK7ZCZ 
PrioritynormalSeverityminorReproducibilityunable to reproduce
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version6.4.0.806 
Summary0002260: Build 787 Logbook Crash on Google earth lookup (as well as spring and fall equinox)
DescriptionUser input:

Selected a log entry, then Lookup > Google Earth
Logbook crashes and cannot be restarted.
Throw the same error, and writes a mini-dump? such as HRDLogbook_20170922_181021.mdmp
Ticket system will not accept the file as it is so large.

Will try re-installing to see if I can clear this error.

v6.4.0.787 - not ready for 'prime time'. Unfortunately, I was travelling when this was in Beta test.
Steps To ReproduceSelected a log entry, then Lookup > Google Earth
Logbook crashes and cannot be restarted.
Additional Informationhttps://support.ham-radio-deluxe.com/scp/tickets.php?id=11809
Ticket# 257381

Minidump HRDLogbook_20170922_181941.zip in the root of our Google Drive
TagsNo tags attached.
ModuleLogbook
Sub-ModuleFunctional
Testing Beta Successful

Relationships

Activities

K7ZCZ

2017-09-22 15:11

manager   ~0004263

The "Lookup > Google Earth" command is in the context menu found when right-clicking on any logbook entry in the logbook record view.

WA9PIE

2018-02-26 11:02

administrator   ~0004325

From K7ZCZ:

I have checked in a fix to make GoogleEarth local to the build; no outside dependency necessary. But I think we need to investigate how GoogleEarth integration doesn't work at runtime.
https://hrdsoftware.visualstudio.com/HRD/_versionControl/changeset/3897

K7ZCZ

2018-03-11 10:27

manager   ~0004469

Not sure why that got pasted here; change set 3897 fixes the build, but doesn't address this crashing issue.

K7ZCZ

2018-03-11 10:35

manager   ~0004470

I can't seem to find the minidump mentioned by Ferry. I've asked him for help in finding it.

PD9FER

2018-03-11 16:08

viewer   ~0004474

Think it is deleted?

PD9FER

2018-03-11 16:11

viewer   ~0004475

No it still is in the dumps folder on drive,,, HRDLogbook_20170922_181941.zip

K7ZCZ

2018-03-16 19:49

manager   ~0004498

The supplied minidumps don't appear to be directly related to Google Earth. What they show is a bunch of math that's trying to use latitude and longitude to index into an array of bits while working on applying the sunlight curve to shadow parts of the screen. I can't see too deeply into the code, but it seems like the problem is most likely due to some part of that math over-stepping (or under-stepping) the allocated array. The code has no checks for valid ranges, and has no comments about the math it's doing so it will take a little while to suss out what's really happening.

Here's the call stach from the HRDLogbook_20170922_181941 file:

eax=ffffe3e0 ebx=00000001 ecx=00000000 edx=0002b9bc esi=065f5ed8 edi=0c756400
eip=00f057ff esp=0079c5e8 ebp=0079c6e4 iopl=0 nv up ei pl nz na pe cy
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00210207
HRDLogbook!CBackgroundImage::ApplySunlight+0x2ef:
00f057ff 8b0f mov ecx,dword ptr [edi] ds:002b:0c756400=????????
0:000> kb
  *** Stack trace for last set context - .thread/.cxr resets it
 # ChildEBP RetAddr Args to Child
00 0079c6e4 00f0417e 065f5e58 0aaeaf58 00000000 HRDLogbook!CBackgroundImage::ApplySunlight+0x2ef [c:\ham radio\hrdcommon\backgroundimage.cpp @ 3145]
01 0079c714 014f39db 065f5e58 00000144 31dfaa32 HRDLogbook!CBackgroundImage::LoadResourceMap+0x1be [c:\ham radio\hrdcommon\backgroundimage.cpp @ 1709]
02 0079c788 014f555e 0000011d 31dfaa82 7fffffff HRDLogbook!CMainFrame::InitPane+0x59b [c:\ham radio\logbook\hrdlogbook\mainfrm.cpp @ 1908]
03 0079c814 00f1072c 0079cb98 31dfa5d2 06377020 HRDLogbook!CMainFrame::OnCreate+0xfde [c:\ham radio\logbook\hrdlogbook\mainfrm.cpp @ 853]
04 0079c8c8 00ef47c6 01722a20 00000000 0079cb98 HRDLogbook!CWnd::OnWndMsg+0x314 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 2276]
05 0079c8e4 00f11c4a 00000001 00000000 0079cb98 HRDLogbook!CXTPCommandBarsSiteBase<CMDIFrameWnd>::OnWndMsg+0x46 [c:\ham radio\codejock software\mfc\xtreme toolkitpro v15.0.2\source\commandbars\xtpframewnd.h @ 190]
06 0079c904 00f0d2bd 00000001 00000000 0079cb98 HRDLogbook!CWnd::WindowProc+0x22 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 2094]
07 0079c974 00f0da72 06377020 00020298 00000001 HRDLogbook!AfxCallWndProc+0xb0 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 285]
08 0079c994 75692f8b 00020298 00000001 00000000 HRDLogbook!AfxWndProc+0x34 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 434]
09 0079c9c0 75685443 00f0da3e 00020298 00000001 user32!_InternalCallWinProc+0x2b
0a 0079caa8 7568509a 00f0da3e 00000000 00000001 user32!UserCallWinProcCheckWow+0x2d3
0b 0079cb0c 75690390 02b2be80 00000000 00000001 user32!DispatchClientMessage+0xea
0c 0079cb50 77e1411d 0079cb6c 00000068 0079d038 user32!__fnINLPCREATESTRUCT+0x70
0d 0079cbd4 75689394 00000000 0079cf60 0079cc30 ntdll!KiUserCallbackDispatcher+0x4d
0e 0079cebc 75688c5e 0079cf10 06cf0000 80000000 user32!VerNtUserCreateWindowEx+0x237
0f 0079cfa0 75688b08 0a9e2780 06cf0000 80000000 user32!CreateWindowInternal+0x152
10 0079cfe0 00f13218 00000000 016fb17c 0a9e2780 user32!CreateWindowExW+0x38
11 0079d048 00f0e7be 00000000 016fb17c 0a9e2780 HRDLogbook!IsolationAwareCreateWindowExW+0x58 [f:\dd\externalapis\windows\winblue\sdk\inc\winuser.inl @ 454]
12 0079d0b8 00f28c35 00000000 00000000 0a9e2780 HRDLogbook!CWnd::CreateEx+0xb7 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 743]
13 0079d0f8 00f292b9 00000000 0a9e2780 00cf8000 HRDLogbook!CFrameWnd::Create+0x7c [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\winfrm.cpp @ 624]
14 0079d14c 00f27ab2 00000080 00cf8000 00000000 HRDLogbook!CFrameWnd::LoadFrame+0xbc [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\winfrm.cpp @ 756]
15 0079d168 00ef4617 00000080 00cf8000 00000000 HRDLogbook!CMDIFrameWnd::LoadFrame+0x17 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\winmdi.cpp @ 270]
16 0079d184 0143681c 00000080 00cf8000 00000000 HRDLogbook!CXTPFrameWndBase<CMDIFrameWnd>::LoadFrame+0x17 [c:\ham radio\codejock software\mfc\xtreme toolkitpro v15.0.2\source\commandbars\xtpframewnd.h @ 231]
17 0079f8dc 013341b9 00000000 00000020 00000001 HRDLogbook!CHRDLogbookApp::InitInstance+0x10bc [c:\ham radio\logbook\hrdlogbook\hrdlogbook.cpp @ 1002]
18 0079f8f0 01332a29 00ed0000 00000000 00cc2298 HRDLogbook!AfxWinMain+0x46 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\winmain.cpp @ 37]
19 0079f93c 751e8744 0087e000 751e8720 458630b2 HRDLogbook!__tmainCRTStartup+0x12f [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c @ 618]
1a 0079f950 77e0582d 0087e000 4748887a 00000000 kernel32!BaseThreadInitThunk+0x24
1b 0079f998 77e057fd ffffffff 77e26385 00000000 ntdll!__RtlUserThreadStart+0x2f
1c 0079f9a8 00000000 01332aa7 0087e000 00000000 ntdll!_RtlUserThreadStart+0x1b



The crash occurrs in handling 32-bits-per-pixel bitmaps, here;; the marked line, which gets data out of m_lpSunlightBits, is the one causing the crash.

        case 32:
            //
            // To.
            //
            for (lLat = lLatLightStart ; lLat < lLatLightEnd; lLat++)
            {
                nOffset = (lHeight - 1) * (nDIBLineWidth) + lLon * sizeof(DWORD) - lLat * nDIBLineWidth;
                pdwBits = (DWORD*)&m_lpSunlightBits[nOffset]; // this line
                dwColour = *pdwBits;

                //
                // Get RGB.
                //
                r = (BYTE)((dwColour & RMASK_32) >> RRIGHT_32);
                g = (BYTE)((dwColour & GMASK_32) >> GRIGHT_32);
                b = (BYTE)((dwColour & BMASK_32) >> BRIGHT_32);

                nIndex = ((r >> 2) << 12) | ((g >> 2) << 6) | (b >> 2);

                r = GetRValue(g_colLight[nIndex]);
                g = GetGValue(g_colLight[nIndex]);
                b = GetBValue(g_colLight[nIndex]);

                dwColour = (DWORD)((r << RRIGHT_32) | (g << GRIGHT_32) | (b << BRIGHT_32));
                *pdwBits = dwColour;
            }
            break;
        }

K7ZCZ

2018-03-20 20:34

manager   ~0004515

This crash has appeared again at the same spot today (20 March, 2018).

It turns out that the dump posted above happened on 22 September, 2017. These dates have something in common; they're both equinoxes. At the equinoxes, the code that draws the grey line ends up getting some extreme values that cause some math to exceed the bounds of the bitmap memory, then cause the crash.

It's probably possible to fix or clamp the math; I did _not_ do that.

I did clamp access to the memory. There's a lot of copy-and-paste here, so I followed suit to be quick and simple. At each access of memory influenced by the sun-line calculation, I've added a check to make sure the offset ends up in range. This will avoid coloring bits outside of the bitmap range.

It's out for code review here:

https://hrdsoftware.visualstudio.com/HRD/_versionControl/shelveset?ss=fix%20exuinox%20crash%20%28Mantis%202260%29%3Bmikeblas%40msn.com

K7ZCZ

2018-03-21 09:21

manager   ~0004517

I have checked in this change to fix this issue. I'm not resolving this bug just yet because I believe a better fix is possible.

https://hrdsoftware.visualstudio.com/HRD/_versionControl/changeset/3982

K7ZCZ

2018-03-22 10:07

manager   ~0004518

Wasn't completely fixed and shouldn't have been marked "resolved"

K7ZCZ

2018-03-22 10:07

manager   ~0004519

This checkin provides a comprehensive fix.

https://hrdsoftware.visualstudio.com/HRD/_versionControl/changeset/3984

g3ucq

2018-03-22 14:22

viewer   ~0004525

Have made a few lookups and Google Earth has not crashed on me.
But most Lookups centre on Africa and not the location of the station.
Is that by design?

vk2byi

2018-03-23 20:59

viewer   ~0004554

Have tested with contacts in New Caledonia, Ceuta & Melilla and Marshall Is. after first ensuring that the contacts tested had their latitude & longitude populated using the feature fixed in 0001690 - winning!

No crashes and Google Earth pans and renders the source and destination markers, and the short path correctly. Fixed!

Mantis 2260 Test EA9ACD.jpg (256,582 bytes)
Mantis 2260 Test EA9ACD.jpg (256,582 bytes)
Mantis 2260 Test FK1TS.jpg (167,442 bytes)
Mantis 2260 Test FK1TS.jpg (167,442 bytes)
Mantis 2260 Test V73NC.jpg (136,083 bytes)
Mantis 2260 Test V73NC.jpg (136,083 bytes)

Issue History

Date Modified Username Field Change
2017-09-22 15:03 PD9FER New Issue
2017-09-22 15:11 K7ZCZ Note Added: 0004263
2018-02-26 11:01 WA9PIE Project 1 - Backlog => 3 - Current Dev List
2018-02-26 11:02 WA9PIE Status new => resolved
2018-02-26 11:02 WA9PIE Resolution open => fixed
2018-02-26 11:02 WA9PIE Fixed in Version => 6.4.0.791
2018-02-26 11:02 WA9PIE Testing => Not Started
2018-02-26 11:02 WA9PIE Note Added: 0004325
2018-02-26 11:05 WA9PIE Assigned To => K7ZCZ
2018-03-04 13:50 WA9PIE Status resolved => assigned
2018-03-04 13:50 WA9PIE Resolution fixed => open
2018-03-04 13:50 WA9PIE Fixed in Version 6.4.0.791 =>
2018-03-11 10:27 K7ZCZ Note Added: 0004469
2018-03-11 10:35 K7ZCZ Note Added: 0004470
2018-03-11 16:08 PD9FER Note Added: 0004474
2018-03-11 16:11 PD9FER Note Added: 0004475
2018-03-16 19:49 K7ZCZ Note Added: 0004498
2018-03-20 20:34 K7ZCZ Note Added: 0004515
2018-03-21 00:42 WA9PIE Status assigned => resolved
2018-03-21 00:42 WA9PIE Resolution open => fixed
2018-03-21 09:21 K7ZCZ Note Added: 0004517
2018-03-22 06:52 WA9PIE View Status private => public
2018-03-22 06:53 WA9PIE Summary Build 787 Logbook Crash on Google earth lookup => Build 787 Logbook Crash on Google earth lookup (as well as spring and fall equinox)
2018-03-22 07:05 WA9PIE Target Version => 6.4.0.797
2018-03-22 07:06 WA9PIE Fixed in Version => 6.4.0.797
2018-03-22 10:07 K7ZCZ Status resolved => confirmed
2018-03-22 10:07 K7ZCZ Note Added: 0004518
2018-03-22 10:07 K7ZCZ Status confirmed => resolved
2018-03-22 10:07 K7ZCZ Note Added: 0004519
2018-03-22 14:22 g3ucq Note Added: 0004525
2018-03-23 20:59 vk2byi File Added: Mantis 2260 Test FK1TS.jpg
2018-03-23 20:59 vk2byi File Added: Mantis 2260 Test EA9ACD.jpg
2018-03-23 20:59 vk2byi File Added: Mantis 2260 Test V73NC.jpg
2018-03-23 20:59 vk2byi Note Added: 0004554
2018-03-30 19:48 WA9PIE Testing Not Started => Beta Successful
2018-04-04 14:30 WA9PIE Status resolved => closed
2018-04-04 15:29 WA9PIE Target Version 6.4.0.797 =>
2018-04-07 19:23 WA9PIE Project 3 - Current Dev List => Ham Radio Deluxe
2018-04-07 19:25 WA9PIE Fixed in Version 6.4.0.797 => 6.4.0.805
2018-04-09 14:37 WA9PIE Fixed in Version 6.4.0.805 => 6.4.0.806