SampleBrowser segfaults Linux unloading Sample_Volume*

Description

Steps to create the issue are run SampleBrowser and Quit without running a sample:

=========================================================
Program received signal SIGSEGV, Segmentation fault.
0xb09c7178 in Ogre::Volume::ChunkHandler::~ChunkHandler() ()
from /home/dermont/TEST/build/v1-9/lib/libOgreVolume.so.1.9.0
(gdb) bt
#0 0xb09c7178 in Ogre::Volume::ChunkHandler::~ChunkHandler() ()
from /home/dermont/TEST/build/v1-9/lib/libOgreVolume.so.1.9.0
#1 0xb7674b63 in __cxa_finalize (d=0xb09f0360) at cxa_finalize.c:55
#2 0xb09c6dc3 in __do_global_dtors_aux ()
from /home/dermont/TEST/build/v1-9/lib/libOgreVolume.so.1.9.0
#3 0xb7ff1ea4 in _dl_close_worker (map=map@entry=0x8646148) at dl-close.c:266
#4 0xb7ff2918 in _dl_close (_map=0x8646148) at dl-close.c:776
#5 0xb7440de2 in dlclose_doit (handle=handle@entry=0x8646148) at dlclose.c:36
#6 0xb7fed05e in _dl_catch_error (objname=0x808feb4, errstring=0x808feb8,
mallocedp=0x808feb0, operate=0xb7440dc0 <dlclose_doit>, args=0x8646148)
at dl-error.c:177
#7 0xb7441422 in _dlerror_run (
operate=operate@entry=0xb7440dc0 <dlclose_doit>, args=args@entry=0x8646148)
at dlerror.c:163
#8 0xb7440e18 in __dlclose (handle=0x8646148) at dlclose.c:47
#9 0xb7c145e7 in Ogre:ynLib::unload() ()
from /home/dermont/TEST/build/v1-9/lib/libOgreMain.so.1.9.0
#10 0xb7c2cc7b in Ogre:ynLibManager::unload(Ogre:ynLib*) ()
from /home/dermont/TEST/build/v1-9/lib/libOgreMain.so.1.9.0
#11 0xb7d8cbfe in Ogre::Root::unloadPlugin(std::string const&) ()
from /home/dermont/TEST/build/v1-9/lib/libOgreMain.so.1.9.0
---Type <return> to continue, or q <return> to quit---
#12 0x0805d11d in OgreBites::SampleBrowser::unloadSamples() ()
#13 0x0805d6ac in OgreBites::SampleBrowser::shutdown() ()
#14 0x080525a5 in OgreBites::SampleContext::closeApp() ()
#15 0x08052562 in OgreBites::SampleContext::go(OgreBites::Sample*) ()
#16 0x0804ff4c in main ()
=========================================================

Run any Sample_VolumeXXX the seg fault does not happen.

The following resolves the problem, thought I'm not sure it is the correct solution for the samples but it looks like it needs something similar in case wq is null i.e. not set in ChunkHandler::init.

diff --git a/Components/Volume/src/OgreVolumeChunkHandler.cpp b/Components/Volume/src/OgreVolumeChunkHandler.cpp
— a/Components/Volume/src/OgreVolumeChunkHandler.cpp
+++ b/Components/Volume/src/OgreVolumeChunkHandler.cpp
@@ -56,8 +56,11 @@

ChunkHandler::~ChunkHandler(void)
{

  • wq->removeRequestHandler(workQueueChannel, this);

  • wq->removeResponseHandler(workQueueChannel, this);
    + if (wq)
    + {
    + wq->removeRequestHandler(workQueueChannel, this);
    + wq->removeResponseHandler(workQueueChannel, this);
    + }
    }


//-----------------------------------------------------------------------
@@ -98,4 +101,4 @@
}
}
}
-}
\ No newline at end of file
+}

Environment

None

Assignee

Unassigned

Reporter

Dermont Gill

Labels

None

Components

Fix versions

Affects versions

Priority

Minor
Configure