Segfault with lastest master

Rick Walsh rickmwalsh at gmail.com
Sat Jul 11 18:36:58 PDT 2015


Hi Dirk,

On 11 July 2015 at 23:11, Dirk Hohndel <dirk at hohndel.org> wrote:

> On Sat, Jul 11, 2015 at 07:16:32PM +1000, Rick Walsh wrote:
> > Full output is:
> >
> > fullpath /bitmaps/default_location.png results in
> > fullpath /bitmaps/empty.png results in
>
> Yeah, so this is the one that used to cause you the crash.
> It somehow tried to open the default_location.png file before internally
> the paths were set up correctly. And then it didn't find the empty.png
> file, either, and went into infinite recursion.
>
> But this gives me something to work with to understand why it would do
> such a thing for you but not for me in my testing.
>
> Thanks for helping to track this down.
>

I think I've tracked down the problem.  The short answer is that the
problem is me.  Quite clearly this has not been my weekend.  First my
attempt at data collection exercise was foiled.  And by that I mean our
lovely Melbourne winter made our seas too windy and/or rough for me to dive
a wreck in the Ships' Graveyard, sitting 45m - perfect for my deco course.

I assume I must have had old files in my subsurface build directory so
something was compiled without MARBLE_DATA_PATH defined, or
MARBLE_DATA_PATH was set to something incorrect.

Now the long answer:
>From MarbleDirs.cpp:

QString MarbleDirs::path( const QString& relativePath )
{
    QString  localpath = localPath() + '/' + relativePath;    // local path
    QString  systempath  = systemPath() + '/' + relativePath;    // system
path

    QString fullpath = systempath;
...

And from running subsurface with the MarbelDirs::path() debugging:

[rick at localhost build]$ ./subsurface
fullpath /bitmaps/default_location.png results in
fullpath /bitmaps/empty.png results in
fullpath /maps/earth/srtm2/srtm2.dgml results in


This essentially says that systemPath() is returning empty.  So I added
debugging lines to the MarbleDirs::systemPath() function to work out where
it was going wrong (not a patch, just showing what I changed):

QString MarbleDirs::systemPath()
{
    QString systempath;

#ifdef Q_OS_MACX
...
    if ( QFile::exists( systempath ) ){
+    fprintf(stderr, "systempath returned: %s\n", qPrintable(systempath));
      return systempath;
    }
#endif   // mac bundle

// Should this happen before the Mac bundle already?
if ( !runTimeMarbleDataPath.isEmpty() ) {
+    fprintf(stderr, "runTimeMarbleDataPath returned: %s\n",
qPrintable(runTimeMarbleDataPath));
    return runTimeMarbleDataPath;
}

#ifdef MARBLE_DATA_PATH
    //MARBLE_DATA_PATH is a compiler define set by cmake
    QString compileTimeMarbleDataPath(MARBLE_DATA_PATH);

    if(QDir(compileTimeMarbleDataPath).exists()) {
+    fprintf(stderr, "compileTimeMarbleDataPath returned: %s\n",
qPrintable(compileTimeMarbleDataPath));
        return compileTimeMarbleDataPath;
    }
#endif  // MARBLE_DATA_PATH

-    return QDir( QCoreApplication::applicationDirPath()
    QString QDirString = QDir( QCoreApplication::applicationDirPath()

#if defined(QTONLY)
                     + QLatin1String( "/data" )
#else
                     + QLatin1String( "/../share/apps/marble/data" )
#endif
                     ).canonicalPath();
+    fprintf(stderr, "QDirString returned: %s\n", qPrintable(QDirString));
+    return QDirString;
}

With this compiled, the output was:
[rick at localhost build]$ ./subsurface
QDirString returned:
fullpath /bitmaps/default_location.png results in
QDirString returned:
fullpath /bitmaps/empty.png results in
QDirString returned:
fullpath /maps/earth/srtm2/srtm2.dgml results in
Map theme file does not exist: ""
QDirString returned:
QDirString returned:
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No
such file or directory
QDirString returned:
runTimeMarbleDataPath returned: /home/rick/build/subsurface/build/marbledata
runTimeMarbleDataPath returned: /home/rick/build/subsurface/build/marbledata
runTimeMarbleDataPath returned: /home/rick/build/subsurface/build/marbledata
runTimeMarbleDataPath returned: /home/rick/build/subsurface/build/marbledata
runTimeMarbleDataPath returned: /home/rick/build/subsurface/build/marbledata
runTimeMarbleDataPath returned: /home/rick/build/subsurface/build/marbledata
runTimeMarbleDataPath returned: /home/rick/build/subsurface/build/marbledata
fullpath
/home/rick/build/subsurface/build/marbledata/placemarks/cityplacemarks.kml
results in
runTimeMarbleDataPath returned: /home/rick/build/subsurface/build/marbledata
fullpath
/home/rick/build/subsurface/build/marbledata/placemarks/cityplacemarks.cache
results in
runTimeMarbleDataPath returned: /home/rick/build/subsurface/build/marbledata

So something being executed early when Subsurface starts appears to have
been compiled without MARBLE_DATA_PATH defined correctly.  So I nuked the
contents of /home/rick/build/subsurface/build/, and rebuilt Subsurface
(based on the build.sh script, but only building Subsurface because I
didn't want to re-download Marble and lose the debugging lines).  Now it's
running without a problem, and not even looking for empty.png.

[rick at localhost build]$ ./subsurface
compileTimeMarbleDataPath returned:
/home/rick/build/install-root/share/marble/data
compileTimeMarbleDataPath returned:
/home/rick/build/install-root/share/marble/data
...
compileTimeMarbleDataPath returned:
/home/rick/build/install-root/share/marble/data
runTimeMarbleDataPath returned: /home/rick/build/subsurface/build/marbledata
...
runTimeMarbleDataPath returned: /home/rick/build/subsurface/build/marbledata
fullpath
/home/rick/build/subsurface/build/marbledata/placemarks/cityplacemarks.kml
results in
runTimeMarbleDataPath returned: /home/rick/build/subsurface/build/marbledata
fullpath
/home/rick/build/subsurface/build/marbledata/placemarks/cityplacemarks.cache
results in
runTimeMarbleDataPath returned: /home/rick/build/subsurface/build/marbledata
...
runTimeMarbleDataPath returned: /home/rick/build/subsurface/build/marbledata
fullpath
/home/rick/build/subsurface/build/marbledata/placemarks/baseplacemarks.kml
results in
runTimeMarbleDataPath returned: /home/rick/build/subsurface/build/marbledata
fullpath
/home/rick/build/subsurface/build/marbledata/placemarks/baseplacemarks.cache
results in
runTimeMarbleDataPath returned: /home/rick/build/subsurface/build/marbledata
runTimeMarbleDataPath returned: /home/rick/build/subsurface/build/marbledata

Just to be sure, I created an entirely new directory to fetch Subsurface
and run build.sh.  It works fine.  Sorry for the noise.

Cheers,

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150712/56588bf8/attachment.html>


More information about the subsurface mailing list