[vtkusers] Ideas on how to debug a cross compiled program that used VTK

Guillaume Jacquenot guillaume.jacquenot at gmail.com
Sat Jun 2 03:52:42 EDT 2018


Hello VTK developpers and users,

I am doing cross compilation with docker dockcross for a fortran program
using VTK. Target is a static windows 64 bit program, which is about 43 MB.

- Without cross compilation, program works fine.
- With cross compilation, program works fine when launched with wine in a
debian
- With cross compilation, program seems works fine on Windows, but throws
error messages on error output:  Program received signal SIGSEGV,
Segmentation fault. This error is thrown even if the program just prints
help and does nothing (no use of VTK code).

If I disable the VTK part of my program, error goes away. (VTK part = VTK
library+ my wrapping Fortran code to call VTK with pointer storage to keep
track of vtkSmartPointer). I use other libraries that work fine.


I don't know if it is related to VTK, but when I use gdb on Windows , I get
some VTK stuff appearing (See below).

If anyone has a clue on how I can track this down? From the log, can we say
it that error is mine or comes from cross compilation? Maybe I should use
valgrind to see if everything really works fine with.

I have tried with the static VTK 6.3 version provided by mxe, and a
personal static compilation of VTK 8.1.1.

Thanks for reading till this point and here comes the interesting thing:

    build_windows>gdb testing.exe
    GNU gdb (GDB) 7.8.1
    Copyright (C) 2014 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show
copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-w64-mingw32".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.
    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    Reading symbols from testing.exe...done.
    (gdb) r
    Starting program: testing.exe
    [New Thread 11212.0x362c]
    warning: Could not load shared library symbols for
C:\windows\system32\kernel64.dll.
    Do you need "set solib-search-path" or "set sysroot"?

    Test module initialized

        . : successful assert,   F : failed assert

    ..........................................
    Program received signal SIGSEGV, Segmentation fault.
    0x0000000077adcff6 in ntdll!RtlEnterCriticalSection () from
C:\windows\SYSTEM32\ntdll.dll
    (gdb) bt
    #0  0x0000000077adcff6 in ntdll!RtlEnterCriticalSection () from
C:\windows\SYSTEM32\ntdll.dll
    #1  0x0000000000b95bb6 in
detail::AtomicOps<8ull>::PreIncrement(detail::AtomicOps<8ull>::atomic_type*)
()
    #2  0x0000000000b81b0d in vtkTimeStamp::Modified() ()
    #3  0x0000000000b3a0b1 in vtkObject::Modified() ()
    #4  0x0000000000acdb18 in vtkCollection::~vtkCollection() ()
    #5  0x0000000001417817 in
vtkObjectFactoryCollection::~vtkObjectFactoryCollection() ()
    #6  0x0000000000b3aa85 in vtkObjectFactory::UnRegisterAllFactories() ()
    #7  0x000007feff57908f in wcscspn () from C:\windows\system32\msvcrt.dll
    #8  0x00000000021f8348 in ?? ()
    Backtrace stopped: previous frame inner to this frame (corrupt stack?)
    (gdb) bt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180602/d206ed35/attachment.html>


More information about the vtkusers mailing list