Opened 6 years ago

Closed 6 years ago

#56773 closed defect (worksforme)

vtk 7.1.1 +hdf5: Illegal hardware instruction when using Xdmf3Reader

Reported by: rubendibattista (Ruben Di Battista) Owned by: stromnov (Andrey Stromnov)
Priority: Normal Milestone:
Component: ports Version: 2.5.2
Keywords: Cc:
Port: vtk

Description

System Information: OSX 10.13.5 Apple Clang 9.1.0

Hello, I opened a PR on Github https://github.com/macports/macports-ports/pull/2123 providing +hdf5 variant to vtk in order to have the Xdmf3 file readers. The compilation proceeds as expected, no errors are raised (you can see the log attached in the Pull Request).

The problem is that when I try to use one of the Xdm3Readers, I receive a "Illegal Hardware Instruction" error that seems to trace back to the Xdm3RectilinearGrid destructor in VTK, but I don't know if it's a VTK bug w/ Apple Clang or else...

Here a MWE to reproduce:

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

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

    vtkNew<vtkXdmf3Reader> reader;

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

}

The scalar.xmf data can be retrieved from: https://github.com/macports/macports-ports/files/2160224/scalar-data.tar.gz.

This is the Backtrace from lldb:

(lldb) run
Process 10472 launched: '/Users/***/git/x/HG/examples/c++/rayleigh/build/rayleigh' (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

The readers are working if the xdmf files does not include actual data via HDF5...

Change History (3)

comment:1 Changed 6 years ago by mf2k (Frank Schima)

Cc: stromnov removed
Owner: set to stromnov
Status: newassigned

comment:2 Changed 6 years ago by rubendibattista (Ruben Di Battista)

I think we can close this. I'm not hitting the problem anymore (maybe fixed upstream)

comment:3 Changed 6 years ago by mf2k (Frank Schima)

Resolution: worksforme
Status: assignedclosed
Note: See TracTickets for help on using tickets.