IAP crashes Unity?

shapesim
Contributor

IAP crashes Unity?

I integrated IAP using the examples supplied, querying users' purchased items for example at game start.

 

But randomly after game launch, Unity just quits. If I dig into the error reports, I see some access violation. 

 

If I remove my GameObject that queries Viveport IAP, I no longer get the crash. 

 

Pasting a partial log here. Does this help to address this issue? Right now it's unusable for me

 

 

Unity Editor by Unity Technologies [version: Unity 2018.1.6f1_57cc34175ccf]

Unknown caused an Access Violation (0xc0000005)
in module Unknown at 0033:3b7003e8.

Error occurred at 2018-07-06_194230.
C:\Program Files\Unity2018.1.6f1\Editor\Unity.exe, run by zfore.

84% physical memory in use.
8059 MB physical memory [1214 MB free].
1269 MB process peak paging file [1269 MB used].
856 MB process peak working set [856 MB used].
System Commit Total/Limit/Peak: 14306MB/26312MB/31012MB
System Physical Total/Available: 8059MB/1214MB
System Process Count: 277
System Thread Count: 3572
System Handle Count: 133194
Disk space data for 'C:\Users\zfore\AppData\Local\Temp\Unity\Editor\Crashes\Crash_2018-07-07_024228400\': 18909765632 bytes free of 240463638528 total.

Write to location 0000000000000000 caused an access violation.

Context:
RDI: 0xffffffffffffffff RSI: 0x0000000000007ffc RAX: 0x0000000000000000
RBX: 0x0000000052ecba30 RCX: 0x000000006d88ea03 RDX: 0x00000000533b4540
RIP: 0x000000003b7003e8 RBP: 0x000000006d88ea20 SegCs: 0x0000000000000033
EFlags: 0x0000000000010206 RSP: 0x000000006d88e918 SegSs: 0x000000000000002b
R8: 0x00007ffce0f72870 R9: 0x000000006d88ccb0 R10: 0x0000000000000000
R11: 0x000000006d88e860 R12: 0x00007ffce0f23e28 R13: 0x0000000053363930
R14: 0x000000003b7003c0 R15: 0x0000000053363800


Bytes at CS:EIP:
01 00 00 00 00 00 76 0c 4c 89 5d f8 48 c7 45 d8

*** WARNING ***
Managed call stack frames will be incorrect or missing.
The Mono DLL at 'C:\Program Files\Unity2018.1.6f1\Editor\Data\Mono\EmbedRuntime\mono.dll' does not provide out-of-process stack information support.
Upgrade to a newer version of the Mono Scripting Runtime for more detailed debug information.


Stack Trace of Crashed Thread 49872:
ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 000000003B7003E8)
ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 000000003B7003E8)
0x000000003B7003E8 ((<unknown>)) (function-name not available)
0x00007FFCE0E8E558 (viveport_api) Viveport::InternalAnalytics::Manager:Smiley Frustratedhutdown
0x00007FFCE0E9F637 (viveport_api) Viveport::InternalAnalytics::MessageTransactor:Smiley SurprisednTransact
0x00007FFCE0EC7FE9 (viveport_api) Json:Smiley FrustratedtyledWriter::writeWithIndent
0x00007FFCE0E9EFB7 (viveport_api) Viveport::InternalAnalytics::MessageTransactor:Smiley SurprisednTransact
0x00007FFCE0E9EE26 (viveport_api) Viveport::InternalAnalytics::MessageTransactor:Smiley SurprisednTransact
0x00007FFCE0ED1AF0 (viveport_api) Json:Smiley FrustratedtyledWriter::writeWithIndent
0x00007FFCE0EE0C4F (viveport_api) Json:Smiley Tongueath::invalidPath
0x00007FFCE0EE0DF6 (viveport_api) Json:Smiley Tongueath::invalidPath
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart

Stacks for Running Threads:

Call Stack for Thread 41220:
0x00000001401927DB (Unity) CalculateGlobalRotation
0x00000001401957E7 (Unity) Transform::GetRotation
0x0000000140B47062 (Unity) ComparePosesApproximately
0x0000000140B53BFF (Unity) Rigidbody::WritePose
0x0000000140B345C7 (Unity) PhysicsManager:Smiley Frustratedimulate
0x0000000140B2D228 (Unity) `PhysicsManager::InitializeClass'::`2'::FixedUpdatePhysicsFixedUpdateRegistrator::Forward
0x000000014094711B (Unity) ExecutePlayerLoop
0x00000001409471E4 (Unity) ExecutePlayerLoop
0x0000000140949CCC (Unity) PlayerLoop
0x00000001413C9387 (Unity) PlayerLoopController::UpdateScene
0x00000001413C8234 (Unity) Application::TickTimer
0x00000001415C1BBD (Unity) MainMessageLoop
0x00000001415C3EAC (Unity) WinMain
0x000000014209A3D7 (Unity) __scrt_common_main_seh
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 14188:
0x00007FFD20C3D804 (ntdll) ZwWaitForWorkViaWorkerFactory
0x00007FFD20BBF856 (ntdll) RtlReleaseSRWLockExclusive
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 41204:
0x00007FFD20C3D804 (ntdll) ZwWaitForWorkViaWorkerFactory
0x00007FFD20BBF856 (ntdll) RtlReleaseSRWLockExclusive
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 43636:
0x00007FFD20C3D804 (ntdll) ZwWaitForWorkViaWorkerFactory
0x00007FFD20BBF856 (ntdll) RtlReleaseSRWLockExclusive
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 39324:
0x00007FFD20C39F34 (ntdll) NtWaitForSingleObject
0x00007FFD1D009252 (KERNELBASE) WaitForSingleObjectEx
0x0000000140AEC2C8 (Unity) profiling:Smiley Very Happyispatcher::ThreadFunc
0x0000000140A71A08 (Unity) Thread::RunThreadWrapper
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 27792:
0x00007FFD20C3D804 (ntdll) ZwWaitForWorkViaWorkerFactory
0x00007FFD20BBF856 (ntdll) RtlReleaseSRWLockExclusive
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 21680:
0x00007FFD20C3D804 (ntdll) ZwWaitForWorkViaWorkerFactory
0x00007FFD20BBF856 (ntdll) RtlReleaseSRWLockExclusive
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 22160:
0x00007FFD20C3AA04 (ntdll) ZwWaitForMultipleObjects
0x00007FFD1D016099 (KERNELBASE) WaitForMultipleObjectsEx
0x00007FFD1E912AB7 (combase) CoGetProcessIdentifier
0x00007FFD1E90CE40 (combase) CoGetProcessIdentifier
0x00007FFD1E90FF11 (combase) CoGetProcessIdentifier
0x00007FFD1E9575DC (combase) CoRegisterPSClsid
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 23668:
0x00007FFD20C3A534 (ntdll) NtDelayExecution
0x00007FFD1D015E9A (KERNELBASE) SleepEx
0x00000001401AE1B8 (Unity) CurlRequest::MessageThread
0x00000001401AF779 (Unity) CurlRequest::_ThreadEntryPoint
0x0000000140A71A08 (Unity) Thread::RunThreadWrapper
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 11104:
0x00007FFD20C39FD4 (ntdll) NtRemoveIoCompletion
0x00007FFD1C73F338 (mswsock) Tcpip6_WSHStringToAddress
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 41588:
0x00007FFD20C39FD4 (ntdll) NtRemoveIoCompletion
0x00007FFD1D022E92 (KERNELBASE) GetQueuedCompletionStatus
0x00007FFCBA69E797 (libcef) IsSandboxedProcess
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 35940:
0x00007FFD20C39FD4 (ntdll) NtRemoveIoCompletion
0x00007FFD1D022E92 (KERNELBASE) GetQueuedCompletionStatus
0x00007FFCB86D592F (libcef) cef_trace_event_instant
0x00007FFCB86D4F3E (libcef) cef_trace_event_instant
0x00007FFCB86D551B (libcef) cef_trace_event_instant
0x00007FFCB86C08B0 (libcef) cef_trace_event_instant
0x00007FFCB86A7DF8 (libcef) cef_trace_event_instant
0x00007FFCB86C0F57 (libcef) cef_trace_event_instant
0x00007FFCB86A5A4F (libcef) cef_trace_event_instant
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 38432:
0x00007FFD20C39F34 (ntdll) NtWaitForSingleObject
0x00007FFD1D009252 (KERNELBASE) WaitForSingleObjectEx
0x00007FFCB86D60FE (libcef) cef_trace_event_instant
0x00007FFCB86C08B0 (libcef) cef_trace_event_instant
0x00007FFCB86A7DF8 (libcef) cef_trace_event_instant
0x00007FFCB86C0F57 (libcef) cef_trace_event_instant
0x00007FFCB86A5A4F (libcef) cef_trace_event_instant
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 26620:
0x00007FFD20C39F34 (ntdll) NtWaitForSingleObject
0x00007FFD1D009252 (KERNELBASE) WaitForSingleObjectEx
0x00007FFCB90EFD09 (libcef) cef_get_min_log_level
0x00007FFCB8F81B10 (libcef) cef_get_min_log_level
0x00007FFCBA12DB87 (libcef) cef_get_min_log_level
0x00007FFCBA12DD2E (libcef) cef_get_min_log_level
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 41644:
0x00007FFD20C39F34 (ntdll) NtWaitForSingleObject
0x00007FFD1D009252 (KERNELBASE) WaitForSingleObjectEx
0x00007FFCB916CEC1 (libcef) cef_get_min_log_level
0x00007FFCB8F81B10 (libcef) cef_get_min_log_level
0x00007FFCBA12DB87 (libcef) cef_get_min_log_level
0x00007FFCBA12DD2E (libcef) cef_get_min_log_level
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 41704:
0x00007FFD20C39F34 (ntdll) NtWaitForSingleObject
0x00007FFD1D009252 (KERNELBASE) WaitForSingleObjectEx
0x00007FFCB916CEC1 (libcef) cef_get_min_log_level
0x00007FFCB8F81B10 (libcef) cef_get_min_log_level
0x00007FFCBA12DB87 (libcef) cef_get_min_log_level
0x00007FFCBA12DD2E (libcef) cef_get_min_log_level
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 40636:
0x00007FFD20C39F34 (ntdll) NtWaitForSingleObject
0x00007FFD1D009252 (KERNELBASE) WaitForSingleObjectEx
0x00007FFCB916CEC1 (libcef) cef_get_min_log_level
0x00007FFCB8F81B10 (libcef) cef_get_min_log_level
0x00007FFCBA12DB87 (libcef) cef_get_min_log_level
0x00007FFCBA12DD2E (libcef) cef_get_min_log_level
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 29052:
0x00007FFD20C39F34 (ntdll) NtWaitForSingleObject
0x00007FFD1D009252 (KERNELBASE) WaitForSingleObjectEx
0x00007FFCB86D60FE (libcef) cef_trace_event_instant
0x00007FFCB86C08B0 (libcef) cef_trace_event_instant
0x00007FFCB86A7DF8 (libcef) cef_trace_event_instant
0x00007FFCB8997C6E (libcef) SetCrashKeyValueImpl
0x00007FFCB89986E3 (libcef) SetCrashKeyValueImpl
0x00007FFCB86C0F57 (libcef) cef_trace_event_instant
0x00007FFCB86A5A4F (libcef) cef_trace_event_instant
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 29096:
0x00007FFD1E0196E4 (win32u) NtUserMsgWaitForMultipleObjectsEx
0x00007FFD1E72029D (USER32) MsgWaitForMultipleObjectsEx
0x00007FFCB86D5AB7 (libcef) cef_trace_event_instant
0x00007FFCB86D500E (libcef) cef_trace_event_instant
0x00007FFCB86D551B (libcef) cef_trace_event_instant
0x00007FFCB86C08B0 (libcef) cef_trace_event_instant
0x00007FFCB86A7DF8 (libcef) cef_trace_event_instant
0x00007FFCB8997CFE (libcef) SetCrashKeyValueImpl
0x00007FFCB89986FF (libcef) SetCrashKeyValueImpl
0x00007FFCB86C0F57 (libcef) cef_trace_event_instant
0x00007FFCB86A5A4F (libcef) cef_trace_event_instant
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 19148:
0x00007FFD20C39F34 (ntdll) NtWaitForSingleObject
0x00007FFD1D009252 (KERNELBASE) WaitForSingleObjectEx
0x00007FFCB86D60FE (libcef) cef_trace_event_instant
0x00007FFCB86C08B0 (libcef) cef_trace_event_instant
0x00007FFCB86A7DF8 (libcef) cef_trace_event_instant
0x00007FFCB8997D8E (libcef) SetCrashKeyValueImpl
0x00007FFCB899871B (libcef) SetCrashKeyValueImpl
0x00007FFCB86C0F57 (libcef) cef_trace_event_instant
0x00007FFCB86A5A4F (libcef) cef_trace_event_instant
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 14304:
0x00007FFD20C39F34 (ntdll) NtWaitForSingleObject
0x00007FFD1D009252 (KERNELBASE) WaitForSingleObjectEx
0x00007FFCB86D60FE (libcef) cef_trace_event_instant
0x00007FFCB86C08B0 (libcef) cef_trace_event_instant
0x00007FFCB86A7DF8 (libcef) cef_trace_event_instant
0x00007FFCB89985FE (libcef) SetCrashKeyValueImpl
0x00007FFCB8998737 (libcef) SetCrashKeyValueImpl
0x00007FFCB86C0F57 (libcef) cef_trace_event_instant
0x00007FFCB86A5A4F (libcef) cef_trace_event_instant
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 2052:
0x00007FFD20C39FD4 (ntdll) NtRemoveIoCompletion
0x00007FFD1D022E92 (KERNELBASE) GetQueuedCompletionStatus
0x00007FFCB86D592F (libcef) cef_trace_event_instant
0x00007FFCB86D4F3E (libcef) cef_trace_event_instant
0x00007FFCB86D551B (libcef) cef_trace_event_instant
0x00007FFCB86C08B0 (libcef) cef_trace_event_instant
0x00007FFCB86A7DF8 (libcef) cef_trace_event_instant
0x00007FFCB8997ABE (libcef) SetCrashKeyValueImpl
0x00007FFCB8998753 (libcef) SetCrashKeyValueImpl
0x00007FFCB86C0F57 (libcef) cef_trace_event_instant
0x00007FFCB86A5A4F (libcef) cef_trace_event_instant
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 18040:
0x00007FFD20C39FD4 (ntdll) NtRemoveIoCompletion
0x00007FFD1D022E92 (KERNELBASE) GetQueuedCompletionStatus
0x00007FFCB86D592F (libcef) cef_trace_event_instant
0x00007FFCB86D4F3E (libcef) cef_trace_event_instant
0x00007FFCB86D551B (libcef) cef_trace_event_instant
0x00007FFCB86C08B0 (libcef) cef_trace_event_instant
0x00007FFCB86A7DF8 (libcef) cef_trace_event_instant
0x00007FFCB8997FEE (libcef) SetCrashKeyValueImpl
0x00007FFCB899876F (libcef) SetCrashKeyValueImpl
0x00007FFCB86C0F57 (libcef) cef_trace_event_instant
0x00007FFCB86A5A4F (libcef) cef_trace_event_instant
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 39596:
0x00007FFD20C39F34 (ntdll) NtWaitForSingleObject
0x00007FFD1D009252 (KERNELBASE) WaitForSingleObjectEx
0x00007FFCB86D60FE (libcef) cef_trace_event_instant
0x00007FFCB86C08B0 (libcef) cef_trace_event_instant
0x00007FFCB86A7DF8 (libcef) cef_trace_event_instant
0x00007FFCB86C0F57 (libcef) cef_trace_event_instant
0x00007FFCB86A5A4F (libcef) cef_trace_event_instant
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart


Call Stack for Thread 47428:
0x00007FFD20C3D7A4 (ntdll) ZwWaitForAlertByThreadId
0x00007FFD20C15412 (ntdll) RtlSleepConditionVariableCS
0x00007FFD1D03EB28 (KERNELBASE) SleepConditionVariableCS
0x00007FFCB86DBB5E (libcef) cef_trace_event_instant
0x00007FFCB86BF8AE (libcef) cef_trace_event_instant
0x00007FFCB86BEE73 (libcef) cef_trace_event_instant
0x00007FFCB86DBEDD (libcef) cef_trace_event_instant
0x00007FFCB86A5A4F (libcef) cef_trace_event_instant
0x00007FFD1F5C3034 (KERNEL32) BaseThreadInitThunk
0x00007FFD20C11431 (ntdll) RtlUserThreadStart

Jake_Hu
New Arrival

Re: IAP crashes Unity?

 Hi shapesim,

 

Could you please let me know?

1. What is your API called order? ex: IsReady -> request -> query?
2.Did you get the VIVEPORT ID and API key from the developer console?

3. What is your PC OS?

4. Did you install the viveport desktop launcher?

Vive Staff

Re: IAP crashes Unity?

Hi @shapesim

Could you please let us know the questions Jake raises above?  We need some information to know what the problem is. Thanks a lot.

shapesim
Contributor

Re: IAP crashes Unity?

Hi there

 

1. Upon start, my IAP class calls IAPurchase.IsReady, and then IAPurchase.Query to check for bought item. IAPurchase.Request is called only at the buying step, which we don't reach because the crash happens upon launch.

2. Yes

3. Windows 10 64bit. Unity 2018. Also reverted to Unity 2017 but no difference

4. Yes. It launches as well when my app launches

 

I attached my source code via private message to you. Maybe I need to wait for isReady to finish properly. I thought at most I would just be denied purchase.

 

Thanks

Bobby

 

@yakingkuo

Vive Staff

Re: IAP crashes Unity?

Hi shapesim: 

Thanks for your reply. I did not receive your message. Could you send your code to me by email: yaking_kuo@htc.com 

Thanks a lot. 

 

Vive Staff

Re: IAP crashes Unity?

Hi @shapesim

 

I have not received your code snippet yet, did you fix your issue? 

 

-Yaking

shapesim
Contributor

Re: IAP crashes Unity?

I sent in private message to Jake few days ago.

 

Then, after seeing your message I sent to your email address as well.

 

Sorry for the confusion. I am still having the same issue.

 

@yakingkuo