[vtkusers] vtkXDMF3Reader Illegal Hardware Instruction crash on OSX w/ AppleCLang

Ruben Di Battista rubendibattista at gmail.com
Wed Jul 4 00:03:49 EDT 2018


Hello,
I’m experiencing a crash of the vtkXDMF3Reader on OSX 10.13.5 compiled with
the shipped Apple’s clang compiler.

System Information:
OSX 10.13.5
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.6.0
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Boost: 1.66.0
HDF5: 1.10.2
Stuff installed with Macports

Basically when I read a xdmf that stores actual data in HDF5, the program
crashes.

Here’s a MWE:

```
#include "vtkNew.h"
#include "vtkXdmf3Reader.h"

int main(int argc, char** argv) {

    vtkNew<vtkXdmf3Reader> reader;

    reader->SetFileName("scalar-data/scalar.xmf");
    reader->DebugOn();
    reader->Update();

}
```
here’s
<https://github.com/macports/macports-ports/files/2160224/scalar-data.tar.gz>
the
sample data file that you can use with it to test.

I tried to use the debugger, (below the output), It looks like a problem
with the Xdmf3Reader destructor. I’m not able to understand if it’s because
of Boost or a VTK’s bug with Apple Clang. Can you please give me help?

*NB: *For further details see this PR
<https://github.com/macports/macports-ports/pull/2123> on macports issue
tracker.

Thanks in advance,

```
(lldb) run
Process 10472 launched: *** (x86_64)
Debug: In
/opt/local/var/macports/build/_Users_***_git_macports-ports_graphics_vtk/vtk/work/VTK-7.1.1/Common/Core/vtkObject.cxx,
line 861
vtkXdmf3Reader (0x109218d80): Registered by vtkCompositeDataPipeline
(0x109219ff0), ReferenceCount = 2

Process 10472 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason =
EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
    frame #0: 0x00000001044f383b
libvtkxdmf3.dylib`XdmfRectilinearGrid::~XdmfRectilinearGrid() + 47
libvtkxdmf3.dylib`XdmfRectilinearGrid::~XdmfRectilinearGrid:
->  0x1044f383b <+47>: ud2
    0x1044f383d <+49>: nop
    0x1044f383e <+0>:  pushq  %rbp
    0x1044f383f <+1>:  movq   %rsp, %rbp
Target 0: (rayleigh) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason =
EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
  * frame #0: 0x00000001044f383b
libvtkxdmf3.dylib`XdmfRectilinearGrid::~XdmfRectilinearGrid() + 47
    frame #1: 0x00007ffeefbfef20
    frame #2: 0x00000001044f3854
libvtkxdmf3.dylib`XdmfRectilinearGrid::~XdmfRectilinearGrid() + 22
    frame #3: 0x00000001044f38ab
libvtkxdmf3.dylib`XdmfRectilinearGrid::~XdmfRectilinearGrid() + 15
    frame #4: 0x0000000104f1c2ed
libXdmfCore.dylib`boost::detail::shared_count::~shared_count() + 45
    frame #5: 0x0000000104eeac46
libXdmfCore.dylib`std::__1::__tree<std::__1::__value_type<_xmlNode*,
boost::shared_ptr<XdmfItem> >, std::__1::__map_value_compare<_xmlNode*,
std::__1::__value_type<_xmlNode*, boost::shared_ptr<XdmfItem> >,
std::__1::less<_xmlNode*>, true>,
std::__1::allocator<std::__1::__value_type<_xmlNode*,
boost::shared_ptr<XdmfItem> > >
>::destroy(std::__1::__tree_node<std::__1::__value_type<_xmlNode*,
boost::shared_ptr<XdmfItem> >, void*>*) + 50
    frame #6: 0x0000000104eeac3d
libXdmfCore.dylib`std::__1::__tree<std::__1::__value_type<_xmlNode*,
boost::shared_ptr<XdmfItem> >, std::__1::__map_value_compare<_xmlNode*,
std::__1::__value_type<_xmlNode*, boost::shared_ptr<XdmfItem> >,
std::__1::less<_xmlNode*>, true>,
std::__1::allocator<std::__1::__value_type<_xmlNode*,
boost::shared_ptr<XdmfItem> > >
>::destroy(std::__1::__tree_node<std::__1::__value_type<_xmlNode*,
boost::shared_ptr<XdmfItem> >, void*>*) + 41
    frame #7: 0x0000000104eeac31
libXdmfCore.dylib`std::__1::__tree<std::__1::__value_type<_xmlNode*,
boost::shared_ptr<XdmfItem> >, std::__1::__map_value_compare<_xmlNode*,
std::__1::__value_type<_xmlNode*, boost::shared_ptr<XdmfItem> >,
std::__1::less<_xmlNode*>, true>,
std::__1::allocator<std::__1::__value_type<_xmlNode*,
boost::shared_ptr<XdmfItem> > >
>::destroy(std::__1::__tree_node<std::__1::__value_type<_xmlNode*,
boost::shared_ptr<XdmfItem> >, void*>*) + 29
    frame #8: 0x0000000104eea377
libXdmfCore.dylib`XdmfCoreReader::XdmfCoreReaderImpl::closeFile() + 31
    frame #9: 0x0000000104eea44b
libXdmfCore.dylib`XdmfCoreReader::readItems(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&) const + 65
    frame #10: 0x0000000104eea777
libXdmfCore.dylib`XdmfCoreReader::read(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&) const + 27
    frame #11: 0x00000001044f2912
libvtkxdmf3.dylib`XdmfReader::read(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&) const + 14
    frame #12: 0x000000010444aa32
libvtkIOXdmf3-7.1.1.dylib`vtkXdmf3Reader::Internals::Init(char const*,
bool) + 2224
    frame #13: 0x0000000104443ffe
libvtkIOXdmf3-7.1.1.dylib`vtkXdmf3Reader::Internals::PrepareDocument(vtkXdmf3Reader*,
char const*, bool) + 96
    frame #14: 0x0000000104443ecf
libvtkIOXdmf3-7.1.1.dylib`vtkXdmf3Reader::RequestDataObject(vtkInformationVector*)
+ 57
    frame #15: 0x0000000107cdf00f
libvtkCommonExecutionModel-7.1.1.dylib`vtkExecutive::CallAlgorithm(vtkInformation*,
int, vtkInformationVector**, vtkInformationVector*) + 69
    frame #16: 0x0000000107cd49fe
libvtkCommonExecutionModel-7.1.1.dylib`vtkCompositeDataPipeline::ExecuteDataObject(vtkInformation*,
vtkInformationVector**, vtkInformationVector*) + 304
    frame #17: 0x0000000107cd944e
libvtkCommonExecutionModel-7.1.1.dylib`vtkDemandDrivenPipeline::ProcessRequest(vtkInformation*,
vtkInformationVector**, vtkInformationVector*) + 166
    frame #18: 0x0000000107cf601d
libvtkCommonExecutionModel-7.1.1.dylib`vtkStreamingDemandDrivenPipeline::ProcessRequest(vtkInformation*,
vtkInformationVector**, vtkInformationVector*) + 543
    frame #19: 0x0000000107cd9968
libvtkCommonExecutionModel-7.1.1.dylib`vtkDemandDrivenPipeline::UpdateInformation()
+ 48
    frame #20: 0x0000000107cf6438
libvtkCommonExecutionModel-7.1.1.dylib`vtkStreamingDemandDrivenPipeline::Update(int,
vtkInformationVector*) + 36
    frame #21: 0x0000000100021d1f rayleigh`main(argc=1,
argv=0x00007ffeefbff4e8) at rayleigh.cpp:10
    frame #22: 0x00007fff7c908015 libdyld.dylib`start + 1
    frame #23: 0x00007fff7c908015 libdyld.dylib`start + 1

```



          _
-.     .´  |∞∞∞∞
  ',  ;    |∞∞∞∞∞∞
    ˜˜     |∞∞∞∞∞∞∞∞∞ RdB
    ,.,    |∞∞∞∞∞∞
  .'   '.  |∞∞∞∞
-'       `’
http://rdb.is
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180703/b6780566/attachment.html>


More information about the vtkusers mailing list