View Issue Details

IDProjectCategoryView StatusLast Update
00031313 - Current Dev ListBugpublic2019-01-28 13:05
ReporterK7ZCZAssigned To 
PrioritynormalSeverityminorReproducibilitysometimes
Status newResolutionopen 
PlatformIntel i7-5960XOSWindows 10 Professional x64OS Version16299
Product Version6.5.0.187 
Target VersionFixed in Version 
Summary0003131: Satellite Tracker can hang when redrawing world map pane
Description
The Satellite Tracker app can end up hanging when trying to refresh the world map pane.


Steps To Reproduce

1) Start up Satellite Tracker
2) On the "Satellite Definitions" tab, use the "Enable all" toolbar button to mark all satellites
3) Use the "Next Passes" button on the main toolbar
4) In the resulting "Passes:1KUNS-PF" tab, mark the "World Map" toolbar button to display the world map tracking view
5) In the "Passes" tool bar, mark the "Only" radio button
6) Repeatedly select different satellites from the dropdown in the "Passes" tool bar, next to the "Only" radio button
TagsNo tags attached.
ModuleSatellite Tracking
Sub-ModuleAppearance/UI
TestingNot Started

Relationships

related to 0003061 closedK7ZCZ Ham Radio Deluxe Mini-dump generated after repeatedly changing satellites 

Activities

K7ZCZ

2019-01-28 12:32

administrator   ~0007102

I had a call stack here, but Mantis didn't save it.

The issue is that CPaneNextPasses::GetNextPassesEx() iterates over an array of satellites. It caches the size of that array, then works through the array, sometimes removing elements from the array as it goes. The loop uses the cached size of the array in its invariant rather than re-evaluating the size of the array.

K7ZCZ

2019-01-28 12:37

administrator   ~0007103

Turns on the bad code (the cached loop invariant) is copied to another function -- which might even be the original function, lost in the Mantis reset. In reproducing the problem, I find this call stack, where CPassesView::GetNextPassesEx() is (mostly) copy-and-paste from CPaneNextPasses::GetNextPassesEx().


>	HRDSatTrack.exe!CPassesView::GetNextPassesEx(CUIntArray & anAllAOS, CUIntArray & anAllLOS, CStringArray & astrAllName) Line 1640	C++
     HRDSatTrack.exe!CPassesView::OnRefresh() Line 719	C++
     HRDSatTrack.exe!CPassesView::Refresh() Line 668	C++
     HRDSatTrack.exe!CPassesFrame::OnSatellite(tagNMHDR * pNMHDR, long * pResult) Line 463	C++
     HRDSatTrack.exe!_AfxDispatchCmdMsg(CCmdTarget * pTarget, unsigned int nID, int nCode, void(CCmdTarget::*)() pfn, void * pExtra, unsigned int nSig, AFX_CMDHANDLERINFO * pHandlerInfo) Line 106	C++
     HRDSatTrack.exe!CCmdTarget::OnCmdMsg(unsigned int nID, int nCode, void * pExtra, AFX_CMDHANDLERINFO * pHandlerInfo) Line 372	C++
     HRDSatTrack.exe!CFrameWnd::OnCmdMsg(unsigned int nID, int nCode, void * pExtra, AFX_CMDHANDLERINFO * pHandlerInfo) Line 984	C++
     HRDSatTrack.exe!CXTPControl::NotifySite(CWnd * pSite, unsigned int code, NMXTPCONTROL * pNM) Line 497	C++
     HRDSatTrack.exe!NotifyExecute(CXTPControl * pControl, CWnd * pOwner) Line 333	C++
     HRDSatTrack.exe!CXTPControl::OnExecute() Line 575	C++
     HRDSatTrack.exe!CXTPControlComboBox::OnExecute() Line 850	C++
     HRDSatTrack.exe!CXTPControlComboBoxList::OnLButtonUp(unsigned int __formal, CPoint __formal) Line 196	C++
     HRDSatTrack.exe!CWnd::OnWndMsg(unsigned int message, unsigned int wParam, long lParam, long * pResult) Line 2612	C++
     HRDSatTrack.exe!CXTPCommandBar::OnWndMsg(unsigned int message, unsigned int wParam, long lParam, long * pResult) Line 2621	C++
     HRDSatTrack.exe!CWnd::WindowProc(unsigned int message, unsigned int wParam, long lParam) Line 2099	C++
     HRDSatTrack.exe!AfxCallWndProc(CWnd * pWnd, HWND__ * hWnd, unsigned int nMsg, unsigned int wParam, long lParam) Line 265	C++
     HRDSatTrack.exe!AfxWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned int wParam, long lParam) Line 418	C++
     user32.dll!__InternalCallWinProc@20()	Unknown
     user32.dll!UserCallWinProcCheckWow()	Unknown
     user32.dll!DispatchMessageWorker()	Unknown
     user32.dll!_DispatchMessageW@4()	Unknown
     HRDSatTrack.exe!AfxInternalPumpMessage() Line 181	C++
     HRDSatTrack.exe!CWinThread::PumpMessage() Line 900	C++
     HRDSatTrack.exe!CWinThread::Run() Line 629	C++
     HRDSatTrack.exe!CWinApp::Run() Line 787	C++
     HRDSatTrack.exe!AfxWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) Line 47	C++
     HRDSatTrack.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) Line 26	C++
     HRDSatTrack.exe!invoke_main() Line 123	C++
     HRDSatTrack.exe!__scrt_common_main_seh() Line 288	C++
     HRDSatTrack.exe!__scrt_common_main() Line 331	C++
     HRDSatTrack.exe!wWinMainCRTStartup() Line 17	C++
     kernel32.dll!@BaseThreadInitThunk@12()	Unknown
     ntdll.dll!__RtlUserThreadStart()	Unknown
     ntdll.dll!__RtlUserThreadStart@8()	Unknown

K7ZCZ

2019-01-28 13:05

administrator   ~0007104

Even with the speculative fix of not caching the array length, the issue persists. In CPassesView::GetNextPassesEx(), the arrSatellites array isn't adjusted during the loop, so this is no surprise.

For me, the issue is reproducable readily using a specific specific satellite. Perhaps it has to do with my QTH, which is at CN87. Here are the steps I'm using:

1) Start up Satellite Tracker
2) On the "Satellite Definitions" tab, use the "Enable all" toolbar button to mark all satellites
3) Use the "Next Passes" button on the main toolbar
4) In the resulting "Passes:1KUNS-PF" tab, mark the "World Map" toolbar button to display the world map tracking view
5) In the "Passes" tool bar, mark the "Only" radio button
6) select the "ChubuSat-2" satellite


After that selection, the application hangs, stuck in the GetNextPassesEx() loop. I'll hvae to dig into it more to figure out why the app hangs for certain satellites and not others.

Issue History

Date Modified Username Field Change
2019-01-28 11:05 K7ZCZ New Issue
2019-01-28 11:05 K7ZCZ Relationship added related to 0003061
2019-01-28 12:32 K7ZCZ Note Added: 0007102
2019-01-28 12:37 K7ZCZ Note Added: 0007103
2019-01-28 13:05 K7ZCZ Note Added: 0007104