Bug 271798 - Crash when panning by clicking map edges
Summary: Crash when panning by clicking map edges
Status: RESOLVED FIXED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: 1.2 (KDE 4.7)
Assignee: marble-bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-26 19:28 UTC by Jaime Silva
Modified: 2011-06-14 19:33 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaime Silva 2011-04-26 19:28:07 UTC
Version:           unspecified
OS:                MS Windows

When compiling marble on windows using MSVC2008 you get this warning

..\src\lib\marblewidget.cpp(60) : warning C4717: 'Marble::sqrt' : recursive on all control paths, function will cause runtime stack overflow

This appears to be exactly what happens when you pan the map by clicking on the widget edges since that causes Marble::moveStep() to get called which uses the sqrt() function.

The same thing appears to happen when using the 1.1.0 binary release for windows.


Reproducible: Didn't try
Comment 1 Dennis Nienhüser 2011-04-28 00:00:32 UTC
Seems to be this one:

#ifdef Q_CC_MSVC
# ifndef KDEWIN_MATH_H
   static long double sqrt( int a ) { return sqrt( (long double)a ); }
# endif
#endif

Looks like a wrong attempt to fix a compiler error to me. I'll CC everyone who "git blame" thinks touched that part. I don't have a MSVC system around atm.
Comment 2 Jaime Silva 2011-04-28 18:34:03 UTC
From what I can tell MSVC2008 seems to work fine without that bit of code. Perhaps it was added to address a bug in an older version of the compiler.

What's a little puzzling is that the compiler chooses to use that sqrt function instead of one of the versions in cmath which are a better match.

Adding 'std::' here to the sqrt call seems to work as well but I'm not sure how an older version of the compiler would behave.

#ifdef Q_CC_MSVC
# ifndef KDEWIN_MATH_H
   static long double sqrt( int a ) { return std::sqrt( (long double)a ); }
# endif
#endif