Crash in Mac version of zyGrib
Posted: 28 Jan 2016 20:56
It seems that on some machines zyGrib crashes on start up when it tries to load and render a grib file that was previously downloaded.
here is stack trace
(gdb) where
#0 GriddedPlotter::draw_CoveredZone (this=0x0, pnt=@0x7fff5fbf99d8, proj=0x101cc9550) at GriddedPlotter.cpp:370
#1 0x0000000100161fd5 in MapDrawer::draw_MeteoData_Gridded (this=0x10b6399c0, pnt=@0x7fff5fbf99d8, proj=0x101cc9550, plotter=0x0) at MapDrawer.cpp:416
#2 0x0000000100161eb9 in MapDrawer::draw_GSHHS_and_GriddedData (this=0x10b6399c0, pntGlobal=@0x7fff5fbf9be8, mustRedraw=true, isEarthMapValid=false, proj=0x101cc9550, plotter=0x0, drawCartouche=true) at MapDrawer.cpp:374
#3 0x00000001001df615 in Terrain::paintEvent (this=0x10b639240) at Terrain.cpp:1086
#4 0x0000000100c00a2e in QWidget::event ()
the following mod to line 1086 in Terrain.cpp fixes the problem
case DATATYPE_MBLUE :
// added to fix crash
if ( griddedPlot == NULL ) {
setCursor(oldcursor);
return;
}
// end of crash fix
drawer->draw_GSHHS_and_GriddedData
(pnt, mustRedraw, isEarthMapValid, proj, griddedPlot, drawCartouche);
it seems that there is some race condition that causes printEvent to be called before the GriddedPlotter data structure is initialized. Depending on the speed of your computer, disk, load, etc the Grid may or may not be loaded before the screen refresh. When this happens the griddedPlot variable is 0. which is an invalid address which causes an exception.
--luis
here is stack trace
(gdb) where
#0 GriddedPlotter::draw_CoveredZone (this=0x0, pnt=@0x7fff5fbf99d8, proj=0x101cc9550) at GriddedPlotter.cpp:370
#1 0x0000000100161fd5 in MapDrawer::draw_MeteoData_Gridded (this=0x10b6399c0, pnt=@0x7fff5fbf99d8, proj=0x101cc9550, plotter=0x0) at MapDrawer.cpp:416
#2 0x0000000100161eb9 in MapDrawer::draw_GSHHS_and_GriddedData (this=0x10b6399c0, pntGlobal=@0x7fff5fbf9be8, mustRedraw=true, isEarthMapValid=false, proj=0x101cc9550, plotter=0x0, drawCartouche=true) at MapDrawer.cpp:374
#3 0x00000001001df615 in Terrain::paintEvent (this=0x10b639240) at Terrain.cpp:1086
#4 0x0000000100c00a2e in QWidget::event ()
the following mod to line 1086 in Terrain.cpp fixes the problem
case DATATYPE_MBLUE :
// added to fix crash
if ( griddedPlot == NULL ) {
setCursor(oldcursor);
return;
}
// end of crash fix
drawer->draw_GSHHS_and_GriddedData
(pnt, mustRedraw, isEarthMapValid, proj, griddedPlot, drawCartouche);
it seems that there is some race condition that causes printEvent to be called before the GriddedPlotter data structure is initialized. Depending on the speed of your computer, disk, load, etc the Grid may or may not be loaded before the screen refresh. When this happens the griddedPlot variable is 0. which is an invalid address which causes an exception.
--luis