Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rc49p5 aruco crashes when marker detected #375

Closed
Emton opened this issue Jun 23, 2016 · 25 comments
Closed

rc49p5 aruco crashes when marker detected #375

Emton opened this issue Jun 23, 2016 · 25 comments

Comments

@Emton
Copy link

Emton commented Jun 23, 2016

Crashes when I click start
rc49p5crash

Last version I was using was from a few weeks ago with out any problem, I installed using the exe, did I forget something or did my computer setup change somehow to cause this?

@Emton
Copy link
Author

Emton commented Jun 23, 2016

Uh ok I did a clean uninstall, then I installed the portable version and I think it works.

@Emton
Copy link
Author

Emton commented Jun 23, 2016

Oh I spoke too soon it's actually crashing as soon as it detects the Aruco shape

(ok I had to remove that GOOFY picture ehehe)

The last version that works for me is rc49p2

@sthalik
Copy link
Member

sthalik commented Jun 23, 2016

Send a camera frame with your marker in it.

@kblomster
Copy link

I'm having the same issue, it works fine as long as the aruco marker isn't in frame but when it enters, boom. It's a regression, 2.3 rc49p2 doesn't have the issue. I've attached frame with the marker in it.

aruco

sthalik added a commit that referenced this issue Jun 24, 2016
Some new matrix element type requirements came up after opencv update

Also,

- switch to matrices of known sizes wherever possible
- split into functions for readability
- use member variables rather than locals to ensure heap allocation

There was also breakage wrt "unknown element type" deep in opencv that
only happens on release mode with no symbols.  It's unknown to me
whether the issue got fixed or variable reordering made it corrupt
something else. It appears to work however. -fstack-protector-all
doesn't show any errors at all.

@kblomster says it worked in rc49p2. Looks like -fipa-pta has a
miscompilation despite finally working to begin with.

Reported-by: @kblomster
Issue: #375
@sthalik sthalik changed the title rc49p5 crashes when I click "start" rc49p5 aruco crashes when marker detected Jun 24, 2016
@sthalik
Copy link
Member

sthalik commented Jun 24, 2016

@kblomster see if pre6 works for you, thanks.

@kblomster
Copy link

Installed rc49p6, but I still have the same issue. Starting the tracking without the marker in frame works fine, but as soon as the marker is detected (red outline appears around it), the application crashes. I don't have Visual Studio on this computer, but I could probably install it and try to get you a stack trace or something - I have no experience with OpenCV or anything though so I doubt I'll be of much use attempting to debug the problem.

Would it help if I tried to narrow down exactly which version it broke in?

@sthalik
Copy link
Member

sthalik commented Jun 24, 2016

@kblomster version with link-time optimization has no visible symbols or debug info. They can't be embedded. It probably broke in pre3 with the compiler change enabling working -fipa-pta on Windows. And -fipa-pta also miscompiles Rift SDK 025. I'll give you a test version in a few.

@sthalik
Copy link
Member

sthalik commented Jun 24, 2016

@kblomster
Copy link

kblomster commented Jun 24, 2016

Tried it (shows version as rc49p6-dirty) but nope, still same issue. Let me know if there's anything you want me to try or do.

@sthalik
Copy link
Member

sthalik commented Jun 25, 2016

@kblomster here's a debug build. Visual studio wouldn't show you exact frame information, but use gdb. In particular, use this build of gdb. Before running the process, input

catch throw
break __cxa_throw

If the latter doesn't work, just continue debugging.

After it crashes, run

thread apply all bt

and send the output.

This is only to ensure that it works without any optimizations. If this version works, the compiler needs rolling back to 5.3.

@kblomster
Copy link

I'm gone over the weekend and will be able to try it on Monday at the earliest. Sorry for the delay.

@sthalik
Copy link
Member

sthalik commented Jun 25, 2016

@kblomster no worries. You're doing a lot for the project this way actually.

sthalik added a commit that referenced this issue Jun 27, 2016
@sthalik
Copy link
Member

sthalik commented Jun 27, 2016

@kblomster here's a build after backing off the compiler change - https://www.dropbox.com/s/1n5in6puv4uh14e/opentrack-test-20160627.7z

@sthalik
Copy link
Member

sthalik commented Jun 27, 2016

Rift 0.2.5 is no longer miscompiled. It's likely that aruco will now work.

@kblomster
Copy link

Hm. Tried test-20160627, still same issue.

Tried the debug version, which also crashes - here's the debugger output and backtrace:

C:\opentrack-debug>c:\gdb\bin\gdb.exe opentrack.exe
GNU gdb (GDB) 7.10.50.20160130-git
Copyright (C) 2016 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 "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 opentrack.exe...done.
(gdb) break throw
Function "throw" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) catch throw
Catchpoint 1 (throw)
(gdb) break __cxa_throw
Function "__cxa_throw" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 2 (__cxa_throw) pending.
(gdb) run
Starting program: C:\opentrack-debug\opentrack.exe
[New Thread 8656.0x119c]
options: registering stream operators
Loading "libopentrack-filter-accela.dll"
Loading "libopentrack-filter-ewma.dll"
Loading "libopentrack-tracker-aruco.dll"
Loading "libopentrack-tracker-freepie-udp.dll"
Loading "libopentrack-tracker-hatire.dll"
Loading "libopentrack-tracker-joystick.dll"
Loading "libopentrack-tracker-pt.dll"
Loading "libopentrack-tracker-rs.dll"
Loading "libopentrack-tracker-udp.dll"
Loading "libopentrack-proto-fgfs.dll"
Loading "libopentrack-proto-freetrack.dll"
Loading "libopentrack-proto-simconnect.dll"
Loading "libopentrack-proto-udp.dll"
Loading "libopentrack-proto-win32-mouse.dll"
bundle + "opentrack-ui"
joy list refresh
[New Thread 8656.0x10ac]
[New Thread 8656.0x1e9c]
[New Thread 8656.0x13d0]
[New Thread 8656.0xa84]
add joy "{6B73DF90-8C04-11E2-8001-444553540000}"
got joy "{6B73DF90-8C04-11E2-8001-444553540000}"
[New Thread 8656.0x1a28]
[New Thread 8656.0x2118]
add receiver 56134560
joy list refresh
bundle + "proto-freetrack"
bundle + "aruco-tracker"
bundle + "Accela"
[New Thread 8656.0x29ac]
add receiver 132898736
joy list refresh
[New Thread 8656.0x1dfc]
[New Thread 8656.0xa04]
[New Thread 8656.0x283c]
[Thread 8656.0x283c exited with code 0]
[New Thread 8656.0x1910]
[Thread 8656.0x1910 exited with code 0]
[New Thread 8656.0x504]
[Thread 8656.0x504 exited with code 0]
[New Thread 8656.0x12f4]
[New Thread 8656.0x2af8]
[Thread 8656.0x12f4 exited with code 0]
[Thread 8656.0x2af8 exited with code 0]
[New Thread 8656.0x2070]
[Thread 8656.0x2070 exited with code 0]
[New Thread 8656.0x1dc0]
[Thread 8656.0x1dc0 exited with code 0]
[New Thread 8656.0x20f0]
[Thread 8656.0x20f0 exited with code 0]
[New Thread 8656.0x1b3c]
[New Thread 8656.0x1ab4]
[New Thread 8656.0x198c]
OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.he
ight && roi.y + roi.height <= m.rows) in Mat, file ../modules/core/src/matrix.cpp, line 516
[Switching to Thread 8656.0x29ac]

Thread 8 hit Catchpoint 1 (exception thrown), 0x0373bd20 in __cxa_throw ()
   from C:\opentrack-debug\libopentrack-tracker-aruco.dll
(gdb) thread apply all bt

Thread 21 (Thread 8656.0x198c):
#0  0x7716f8e1 in ntdll!ZwWaitForSingleObject () from C:\Windows\SysWOW64\ntdll.dll
#1  0x7716f8e1 in ntdll!ZwWaitForSingleObject () from C:\Windows\SysWOW64\ntdll.dll
#2  0x76bf15ce in WaitForSingleObjectEx () from C:\Windows\syswow64\KernelBase.dll
#3  0x000004dc in ?? ()
#4  0x00000000 in ?? ()

Thread 20 (Thread 8656.0x1ab4):
#0  0x7716f8e1 in ntdll!ZwWaitForSingleObject () from C:\Windows\SysWOW64\ntdll.dll
#1  0x7716f8e1 in ntdll!ZwWaitForSingleObject () from C:\Windows\SysWOW64\ntdll.dll
#2  0x76bf15ce in WaitForSingleObjectEx () from C:\Windows\syswow64\KernelBase.dll
#3  0x000004e0 in ?? ()
#4  0x00000000 in ?? ()

Thread 19 (Thread 8656.0x1b3c):
#0  0x7716f8e1 in ntdll!ZwWaitForSingleObject () from C:\Windows\SysWOW64\ntdll.dll
#1  0x7716f8e1 in ntdll!ZwWaitForSingleObject () from C:\Windows\SysWOW64\ntdll.dll
#2  0x76bf15ce in WaitForSingleObjectEx () from C:\Windows\syswow64\KernelBase.dll
#3  0x000004bc in ?? ()
#4  0x00000000 in ?? ()

Thread 10 (Thread 8656.0xa04):
#0  0x7716fda1 in ntdll!ZwDelayExecution () from C:\Windows\SysWOW64\ntdll.dll
#1  0x7716fda1 in ntdll!ZwDelayExecution () from C:\Windows\SysWOW64\ntdll.dll
#2  0x76bf3d3c in SleepEx () from C:\Windows\syswow64\KernelBase.dll
#3  0x00000000 in ?? ()

Thread 9 (Thread 8656.0x1dfc):
#0  0x765878e7 in USER32!DispatchMessageW () from C:\Windows\syswow64\user32.dll
#1  0x597b792e in QUARTZ!DllGetClassObject () from C:\Windows\SysWOW64\quartz.dll
#2  0x76c5338a in KERNEL32!BaseThreadInitThunk () from C:\Windows\syswow64\kernel32.dll
#3  0x77189902 in ntdll!RtlInitializeExceptionChain () from C:\Windows\SysWOW64\ntdll.dll
#4  0x771898d5 in ntdll!RtlInitializeExceptionChain () from C:\Windows\SysWOW64\ntdll.dll
#5  0x00000000 in ?? ()

Thread 8 (Thread 8656.0x29ac):
#0  0x0373bd20 in __cxa_throw () from C:\opentrack-debug\libopentrack-tracker-aruco.dll
#1  0x0384797e in cv::error (exc=...) at ../modules/core/src/system.cpp:653
#2  0x03847a43 in cv::error (_code=-215, _err=...,
    _func=0x3a83d64 <cv::Mat::Mat(cv::Mat const&, cv::Rect_<int> const&)::__func__> "Mat",
    _file=0x3a8223c <_ZStL19piecewise_construct+260> "../modules/core/src/matrix.cpp", _line=516)
    at ../modules/core/src/system.cpp:658
#3  0x037f5e1c in cv::Mat::Mat (this=0x88efd5c, m=..., roi=...) at ../modules/core/src/matrix.cpp:516
#4  0x0399e9e4 in cv::Mat::operator() (this=0x7e6b1e8, roi=...)
    at C:/Users/sthalik/dev/opentrack-depends/opencv/modules/core/include/opencv2/core/mat.inl.hpp:702
#5  0x03722c18 in Tracker::detect_with_roi (this=0x7e6b080) at ../tracker-aruco/ftnoir_tracker_aruco.cpp:106
#6  0x0372514d in Tracker::run (this=0x7e6b080) at ../tracker-aruco/ftnoir_tracker_aruco.cpp:356
#7  0x669627d4 in ZN7QThread21setTerminationEnabledEb () from C:\opentrack-debug\Qt5Core.dll
#8  0x07e6aeb0 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Thread 7 (Thread 8656.0x2118):
#0  0x7716fda1 in ntdll!ZwDelayExecution () from C:\Windows\SysWOW64\ntdll.dll
#1  0x7716fda1 in ntdll!ZwDelayExecution () from C:\Windows\SysWOW64\ntdll.dll
#2  0x76bf3d3c in SleepEx () from C:\Windows\syswow64\KernelBase.dll
#3  0x00000000 in ?? ()

Thread 6 (Thread 8656.0x1a28):
#0  0x7717016d in ntdll!ZwWaitForMultipleObjects () from C:\Windows\SysWOW64\ntdll.dll
#1  0x7717016d in ntdll!ZwWaitForMultipleObjects () from C:\Windows\SysWOW64\ntdll.dll
---Type <return> to continue, or q <return> to quit---
#2  0x76bf171a in WaitForMultipleObjectsEx () from C:\Windows\syswow64\KernelBase.dll
#3  0x00000001 in ?? ()
#4  0x07b5fe5c in ?? ()
#5  0x76c51a08 in WaitForMultipleObjectsEx () from C:\Windows\syswow64\kernel32.dll
#6  0x76590892 in USER32!PeekMessageW () from C:\Windows\syswow64\user32.dll
#7  0x536092a6 in ?? () from C:\Windows\system32\dinput8.dll
#8  0x76c5338a in KERNEL32!BaseThreadInitThunk () from C:\Windows\syswow64\kernel32.dll
#9  0x77189902 in ntdll!RtlInitializeExceptionChain () from C:\Windows\SysWOW64\ntdll.dll
#10 0x771898d5 in ntdll!RtlInitializeExceptionChain () from C:\Windows\SysWOW64\ntdll.dll
#11 0x00000000 in ?? ()

Thread 5 (Thread 8656.0xa84):
#0  0x7716fda1 in ntdll!ZwDelayExecution () from C:\Windows\SysWOW64\ntdll.dll
#1  0x7716fda1 in ntdll!ZwDelayExecution () from C:\Windows\SysWOW64\ntdll.dll
#2  0x76bf3d3c in SleepEx () from C:\Windows\syswow64\KernelBase.dll
#3  0x00000000 in ?? ()

Thread 4 (Thread 8656.0x13d0):
#0  0x77171f56 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\Windows\SysWOW64\ntdll.dll
#1  0x77171f56 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\Windows\SysWOW64\ntdll.dll
#2  0x771a70a9 in ntdll!RtlCleanUpTEBLangLists () from C:\Windows\SysWOW64\ntdll.dll
#3  0x00000294 in ?? ()
#4  0x0775feec in ?? ()
#5  0x76c5338a in KERNEL32!BaseThreadInitThunk () from C:\Windows\syswow64\kernel32.dll
#6  0x77189902 in ntdll!RtlInitializeExceptionChain () from C:\Windows\SysWOW64\ntdll.dll
#7  0x771898d5 in ntdll!RtlInitializeExceptionChain () from C:\Windows\SysWOW64\ntdll.dll
#8  0x00000000 in ?? ()

Thread 3 (Thread 8656.0x1e9c):
#0  0x77171f56 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\Windows\SysWOW64\ntdll.dll
#1  0x77171f56 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\Windows\SysWOW64\ntdll.dll
#2  0x771a70a9 in ntdll!RtlCleanUpTEBLangLists () from C:\Windows\SysWOW64\ntdll.dll
#3  0x00000290 in ?? ()
#4  0x0755feec in ?? ()
#5  0x76c5338a in KERNEL32!BaseThreadInitThunk () from C:\Windows\syswow64\kernel32.dll
#6  0x77189902 in ntdll!RtlInitializeExceptionChain () from C:\Windows\SysWOW64\ntdll.dll
#7  0x771898d5 in ntdll!RtlInitializeExceptionChain () from C:\Windows\SysWOW64\ntdll.dll
#8  0x00000000 in ?? ()

Thread 2 (Thread 8656.0x10ac):
#0  0x7717016d in ntdll!ZwWaitForMultipleObjects () from C:\Windows\SysWOW64\ntdll.dll
#1  0x7717016d in ntdll!ZwWaitForMultipleObjects () from C:\Windows\SysWOW64\ntdll.dll
#2  0x771a17c3 in ntdll!RtlpQueryDefaultUILanguage () from C:\Windows\SysWOW64\ntdll.dll
#3  0x76c5338a in KERNEL32!BaseThreadInitThunk () from C:\Windows\syswow64\kernel32.dll
#4  0x77189902 in ntdll!RtlInitializeExceptionChain () from C:\Windows\SysWOW64\ntdll.dll
#5  0x771898d5 in ntdll!RtlInitializeExceptionChain () from C:\Windows\SysWOW64\ntdll.dll
#6  0x00000000 in ?? ()

Thread 1 (Thread 8656.0x119c):
#0  0x7717016d in ntdll!ZwWaitForMultipleObjects () from C:\Windows\SysWOW64\ntdll.dll
#1  0x7717016d in ntdll!ZwWaitForMultipleObjects () from C:\Windows\SysWOW64\ntdll.dll
#2  0x76bf171a in WaitForMultipleObjectsEx () from C:\Windows\syswow64\KernelBase.dll
#3  0x00000002 in ?? ()
#4  0x0028dde0 in ?? ()
#5  0x76c51a08 in WaitForMultipleObjectsEx () from C:\Windows\syswow64\kernel32.dll
#6  0x76590892 in USER32!PeekMessageW () from C:\Windows\syswow64\user32.dll
#7  0x66b3e58e in ZN21QEventDispatcherWin3213processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE ()
   from C:\opentrack-debug\Qt5Core.dll
#8  0x0028df84 in ?? ()
#9  0x6df25597 in qwindows!qt_plugin_instance () from C:\opentrack-debug\platforms\qwindows.dll
#10 0x0028fd00 in ?? ()
---Type <return> to continue, or q <return> to quit---
#11 0x66aeb095 in ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE () from C:\opentrack-debug\Qt5Core.dll
#12 0x66af2fe8 in ZN16QCoreApplication4execEv () from C:\opentrack-debug\Qt5Core.dll
#13 0x00402326 in main (argc=1, argv=0xc8b560) at ../gui/main.cpp:64
(gdb)

@sthalik
Copy link
Member

sthalik commented Jun 27, 2016

Hey @kblomster,

There's a new logic error after simplifying aruco. Try this build - https://www.dropbox.com/s/o0ghg4x89v6prq1/opentrack-test-20160627_2.7z?dl=0

You can run it under the debugger to get the error message. It's only that the backtrace won't be visible.

@sthalik
Copy link
Member

sthalik commented Jun 27, 2016

If there are still errors please record a camera video for me to reproduce under manycam.

@kblomster
Copy link

Well, something's changed. Running 20160627_2 under gdb worked for a few seconds, but then crashed again. gdb shows the message "warning: Invalid parameter passed to C runtime function." twice when it crashes and then a bunch of threads exiting with code 3, nothing else of interest as far as I can see (let me know if you want the full output).

Will record camera video shortly.

@kblomster
Copy link

Will this clip do? Let me know if you want something longer or with a different codec/file format or anything (this is h.264, 640x480 @ 60fps).

@sthalik
Copy link
Member

sthalik commented Jun 27, 2016

@kblomster great clip, thanks. It no longer crashes on that clip. See https://www.dropbox.com/s/ntluwx14f7hs9b8/opentrack-test-20160627_3.7z

Other than the newly-introduced bugs in 2.3 release process, there was the matter of never checking height to be greater than zero. Since forever.

@sthalik sthalik reopened this Jun 27, 2016
@sthalik
Copy link
Member

sthalik commented Jun 27, 2016

What the hell, I didn't close the issue

@sthalik
Copy link
Member

sthalik commented Jun 27, 2016

Good news.

Windows Subsystem for Linux has a fully-working Ubuntu Xenial environment. It's also possible to run the openssh server as a Windows service. Now I no longer have to build Qt, opentrack et al. on mingw or Cygwin. WSL provides an almost complete Linux environment with binary compatibiliy.

@kblomster
Copy link

I can confirm that I can't get 20160627_3 to crash - it seems to work just fine. Thanks!

@sthalik
Copy link
Member

sthalik commented Jun 27, 2016

@kblomster thanks for working to get it fixed.

@sthalik sthalik closed this as completed Jun 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants