mtaulty / QrCodes

MIT License
30 stars 20 forks source link

Access Violation crash after several scans. #1

Closed ArneMayer closed 7 years ago

ArneMayer commented 7 years ago

Im using this project in my app to scan qr codes but after several scans the application exits with an access violation error (no exception, just an exit code). Does anyone else have this problem?

mtaulty commented 7 years ago

I think I've seen this - haven't had opportunity to debug it to the point of understanding quite where it's coming from yet though I'm afraid.

mattfedocsg commented 7 years ago

Yea I am coming across it as well. I even tried changing the result of the callback to just a string with no luck. It always happens on the second result, no matter what for me. Is it maybe due to the time out await? I made the time out only 5 seconds and removed everything from memory, but that didnt work. There has to be something that is getting called in memory where it doesnt exist.

mattfedocsg commented 7 years ago

The thread 0x414 has exited with code 0 (0x0). The thread 0xc60 has exited with code 0 (0x0). The thread 0x1338 has exited with code 0 (0x0). Exception thrown: 'System.Exception' in Assembly-CSharp.dll The program '[2232] Hololens.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.

mtaulty commented 7 years ago

I reworked the code to try and fix this - the solution is perhaps a bit less 'elegant' than it was but I can run many times and I don't see this crash any more.

ArneMayer commented 7 years ago

Unfortunately, it doesn't recognize any codes anymore for me.

mtaulty commented 7 years ago

Woops - that doesn't sound good. Is this in Unity? in Xaml? In Both?

ArneMayer commented 7 years ago

We are using the scanner on the hololens, which is a unity project.

mtaulty commented 7 years ago

That's not good. I just cloned down the latest bits. I opened the Unity project. I built the Visual Studio solution. I deployed from Visual Studio to my HoloLens. I scanned the same QR code 10 times one after the other using what I deployed. The QR code was on my 2nd monitor approximately 40-50cm in front of the HoloLens and it's approximately 3cm high and was generated from the QR code generator that you find if you search Bing for QR codes.

So, this seems to be working for me - can you provide more detail or maybe help debug what's happening on your system?

ArneMayer commented 7 years ago

I found the problem. It was on my side. Previously, a team member of ours had modified the code to read barcodes instead. Of course, this was gone once I recompiled the code with the latest version of MediaFrameQrProcessing. I wasn't aware that a modification had been necessary for the code to recognize barcodes. Sorry for the confusion. Thank you for fixing the access violation :-)

mtaulty commented 7 years ago

No problem - glad that it's been improved by the fix.