Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • otb otb
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 207
    • Issues 207
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 14
    • Merge requests 14
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Main Repositories
  • otbotb
  • Issues
  • #1023
Closed
Open
Issue created Apr 08, 2015 by Sébastien Dinot@sdinotOwner

malloc error in otb::SVMModel destructor

Mantis Issue 1023, reported by gpasero, assigned to gpasero, created: 2015-04-08

There is a random crash, seen with the TrainImageClassifier application. For instance : http://dash.orfeo-toolbox.org/testDetails.php?test=29444173&build=178028

The issue seems related to the libSVM classifier.

Message : otbApplicationLauncherCommandLine(66834,0x7fff7360a300) malloc: *** error for object 0x7fd393c06020: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug otbTestMain 'Execute': ITK Exception thrown:

On this platform there is a custom libsvm install (not from macports).

Here is some traces with lldb :

(lldb) run Process 36271 launched: '/Users/otbval/Dashboard/nightly/OTB-Release/build/bin/otbApplicationLauncherCommandLine' (x86_64)

2015 Apr 08 14:40:05 : Application.logger (DEBUG) Entering DoExecute 2015 Apr 08 14:40:05 : Application.logger (INFO) Elevation management: setting default height above ellipsoid to 0 meters 2015 Apr 08 14:40:05 : Application.logger (INFO) Number of training samples: 190 2015 Apr 08 14:40:05 : Application.logger (INFO) Size of training set: 190 2015 Apr 08 14:40:05 : Application.logger (INFO) Size of validation set: 157 2015 Apr 08 14:40:05 : Application.logger (INFO) Size of labeled training set: 190 2015 Apr 08 14:40:05 : Application.logger (INFO) Size of labeled validation set: 157 otbApplicationLauncherCommandLine(36271,0x7fff7360a300) malloc: *** error for object 0x6e6920656e694c14: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug Process 36271 stopped

  • thread #1 (closed): tid = 0x1154aecd, 0x00007fff8e9cc286 libsystem_kernel.dylib__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT frame #0: 0x00007fff8e9cc286 libsystem_kernel.dylib__pthread_kill + 10 libsystem_kernel.dylib`__pthread_kill + 10: -> 0x7fff8e9cc286: jae 0x7fff8e9cc290 ; __pthread_kill + 20 0x7fff8e9cc288: movq %rax, %rdi 0x7fff8e9cc28b: jmp 0x7fff8e9c7c53 ; cerror_nocancel 0x7fff8e9cc290: retq
    (lldb) bt
  • thread #1 (closed): tid = 0x1154aecd, 0x00007fff8e9cc286 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    • frame #0: 0x00007fff8e9cc286 libsystem_kernel.dylib__pthread_kill + 10 frame #1: 0x00007fff8a7ba42f libsystem_pthread.dylibpthread_kill + 90 frame #2 (closed): 0x00007fff8dfceb53 libsystem_c.dylibabort + 129 frame #3: 0x00007fff834c8937 libsystem_malloc.dylibfree + 428 frame #4 (closed): 0x0000000108fced04 liblibsvm.dylibsvm_free_model_content + 244 frame #5: 0x0000000108fcd73b liblibsvm.dylibsvm_free_and_destroy_model + 27 frame #6 (closed): 0x00000001108a2bfa otbapp_TrainImagesClassifier.dylibotb::SVMModel<float, int>::~SVMModel() + 42 frame #7: 0x00000001108a2abf otbapp_TrainImagesClassifier.dylibotb::SVMModel<float, int>::~SVMModel() + 15 frame #8 (closed): 0x000000010312e3af libITKCommon-4.8.1.dylibitk::LightObject::UnRegister() const + 47 frame #9: 0x0000000103105bd5 libITKCommon-4.8.1.dylibitk::Object::UnRegister() const + 117 frame #10 (closed): 0x000000010310c65c libITKCommon-4.8.1.dylibitk::ProcessObject::~ProcessObject() + 108 frame #11: 0x000000011089c69a otbapp_TrainImagesClassifier.dylibotb::SVMSampleListModelEstimator<itk::Statistics::ListSample<itk::VariableLengthVector >, itk::Statistics::ListSample<itk::FixedArray<int, 1u> >, otb::Functor::VariableLengthVectorToMeasurementVectorFunctor<itk::VariableLengthVector > >::~SVMSampleListModelEstimator() + 90 frame #12 (closed): 0x000000010312e3af libITKCommon-4.8.1.dylibitk::LightObject::UnRegister() const + 47 frame #13: 0x0000000103105bd5 libITKCommon-4.8.1.dylibitk::Object::UnRegister() const + 117 frame #14 (closed): 0x000000011089aaea otbapp_TrainImagesClassifier.dylibotb::LibSVMMachineLearningModel<float, int>::~LibSVMMachineLearningModel() + 42 frame #15: 0x000000010312e3af libITKCommon-4.8.1.dylibitk::LightObject::UnRegister() const + 47 frame #16 (closed): 0x0000000103105bd5 libITKCommon-4.8.1.dylibitk::Object::UnRegister() const + 117 frame #17: 0x00000001108ae723 otbapp_TrainImagesClassifier.dylibotb::MachineLearningModelFactory<float, int>::CreateMachineLearningModel(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, otb::MachineLearningModelFactory<float, int>::FileModeType) + 675 frame #18 (closed): 0x00000001108a610c otbapp_TrainImagesClassifier.dylibotb::Wrapper::TrainImagesClassifier::Classify(itk::SmartPointer<itk::Statistics::ListSample<itk::VariableLengthVector<float> > >, itk::SmartPointer<itk::Statistics::ListSample<itk::FixedArray<int, 1u> > >) + 92 frame #19: 0x00000001108a91b1 otbapp_TrainImagesClassifier.dylibotb::Wrapper::TrainImagesClassifier::DoExecute() + 9969 frame #20 (closed): 0x00000001005d27b1 libOTBApplicationEngine-4.5.1.dylibotb::Wrapper::Application::Execute() + 1169 frame #21: 0x00000001005d28cc libOTBApplicationEngine-4.5.1.dylibotb::Wrapper::Application::ExecuteAndWriteOutput() + 28 frame #22 (closed): 0x0000000100031e4c libOTBCommandLine-4.5.1.dylibotb::Wrapper::CommandLineLauncher::ExecuteAndWriteOutput() + 44 frame #23: 0x0000000100014e79 otbApplicationLauncherCommandLinemain + 681 frame #24 (closed): 0x00007fff8f3055c9 libdyld.dylibstart + 1 frame #25: 0x00007fff8f3055c9 libdyld.dylibstart + 1

1428506532 - julienI can not reproduce it on my computer. However, I noticed that a null check was missing in destructor, so I added it:

http://hg.orfeo-toolbox.org/OTB/rev/f597abc83dd8

Don't know if it will solve the bug though.

1428592109 - gpaseroIt doesn't, I get the same debug trace : otbApplicationLauncherCommandLine(49912,0x7fff7360a300) malloc: *** error for object 0x3f8000003f800000: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug Process 49912 stopped

  • thread #1 (closed): tid = 0x12436f5c, 0x00007fff8e9cc286 libsystem_kernel.dylib__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT frame #0: 0x00007fff8e9cc286 libsystem_kernel.dylib__pthread_kill + 10 libsystem_kernel.dylib`__pthread_kill + 10: -> 0x7fff8e9cc286: jae 0x7fff8e9cc290 ; __pthread_kill + 20 0x7fff8e9cc288: movq %rax, %rdi 0x7fff8e9cc28b: jmp 0x7fff8e9c7c53 ; cerror_nocancel 0x7fff8e9cc290: retq
    (lld
Assignee
Assign to
Time tracking