Search Unity

Platform::COMException ^ at memory location 0x0669FAB0. HRESULT:0x80070490 Element not found.

Discussion in 'Windows' started by goat, Dec 22, 2014.

  1. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Hmm, that's one mysterious crash for sure. Could you by chance go to project properties, debugging, select native only debugger, then run the project until it crashes with an unhandled exception and then do Debug -> "Save dump as..."? Once you've done it, a dump file will be created, which you could submit to us for investigation.
     
  2. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    OK, I'll try that. Uh, it didn't throw the usual exception this time. It said it had a stowed exception. Should I until, clean, & run?

    Also, I will submit with Unity Bug Tool & post the number I get here.
     
    Last edited: Jan 7, 2015
  3. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Case Number is 661462
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Hi,

    got the dump. Your application crashed with error 0xC000027B. That is and out of memory error. Check this:

    http://msdn.microsoft.com/en-us/library/windows/desktop/ms681388(v=vs.85).aspx

    How much memory does your device have? Did you try turning off other applications while running the game? Did you by any chance disable paging?
     
  5. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Well that's one reason I clean installed Windows 8.1, used 64 bit Windows and have only installed iTunes. You know how every SW maker just has to have their own terminate & stay resident helper app but...

    I have 4 GB RAM of which Windows has always said from the beginning only 3.79 GB are available because of the shared memory of the Intel HD Graphics on board I guess. I have paging active and I have hibernation active.

    Only thing running that I would have started manually are Unity Free 4.6.1p2 and VS Ultimate 2013. I get the same results if I close Unity or I close VS 2013 or close both and only run installed app.

    I think low virtual memory is actually is a stack is being blown. If I were to 'continue' with VS2013' I'd get the blown stack. There seems to be a recursion that doesn't have it's stop condition met.

    I can run the app (it's Blank) with IE and everything closed too if you like, that would give it about 3.25 GB to use and send that crash dump to you.

    I get these now with it from the event log with only IE & the App 'Blank' (Blank will cycle crash') running.

    Code (csharp):
    1.  
    2. Faulting application name: Template.exe, version: 1.0.0.0, time stamp: 0x54ad4416
    3. Faulting module name: combase.dll, version: 6.3.9600.17031, time stamp: 0x53086d7c
    4. Exception code: 0xc000027b
    5. Fault offset: 0x000fb1d7
    6. Faulting process id: 0xbd0
    7. Faulting application start time: 0x01d02e7f00735d15
    8. Faulting application path: C:\Users\Jack\Downloads\Blank\Blank\Blank\bin\x86\Debug\AppX\Template.exe
    9. Faulting module path: C:\Windows\SYSTEM32\combase.dll
    10. Report Id: 41968213-9a72-11e4-8257-c48508a74fc1
    11. Faulting package full name: Blank_1.0.0.0_x86__pzq3xp76mxafg
    12.  
    Code (csharp):
    1.  
    2. Fault bucket 98906562423, type 5
    3. Event Name: MoAppCrash
    4. Response: Not available
    5. Cab Id: 98926025917
    6. Problem signature:
    7. P1: Blank_1.0.0.0_x86__pzq3xp76mxafg
    8. P2: praid:App
    9. P3: 1.0.0.0
    10. P4: 54ad4416
    11. P5: combase.dll
    12. P6: 6.3.9600.17031
    13. P7: 53086d7c
    14. P8: 80070490
    15. P9: 00053bff
    16. P10:
    17. Attached files:
    18. C:\Users\Jack\AppData\Local\Temp\WER7420.tmp.WERInternalMetadata.xml
    19. C:\Users\Jack\AppData\Local\Temp\WER7654.tmp.appcompat.txt
    20. C:\Users\Jack\AppData\Local\Temp\WER76D2.tmp.dmp
    21. C:\Users\Jack\AppData\Local\Temp\WER7924.tmp.WERDataCollectionFailure.txt
    22. These files may be available here:
    23. C:\Users\Jack\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_Blank_1.0.0.0_x8_4b6c807e3506ee9b86f361dc42cff2a8aba16f1_ccba75d4_cab_3ce27e32
    24. Analysis symbol:
    25. Rechecking for solution: 0
    26. Report Id: 41968213-9a72-11e4-8257-c48508a74fc1
    27. Report Status: 8
    28.  
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Could you show me a screenshot of your page file settings? Here's mine (just so you know exactly what I need):



    You can access it from Control Panel -> All Control Panel Settings -> System -> Advanced System Settings -> Advanced -> Performance Settings -> Advanced -> "Change..."
     
  7. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    VirtualMemory.png


    OK, here is mine and I currently have more 'currently allocated' although I doubt very much I have more thing running than you currently. The only non-windows thing that is TSR are the Bonjour (0.8MB), MobileDeviceService (0.8MB), iPodServiceModule (0.8MB), iTunes Helper (0,4MB),ThrottleStop (0.6MB), & VirtualCloneDriveDaemon (32 bit) (0.2MB).

    As you see not much at all and all but Throttle Stop & Virtual Clone Drive are part of iTunes. All the other background process came via Windows 8.1 or VS 2013 install and Windows Update.

    Among all those windows updates are a slew of ASUS supplied services which I don't have much confidence in given the speed at with they abandoned support of this Microsoft Signature HW, e.g,:

    There is a 'hacky looking' TSR that was installed by Microsoft Update supplied by ASUS: "Fix Win8 TP issues-final version (32 bit)" (at 0.6MB)


    Does maybe now unity & VS 2013 together require 8GB RAM? However I hope plain Windows Store apps can handle only 1 GB RAM for customer with WinRT machines.
     
    Last edited: Jan 13, 2015
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    I misinterpreted the crash log - I apologize for that. Looks like the crash happens when we try to use the accelerometer. This will be marked as a bug and investigated/fixed.

    This is a pretty obscure issue, probably related to drivers. Do you have all Windows updates installed? Up until we fix it, I suggest you try that. If it doesn't work, I'm not sure I have a workaround for you, unfortunately :/.
     
  9. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Hey,

    That is OK if you can't fix it. I may be the only person with this HW actively using Unity. I plan to replace it with new HW later in 2015 and then this was going to be a test only tablet but since I've seen WinRT tablets for less than $100 that shouldn't give me this problem I'll probably buy one of those too.

    I have all updates installed via Windows Update.

    I have .Net 4.5.2 installed from Windows Update too.

    Thanks.
     
    Last edited: Jan 14, 2015
  10. diamond-msc

    diamond-msc

    Joined:
    Jan 16, 2015
    Posts:
    6
  11. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Interesting. Maybe Unity can make an easy kludge now.

    Is the Chipmunk test supplied as example by MS? Link?

    I will be clean installing the latest Windows 8.1 x64 + SP1 early next week. I will try to test situation again before the ASUS supplied drivers to MS are installed.

    I think the HW drivers are wrong but I'm not keen to download 10GB HW test suite from MS to test the EP121.
     
  12. diamond-msc

    diamond-msc

    Joined:
    Jan 16, 2015
    Posts:
    6
  13. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Thanks. I got that one.

    No surprise there:

    Code (csharp):
    1.  
    2. System.Exception was unhandled by user code
    3.   HResult=-2147023728
    4.   Message=Element not found. (Exception from HRESULT: 0x80070490)
    5.   Source=Windows.Devices
    6.   StackTrace:
    7.   at Windows.Devices.Sensors.Accelerometer.put_ReportInterval(UInt32 value)
    8.   at Microsoft.Samples.Devices.Sensors.AccelerometerSample.Scenario1.ScenarioEnable(Object sender, RoutedEventArgs e)
    9.   InnerException:
    10.  
    11. ...
    12.  
     
  14. diamond-msc

    diamond-msc

    Joined:
    Jan 16, 2015
    Posts:
    6
  15. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Thanks. After I clean install I will check the generated files from Unity / Visual Studio and see if I can change it or tack it in. Maybe Unity can add that in so it will be generated at the proper depth.

    But before I do that I'll do Dale's fix so you will know if that 2nd problem is a device driver problem or the coco2d API port problem.
     
  16. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    OK, I need some help with Dale's pseudocode:

    Code (csharp):
    1.  
    2. if (_accelerometer !=null)
    3.    {
    4.    // Establish the report interval
    5.  
    6.    try {
    7.         uint minInterval =0;
    8.         uint reqInterval =0;
    9.  
    10.         minInterval = _accelerometer.MinimumReportInterval;
    11.         reqInterval = _desiredReportInterval;
    12.         _accelerometer.ReportInterval = reqInterval < minInterval ? minInterval : reqInterval;
    13.         // _accelerometer.ReportInterval = _desiredReportInterval;
    14.         }// try
    15.    catch (Platform::COMException^)
    16.        {
    17.  
    18.        /* Something went wrong, continue */
    19.        CCLOG("Device::setAccelerometerInterval not supported on this device");
    20.        }// catch
    21.  
    22.    Window.Current.VisibilityChanged += newWindowVisibilityChangedEventHandler(VisibilityChanged);
    23.    _accelerometer.ReadingChanged += newTypedEventHandler<Accelerometer, AccelerometerReadingChangedEventArgs>(ReadingChanged);
    24.    ScenarioEnableButton.IsEnabled = false;
    25.    ScenarioDisableButton.IsEnabled = true;
    26.    }// if
    27. else
    28.    {
    29.  
    30.    rootPage.NotifyUser("No accelerometer found", NotifyType.ErrorMessage);
    31.    }// else
    32.  

    1) You send a float for interval to that cocos2d function what value did you set it too? Is it a constant, more or less?
     
    Last edited: Jan 19, 2015
  17. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    For your 2nd problem don't forget to check your 'Rotation Lock' button on the top, closest to center, in landscape mode. I never have interest in it til recently. Changing that doesn't stop the exception but it might solve your second problem.

    https://ep121.wordpress.com/2011/01/08/the-ep121-product-tour/
     
    Last edited: Jan 17, 2015
  18. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    OK, I clean installed Windows 8.1 * VS 2013 from latest MSDN ISOs to be sure...

    And as you see above I added Dale's changes but that have no effect in the example:

    https://code.msdn.microsoft.com/windowsapps/Accelerometer-Sensor-Sample-22982671

    From the example I could 'Enable' 'shake' without an exception but not 'polling' or 'data events' - those both caused the same error.

    By the way, although I could enable shake (no external monitor, USB devices, or external power supply) the example program did not count any shakes when I tested. It stayed at 0.

    I can tell you having an external monitor connected disables Autorotate as you'd expect. Not so with external PS or USB devices because I suppose it with be too limiting to one using the tablet.

    There are several problems it seems they aren't handling some of them on EP121 and similar HW :

    1) External Monitor connected: Autorotate (Accelerometer) off regardless of Autorotate button but touch can stay on if on.

    2) No external monitor - Autorotate on depends on the position of the autorotate button but touch can stay on if on.

    3) HW show software keyboard - would be nice if such a HW /SW button could be used in Unity app like with iOS & Android? Can it yet?

    4) HW / SW disable touch - makes no sense really - if you have touch keep it on. Exceptions should be done by administrator.

    5) 1 - 4 with external power supply (safety improvement - poll and warn if trying to use autorotate)

    6) 1 - 4 with connect USB devices (safety improvement - poll and warn if trying to use autorotate)

    So the drivers have to handle these cases to give the proper perspective of the OS state to Unity or CoCos2D. I'm not sure if they are, they seem not to completely.

    I'm not sure why the code Dale gave fixed the example for you but not me. Did you use only in cocos2d Chipmunk example or both examples?
     
    Last edited: Jan 19, 2015
  19. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    This is for the Unity guys - I'm supposing if I was to buy a WindowRT tablet and publish to that then this problem would go away but how to publish to Windows Store for Windows 8.1 x86 without buying a new convertible tablet PC?

    Create & Save to VS 2013 Project in Unity using Windows Store -> Universal 8.1, test on the WinRT tablet, and then exclude the EP121 from the compatible HW list?

    Maybe I need to talk to MS support instead.
     
    Last edited: Jan 19, 2015
  20. diamond-msc

    diamond-msc

    Joined:
    Jan 16, 2015
    Posts:
    6
    The code applies to the C++ version of the MS example, and it worked for me. I just applied it to the relevant instances of "ReportInterval =", e. g.:

    try { // added try
    accelerometer->ReportInterval = desiredReportInterval; // this is the original line
    } catch (Platform::COMException^) {} // added catch
     
  21. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    I downloaded the C# version...what I've done should work too as I looked at Dale's code in cocos2d tree. Seems there is a subtle difference in the way C++ & C# are compiled to binaries and they don't behave the same. I will download the C++ version of the project.
     
  22. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    OK, I downloaded and tried the try/catch code you gave and it didn't work for me.

    Now I'm not current on state of the art compilers and build in test initializations, object and memory management, and diagnostics but both the try/catch solution you gave and Dale's if/else C# cocos2d solution seem to be redundant tests and both fail on my computer.


    a. accelerometer object must be created

    &

    b. accelerometer->ReportInterval object must be created after the accelerometer object is created

    but since accelerometer->ReportInterval is just a simple uint wouldn't assignment be enough once the accelerometer object was created?

    I also AND-ed a check of accelerometer->ReportInterval with accelerometer to no effect in the C# code.

    I'm not sure really except the C++ conveniently cause VS to bring up the header containing the core exception code in a switch statement & I can see this error as VS reports falls through to default for the user to handle.
     
    Last edited: Jan 19, 2015
  23. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    OK, I've done a bit more work and again it point to access permission or lack of them.

    look at this code:

    Code (csharp):
    1.  
    2. // Establish the report interval
    3. try
    4.      {
    5.          
    6.      rootPage->NotifyUser("accelerometer->ReportInterval = "+accelerometer->ReportInterval, NotifyType::ErrorMessage);
    7.      accelerometer->ReportInterval = desiredReportInterval;
    8.      }// try
    9. catch (Platform::COMException^)
    10.      {
    11.      /* Do Nothing */;
    12.      }// catch
    13.  
    The exception here still gets thrown at:

    accelerometer->ReportInterval = desiredReportInterval;

    not at:

    rootPage->NotifyUser("accelerometer->ReportInterval = "+accelerometer->ReportInterval, NotifyType::ErrorMessage);

    because that is read access to the field, the exception gets thrown on an attempt to write to that field.

    I guess I need to figure out how to access this definition:

    accelerometer->*

    and wonder if ASUS made it super restrictive in their implementation of the sensor drivers???

    I will look through my old emails and see if I can find the email from the ASUS engineer. They don't want to implement it wrong again on their new HW.

    I will try the Win32 build now & see if that works.
     
  24. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    OK I tried Win32 and no surprise same problem.


    I did check the MS definition and here it is:

    Code (csharp):
    1.  
    2. public : property unsigned int ReportInterval { get; set; }
    3. Member of Windows::Devices::Sensors::IAccelerometer
    4.  

    and it is public with get & set methods.

    Unless you or Unity has suggestions I will contact ASUS and see what they say. I still don't understand why it works for you now but not me.
     
  25. diamond-msc

    diamond-msc

    Joined:
    Jan 16, 2015
    Posts:
    6
    You're right. The exception happens on "set" (ReportInterval=), not on "get" (x=ReportInterval). And yes, this seems to violate the current MS specs.
    Regarding the fix:
    You should be aware that in Debug mode the exception is still reported as "1st Chance Exception", which is purely informational. After continuing (ignoring the exception) it should be swallowed by the catch and the example should work. That's what it does for me.
     
  26. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    OK, before I send an email to ASUS I commented out the assignment line so the code looks like this:

    Code (csharp):
    1.  
    2. if (accelerometer != nullptr)
    3. {
    4. // Establish the report interval
    5. try
    6. {
    7. rootPage->NotifyUser("accelerometer->ReportInterval = "+accelerometer->ReportInterval, NotifyType::ErrorMessage);
    8. // accelerometer->ReportInterval = desiredReportInterval;
    9. }// try
    10. catch (Platform::COMException^)
    11. {
    12. ;
    13. }
    14.  
    and now the code runs and reports

    accelerometer->ReportInterval = 125

    while once the 'Data Events' are Enabled the X, Y, & Z vary swiftly from [-0.0[0-9]*, -0.0[0-9]*], [-1, -0.9*], [-0.1[0-9]*, -0.2[0-9]*

    I guess I'll ask ASUS now to look. I could be the ASUS decided to lock down that report interval in their driver as that seems reasonable to keep from polling more than the HW/SW can handle but excludes cases were you want to decrease polling rates but then that's handled by MinimumReportInterval.

    I think the definition was changed after ASUS published their driver.


    Thanks for your help.
     
  27. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Thanks. I will continue then after I uncomment the commented line.

    OK, so that works until you 'Disable' and I'm now downloading symbols from MSDN as that seems to be another symptom of the same problem.

    I'd like to just comment out that line or test for HW but that's not really practical for Unity to do. I will write ASUS.
     
  28. diamond-msc

    diamond-msc

    Joined:
    Jan 16, 2015
    Posts:
    6
    "Disable" simply does another failing call: it sets ReportInterval = 0. Same problem, same workaround.
     
  29. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Thanks I'll look at that after I finish my eMail to ASUS since I'm not too hopeful of Unity including a set of workarounds for 2 1/2 year old HW drivers. I need to get into the VS/Unity generated code and see if I'll have access to it. :)
     
  30. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    How to you do

    try / catch in .Net & C#?

    I have but it's wrong:

    Code (csharp):
    1.  
    2. try
    3. {
    4.  
    5. _accelerometer.ReportInterval = _desiredReportInterval;
    6. }//if
    7. catch // (IOException e) <- Error
    8. {
    9.  
    10. // Something went wrong, continue - Platform::COMException^
    11. rootPage.NotifyUser("Platform::COMException - _accelerometer.ReportInterval = "+_accelerometer.ReportInterval, NotifyType.ErrorMessage);
    12. }// else
    13.  
    I just did a catch but I'd like something more refined in C# too.
     
    Last edited: Jan 20, 2015
  31. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    OK, thanks again.

    It makes more sense now, maybe I'll get the hang of tracing in VS / C# / .NET. One thing that it's takes some getting used to as one that primarily programmed in C in the past is remembering these odd error messages with private, public, and so on in these OO languages. I only ever did one major OO implementation in the past and I decided to do that with porting C code to C++ templates rather than convert to classes. So not much to that and not having the source code takes getting used to too.

    I can't fix the exception in any Unity/VS generated code I have access to but one of the places the exception happens is:

    MTSensorInput<Windows::Devices::Sensors::Accelerometer,Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs>::InternalUpdateIntervalImpl(void)

    and here is the set:

    07BCE8AF E8 CE 92 F9 FE call Windows::Devices::Sensors::IAccelerometer::ReportInterval::set (06B67B82h)

    That's only one, there are likely more calls.

    Unity knows about this already and I opened a request for a new G-Sensor driver with ASUS a few hours ago. The best would be for ASUS to update the driver but in your case at least you have access to update the offending code with a try / catch.
     
  32. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    The ASUS technical support says ASUS does not support the EP121 past Windows 8.0 so they supported that tablet approximately 1 1/2 years which is extremely poor track record.
     
  33. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    One thing to check is whether you actually get into catch block. Exception might be thrown and cought inside ReportInterval::Set.
     
  34. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    It's actually an unhandled exception. It's reported at case 661462.

    @goat: I don't think you can do anything from your side to workaround this. The code in question in compiled deep inside UnityPlayer.dll.
     
  35. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    No, thanks. I've done everything I can do. I just need to check the Windows 8.0 definition of

    Code (csharp):
    1.  
    2. public : property unsigned int ReportInterval { get; set; }
    3. Member of Windows::Devices::Sensors::IAccelerometer
    4.  
    I will buy a cheap Windows RT tablet and then decide later if I want to buy a cheap new model laptop or still buy an new 2015 model ASUS PC tablet.

    MSDN says that the ReportInterval should be read/write in Windows Store 8 / Windows Phone 8 clients as well.
     
    Last edited: Jan 20, 2015
  36. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    OK, if anyone cares to advise on using the iView 7" Tablet 16GB Quad Core Windows 8.1 as I'll be buying one soon

    http://www.walmart.com/ip/40703435

    with Unity 4.6.x and Windows 8.1 Universal builds as it looks to be the cheap WinRT equivalent of the cheap Android 4.4.2 NextBook tablet I bought recently

    http://www.walmart.com/ip/Nextbook-7-Tablet-16GB-Quad-Core/38334381

    The CPU is this: 1.33GHz Intel Atom Z3735G-CR Quad-Core processor so when I deploy to test directly on the device what do I choose? How does an Atom Z3735G-CR Quad-Core compare to the i5-470UM in my EP121? It seems they are both quad core and 64 bit with the Atom using less power.

    x86 I suppose for now but what of when Unity 5 comes along? Can I choose to deploy as x64?

    If any GPU knowledgeable folks could comment on the Intel Graphics HD GPU in the iView vs the MP450 Quad Core GPU performance wise I'd appreciate it. Are the 2 roughly equivalent handling openGL ES 2.x applications?

    It looks like it turns out that this iView is a very cheap replacement of my EP121 as a gaming tablet.

    Thanks.
     
    Last edited: Jan 22, 2015