react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

'System.AccessViolationException' in Facebook.Yoga.dll

Open vince-rowe opened this issue 9 years ago • 34 comments

The app is running fine in simulator by react-native run-windows, but it will not run on a device through Visual Studio 2015 DebugRelease ARM. I have run the packaging command as per the docs.

It seems an issue with Facebook Yoga, but I think this is the best place to report?

Running facebook.yoga version 1.1.0.18-pre on the ReactNative package (not the app package).

Exception thrown: 'System.AccessViolationException' in Facebook.Yoga.dll The thread 0x92c has exited with code 0 (0x0). The thread 0x11d4 has exited with code 0 (0x0). The thread 0x10cc has exited with code 0 (0x0). The program '[4644] Name.exe' has exited with code 0 (0x0).

Any thoughts? Vince

vince-rowe avatar Feb 21 '17 17:02 vince-rowe

Can confirm I get the same issue

'testapp.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Data\SharedData\PhoneTools\AppxLayouts\81e1c535-6804-4f0c-8a3b-041215426f68VS.DebugBundle_ARM.AWebber\Facebook.Yoga.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. [JS Info] Running application "testapp" with appParams: {"rootTag":1,"initialProps":null}. DEV === true, development-level warning are ON, performance optimizations are OFFException thrown: 'System.AccessViolationException' in Facebook.Yoga.dll The thread 0x5b0 has exited with code 0 (0x0).

yoga

andrewwebber avatar Feb 23 '17 10:02 andrewwebber

Sounds like an issue with the ARM build for Facebook.Yoga. Any thoughts @rmarinho?

rozele avatar Feb 23 '17 11:02 rozele

@rozele I feel so much confidence as soon as you reply to a thread. Stuff gets done :) I am unfortunately blocked here upgrading my app

andrewwebber avatar Feb 23 '17 11:02 andrewwebber

@rozele are you able to explain a little bit about the versioning here. Presumably ReactNative C# is maintained on this repro and a specific version of Facebook.Yoga is supported, as defined in the package.json. Assuming this issue is due to the PInvoke library being out of sync with the C# wrapper can we not pin the versions that are compatible? Or have I misunderstood

andrewwebber avatar Feb 23 '17 14:02 andrewwebber

I don't think the P/Invoke library is out of sync. We actually don't touch P/Invoke code, that's all handled in the Facebook.Yoga package. There's a few new releases of Facebook.Yoga, let's try an upgrade and see if this is something that was already fixed.

rozele avatar Feb 23 '17 14:02 rozele

Yo , can you try with our myget feed one of the last versions..

https://www.myget.org/F/yoga/api/v3/index.json

rmarinho avatar Feb 23 '17 14:02 rmarinho

@rmarinho how can i take advantage of your last comment, what are the steps

andrewwebber avatar Feb 23 '17 14:02 andrewwebber

@andrewwebber what IDE are you using ?

rmarinho avatar Feb 23 '17 14:02 rmarinho

@andrewwebber @rmarinho, I posted a PR ^^, if you can pull in those changes, let me know if the issue is still there. Still working on getting an ARM device to test on.

rozele avatar Feb 23 '17 15:02 rozele

@rmarinho atom.io + VSCommunity 2015

andrewwebber avatar Feb 23 '17 15:02 andrewwebber

@rozele thanks, ill check it out...

andrewwebber avatar Feb 23 '17 15:02 andrewwebber

@andrewwebber if you don't want to merge any changes, you should just be able to go to the NuGet Package Manager Console and upgrade all the projects to 1.1.0.23-pre.

rozele avatar Feb 23 '17 17:02 rozele

@rozele @rmarinho I was able to successfully deploy the playground to my local machine but it fails on a windows phone. "Facebook.Yoga": "1.1.0.23-pre",

 react-native bundle --platform windows --entry-file ReactWindows/Playground/index.windows.js --bundle-output ReactWindows/Playground/ReactAssets/index.windows.bundle --assets-dest ReactW    indows/Playground/ReactAssets

I already get access violations on many properites after the default constructor is called.

image

andrewwebber avatar Feb 23 '17 17:02 andrewwebber

@rozele @rmarinho

After cloning and attaching the Yoga project I landed at the following exception. Again could poor configuration my side...

Is there any way to verify which DLLs are deployed to the phone

image

andrewwebber avatar Feb 23 '17 18:02 andrewwebber

Is this related to #1032 ?

matthargett avatar Feb 23 '17 21:02 matthargett

@andrewwebber can you check if you have yoga.dll on your bin/debug/arm ? is this UWP or Windows 8.1 ?

rmarinho avatar Feb 23 '17 22:02 rmarinho

@rmarinho I am running UWP. I will check tomorrow as my company's Phone is in the office. I have the feeling that I cannot verify if yoga.dll is copied during the build. Is there a output windows to verify this? In the old days there was a property window field like "copy to output" :)

I just realized I can check this quickly without the device...

andrewwebber avatar Feb 23 '17 22:02 andrewwebber

@rmarinho After building the stock template the following can be found in the ARM folder

image

I would assume if they are in the ARM folder they get deployed to the device... image

andrewwebber avatar Feb 23 '17 23:02 andrewwebber

Hum, yap it's there.. so it's UWP on a ARM device, wasn't this the fix you did recently @rozele that you tracked down with the UWP team ?

rmarinho avatar Feb 23 '17 23:02 rmarinho

@rmarinho I had a slightly different issue. The UWP build was not targeted for the store, so it was linked against the incorrect VC runtime. I compiled today against the latest NuGet package and ran dumpbin /headers yoga.dll to confirm the DLL was ARM and had the correct dependencies. Everything looked good.

rozele avatar Feb 23 '17 23:02 rozele