Application crash on double tap

I am creating an HL App which has option to scan QR to get location. The app crashes on double tap of QR button. While debugging, i got following results:
Debuggin in release mode:

Warning: PhraseRecognizer.Start() was called when PhraseRecognizer was already running.

(Filename: C:/buildslave/unity/build/PlatformDependent/Win/Speech/PhraseRecognizer.cpp Line: 287)

Web Device: MN34150

(Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/DebugBindings.gen.cpp Line: 51)

Unloading 1 Unused Serialized files (Serialized files now loaded: 0)

Warning: PhraseRecognizer.Start() was called when PhraseRecognizer was already running.

(Filename: C:/buildslave/unity/build/PlatformDependent/Win/Speech/PhraseRecognizer.cpp Line: 287)

Web Device: MN34150

(Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/DebugBindings.gen.cpp Line: 51)

Exception thrown: ‘System.AccessViolationException’ in TrimbleOperations.exe
I am not sure how to resolve this exception.

When i tried to debug in Debug Mode, App doesn’t crash on double tap.Following Log is generated:
Warning: PhraseRecognizer.Start() was called when PhraseRecognizer was already running.

(Filename: C:/buildslave/unity/build/PlatformDependent/Win/Speech/PhraseRecognizer.cpp Line: 287)

Web Device: MN34150

(Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/DebugBindings.gen.cpp Line: 51)

‘test.exe’ (Win32): Loaded ‘C:\Windows\System32\igfx11cmrt32.dll’. Cannot find or open the PDB file.
‘test.exe’ (Win32): Loaded ‘C:\Program Files\Intel\Media SDK\libmfxhw32.dll’. Cannot find or open the PDB file.
The thread 0x14fc has exited with code 13430016 (0xcced00).
The thread 0xee0 has exited with code 13430017 (0xcced01).
The thread 0x91c has exited with code 13430018 (0xcced02).
The thread 0x1380 has exited with code 13430019 (0xcced03).
The thread 0xb9c has exited with code 13430016 (0xcced00).
The thread 0x984 has exited with code 13430017 (0xcced01).
The thread 0x11e0 has exited with code 13430018 (0xcced02).
The thread 0xc48 has exited with code 13430019 (0xcced03).
‘test.exe’ (Win32): Unloaded ‘C:\Program Files\Intel\Media SDK\libmfxhw32.dll’
Exception thrown at 0x76BC2482 (KernelBase.dll) in test.exe: 0x40080201: WinRT originate error (parameters: 0xC00D36B3, 0x00000027, 0x24B8EE9C).
No attributes 16
Attr: {1652C33D-D6B2-4012-B834-72030849A37D} - 5497558139600
Attr: {20332624-FB0D-4D9E-BD0D-CBF6786C102E} - 331776000
Attr: {48EBA18E-F8C9-4687-BF11-0A74C9F96A8F} - {73646976-0000-0010-8000-00AA00389B71}
Attr: {490CF017-890A-425A-B32C-6ED0E1424C06} BLOB - 401b855d
Attr: {644B4E48-1E02-4516-B0EB-C01CA9D49AC6} - 1280
Attr: {73D1072D-1870-4174-A063-29FF4FF6C11E} - {05589F80-C356-11CE-BF01-00AA0055595A}
Attr: {B8EBEFAF-B718-4E04-B0A9-116775E3321B} - 1
Attr: {C21B8EE5-B956-4071-8DAF-325EDF5CAB11} - 1
Attr: {C459A2E8-3D2C-4E44-B132-FEE5156C7BB0} - 128849018881
Attr: {C6376A1E-8D0A-4027-BE45-6D9A0AD39BB6} - 4294967297
Attr: {C9173739-5E56-461C-B713-46FB995CB95F} - 1
Attr: {D2E7558C-DC1F-403F-9A72-D28BB1EB3B5E} - 128849018881
Attr: {DAD3AB78-1990-408B-BCE2-EBA673DACC10} - 1382400
Attr: {E2724BB8-E676-4806-B4B2-A8D6EFB44CCD} - 2
Attr: {E3371D41-B4CF-4A05-BD4E-20B88BB2C4D6} - 128849018881
Attr: {F7E34C9A-42E8-4714-B74B-CB29D72C35E5} - {3231564E-0000-0010-8000-00AA00389B71}
PlatformDependent/MetroPlayer/WebCam/VideoMediaSink.cpp:608 (Webcam::VideoMediaSink::GetStreamSinkById@120D0C40) FAILED hr=c00d36b3
‘test.exe’ (Win32): Unloaded ‘C:\Windows\System32\igfx11cmrt32.dll’
Warning: PhraseRecognizer.Start() was called when PhraseRecognizer was already running.

(Filename: C:/buildslave/unity/build/PlatformDependent/Win/Speech/PhraseRecognizer.cpp Line: 287)

Unloading 1 Unused Serialized files (Serialized files now loaded: 0)

Web Device: MN34150

(Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/DebugBindings.gen.cpp Line: 51)

‘test.exe’ (Win32): Loaded ‘C:\Windows\System32\igfx11cmrt32.dll’. Cannot find or open the PDB file.
‘test.exe’ (Win32): Loaded ‘C:\Program Files\Intel\Media SDK\libmfxhw32.dll’. Cannot find or open the PDB file.
The thread 0xaa4 has exited with code 13430017 (0xcced01).
The thread 0x1090 has exited with code 13430016 (0xcced00).
The thread 0x12b0 has exited with code 13430018 (0xcced02).
The thread 0xad8 has exited with code 13430019 (0xcced03).
The thread 0x160 has exited with code 13430016 (0xcced00).
The thread 0x70 has exited with code 13430018 (0xcced02).
The thread 0x7a0 has exited with code 13430017 (0xcced01).
The thread 0x13a0 has exited with code 13430019 (0xcced03).
‘test.exe’ (Win32): Unloaded ‘C:\Program Files\Intel\Media SDK\libmfxhw32.dll’
Exception thrown at 0x76BC2482 (KernelBase.dll) in test.exe: 0x40080201: WinRT originate error (parameters: 0xC00D36B3, 0x00000027, 0x24B8EE9C).
No attributes 16
Attr: {1652C33D-D6B2-4012-B834-72030849A37D} - 5497558139600
Attr: {20332624-FB0D-4D9E-BD0D-CBF6786C102E} - 331776000
Attr: {48EBA18E-F8C9-4687-BF11-0A74C9F96A8F} - {73646976-0000-0010-8000-00AA00389B71}
Attr: {490CF017-890A-425A-B32C-6ED0E1424C06} BLOB - 401b855d
Attr: {644B4E48-1E02-4516-B0EB-C01CA9D49AC6} - 1280
Attr: {73D1072D-1870-4174-A063-29FF4FF6C11E} - {05589F80-C356-11CE-BF01-00AA0055595A}
Attr: {B8EBEFAF-B718-4E04-B0A9-116775E3321B} - 1
Attr: {C21B8EE5-B956-4071-8DAF-325EDF5CAB11} - 1
Attr: {C459A2E8-3D2C-4E44-B132-FEE5156C7BB0} - 128849018881
Attr: {C6376A1E-8D0A-4027-BE45-6D9A0AD39BB6} - 4294967297
Attr: {C9173739-5E56-461C-B713-46FB995CB95F} - 1
Attr: {D2E7558C-DC1F-403F-9A72-D28BB1EB3B5E} - 128849018881
Attr: {DAD3AB78-1990-408B-BCE2-EBA673DACC10} - 1382400
Attr: {E2724BB8-E676-4806-B4B2-A8D6EFB44CCD} - 2
Attr: {E3371D41-B4CF-4A05-BD4E-20B88BB2C4D6} - 128849018881
Attr: {F7E34C9A-42E8-4714-B74B-CB29D72C35E5} - {3231564E-0000-0010-8000-00AA00389B71}
PlatformDependent/MetroPlayer/WebCam/VideoMediaSink.cpp:608 (Webcam::VideoMediaSink::GetStreamSinkById@120CC880) FAILED hr=c00d36b3
Unloading 0 Unused Serialized files (Serialized files now loaded: 0)

Unloading 54 unused Assets to reduce memory usage. Loaded Objects now: 13581. Operation took 399.603394 ms.

System memory in use: 45.6 MB.

The thread 0x11c0 has exited with code 0 (0x0).

There appear to be a number of errors happening here. Are the capabilities for the project set correctly?

  • Looks like the script keeps trying to start the phrase recognizer when it is already running. I believe you can only have 1 phrase recognizer running at a time, this includes grammar, keyword, and dictation recognizer.

  • What is the double tap trying to do?

Double tap launches a panel that scan the QR using ZXing library

It would be best if you could get a callstack of the crash with a pdb files already loaded. The above log has a decent amount of noise from different systems, makes it very difficult to know what is happening.

In Debug mode (to get call stack), i am not able to reproduce crash. Release mode doesn’t give callstack?

It sounds like it might be the QR using ZXing library you are trying to access with double tap. You can get a call stack if you have the debugger attached from visual studio in release, but you need to load the pdb files once you hit the exception to better understand the crash.

I was able to narrow down the scenario. The app crashes when i try to access camera by creating another instance.
protected virtual bool _InitializeCamera()
{
Debug.Log(“QR _InitializeCamera called”);
try
{
_CleanupCamera();
WebCamDevice[ ] oCameras = WebCamTexture.devices;

foreach (WebCamDevice oCamera in oCameras)
{
Debug.Log("QR Web Device: " + oCamera.name);
}
m_oCamera = new WebCamTexture(oCameras[0].name);
m_oCamera.Play(); //It crashes here.
m_oImageBufferColor32 = new Color32[m_oCamera.width * m_oCamera.height];
m_oImageBufferBytes = new byte[m_oImageBufferColor32.Length * 3];
}


protected virtual Result _CleanupCamera()
{
try
{
StopAllCoroutines();

m_oImageBufferColor32 = null;
m_oImageBufferBytes = null;
WebCamTexture oCamera = m_oCamera;
if (oCamera == null)
{
return true;
}

m_oCamera = null;
oCamera.Stop();
return true;
}
catch (Exception oException)
{
return Result.FromException(oException);
}
}
When trying to access camera through multiple instance, it chases i suppose.
SOmething similar to this issue : Camera to render texture crash ? - Unity Engine - Unity Discussions

I tried it in Unity 5.6.0f3 but again it crashes here. A double tap (where the same camera is accessed twice ) crashes the application.
Platform: Hololens (UWP)

Although the issue seems to be fixed as per documentaion of this version, i am still getting app crash on webcamtexture.play()