Segmentation fault if GDAL is built with MrSID JPEG2000 framework
Hello,
Some otb tools segfault if GDAL has been built with MrSID JPEG2000 Framework:
Command I ran:
OTB_APPLICATION_PATH=./../lib/x86_64-linux-gnu/otb/applications gdb --args otbApplicationLauncherCommandLine KMeansClassification
Here is the GDB trace:
(gdb) run
Starting program: /usr/bin/otbApplicationLauncherCommandLine KMeansClassification
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
2019-06-25 11:58:25 (WARNING): Failed to load libraries from ./../lib/x86_64-linux-gnu/otb/applications/otbapp_TrainVectorClassifier.so while trying to create application TrainVectorClassifier
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7444140 in otb::Wrapper::Application::SetLogger(otb::Logger*) () from /lib/x86_64-linux-gnu/libOTBApplicationEngine-6.6.so.1
(gdb) bt
#0 0x00007ffff7444140 in otb::Wrapper::Application::SetLogger(otb::Logger*) () from /lib/x86_64-linux-gnu/libOTBApplicationEngine-6.6.so.1
#1 0x00007ffff745c8ab in otb::Wrapper::CompositeApplication::AddApplication(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) ()
from /lib/x86_64-linux-gnu/libOTBApplicationEngine-6.6.so.1
#2 0x00007fffe97f5572 in otb::Wrapper::KMeansApplicationBase::InitKMParams() () from ./../lib/x86_64-linux-gnu/otb/applications/otbapp_KMeansClassification.so
#3 0x00007fffe97f837f in otb::Wrapper::KMeansClassification::DoInit() () from ./../lib/x86_64-linux-gnu/otb/applications/otbapp_KMeansClassification.so
#4 0x00007ffff744433c in otb::Wrapper::Application::Init() () from /lib/x86_64-linux-gnu/libOTBApplicationEngine-6.6.so.1
#5 0x00007ffff74599ba in otb::Wrapper::ApplicationRegistry::LoadApplicationFromPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) () from /lib/x86_64-linux-gnu/libOTBApplicationEngine-6.6.so.1
#6 0x00007ffff745a655 in otb::Wrapper::ApplicationRegistry::CreateApplicationFaster(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
from /lib/x86_64-linux-gnu/libOTBApplicationEngine-6.6.so.1
#7 0x00007ffff745aa97 in otb::Wrapper::ApplicationRegistry::CreateApplication(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) ()
from /lib/x86_64-linux-gnu/libOTBApplicationEngine-6.6.so.1
#8 0x00007ffff7f91fa3 in otb::Wrapper::CommandLineLauncher::LoadApplication() () from /lib/x86_64-linux-gnu/libOTBCommandLine-6.6.so.1
#9 0x00007ffff7f9a302 in otb::Wrapper::CommandLineLauncher::Load() () from /lib/x86_64-linux-gnu/libOTBCommandLine-6.6.so.1
#10 0x0000555555557c30 in main ()
(gdb)
I'm absolutely sure it's related to libgdal because I built several version of the library and simply replacing an MrSID-enable library by another one the segmentation fault disappear.
I can provide libgdal package for Debian Stretch / Buster if that can help to reproduce.
It's pretty annoying for us as MrSID is the only framework that handle huge JPEG2000 files without consuming an insane amount of memory.
Best regards, Adam.