Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native-window app crash when rendering svg as component and using navigation #14177

Open
ashish3408 opened this issue Dec 9, 2024 · 7 comments
Labels
bug Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) Needs: Issue Template no-recent-activity Issue/PR has gone stale and may be closed (label applied by bot)

Comments

@ashish3408
Copy link

Problem Description

desktop is crashing as soon as I fire any navigation event, it is happening if I am rendering svg as component, but works fine if I comment svg component. I think once an svg renders it is not unloading from memory on unmount, and that is creating memory leak and the crash, does no one come around with this issue? please help anyone .

this is the crash

Exception thrown at 0x00007FFEB573FA4C in Forms.exe: Microsoft C++ exception: winrt::hresult_invalid_argument at memory location 0x0000007373AFD488.
Exception thrown at 0x00007FFEB573FA4C in Forms.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
Exception thrown at 0x00007FFEB573FA4C in Forms.exe: Microsoft C++ exception: winrt::hresult_invalid_argument at memory location 0x0000007373AFDD08.
Exception thrown at 0x00007FFEB573FA4C in Forms.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
A breakpoint instruction (__debugbreak() statement or a similar call) was executed in Forms.exe.

The program '[17304] Forms.exe' has exited with code 0 (0x0).

Steps To Reproduce

  1. render an svg as component
  2. use navigation and move from one screen to another

app crash

Expected Results

No response

CLI version

npx @react-native-community/cli -v 15.0.1

Environment

npx @react-native-community/cli info

Community Modules

No response

Target Platform Version

10.0.22621

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2022

Build Configuration

DebugBundle

Snack, code example, screenshot, or link to a repository

https://github.com/akumar3408/svg-navigation-issue.git

@ashish3408 ashish3408 added the bug label Dec 9, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Dec 9, 2024
@chrisglein
Copy link
Member

Can you please provide the versioning information provided in the issue template? Without that it's harder for us to evaluate where this issue is happening.

@chrisglein chrisglein added Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) and removed Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) labels Dec 9, 2024
@ashish3408
Copy link
Author

here is the package.json

{
"name": "svgNavigation",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest",
"windows": "npx @react-native-community/cli run-windows"
},
"dependencies": {
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@react-navigation/elements": "^2.2.4",
"@react-navigation/native": "^7.0.13",
"@react-navigation/native-stack": "^7.1.14",
"@react-navigation/stack": "^7.0.18",
"@svgr/core": "^8.1.0",
"@svgr/plugin-jsx": "^8.1.0",
"@svgr/plugin-svgo": "^8.1.0",
"react": "18.3.1",
"react-native": "0.76.2",
"react-native-gesture-handler": "^2.21.2",
"react-native-reanimated": "^3.16.3",
"react-native-safe-area-context": "^5.0.0",
"react-native-screens": "^4.3.0",
"react-native-svg": "^15.10.1",
"react-native-svg-transformer": "^1.5.0",
"react-native-windows": "^0.76.2"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "15.0.1",
"@react-native-community/cli-platform-android": "15.0.1",
"@react-native-community/cli-platform-ios": "15.0.1",
"@react-native/babel-preset": "0.76.2",
"@react-native/eslint-config": "0.76.2",
"@react-native/metro-config": "0.76.2",
"@react-native/typescript-config": "0.76.2",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"metro-config": "^0.81.0",
"prettier": "2.8.8",
"react-test-renderer": "18.3.1",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
},
"react-native-windows": {
"init-windows": {
"name": "svgNavigation",
"namespace": "svgNavigation",
"template": "old/uwp-cpp-app"
}
}
}

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) and removed Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) labels Dec 10, 2024
@ashish3408
Copy link
Author

can anyone help me with this?

@ashish3408
Copy link
Author

anyone please ?

@ashish3408
Copy link
Author

@chrisglein @alloy @kant @Thristhart if you can help here

@chrisglein
Copy link
Member

here is the package.json

{ "name": "svgNavigation", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", "test": "jest", "windows": "npx @react-native-community/cli run-windows" }, "dependencies": { "@babel/plugin-proposal-export-namespace-from": "^7.18.9", "@react-navigation/elements": "^2.2.4", "@react-navigation/native": "^7.0.13", "@react-navigation/native-stack": "^7.1.14", "@react-navigation/stack": "^7.0.18", "@svgr/core": "^8.1.0", "@svgr/plugin-jsx": "^8.1.0", "@svgr/plugin-svgo": "^8.1.0", "react": "18.3.1", "react-native": "0.76.2", "react-native-gesture-handler": "^2.21.2", "react-native-reanimated": "^3.16.3", "react-native-safe-area-context": "^5.0.0", "react-native-screens": "^4.3.0", "react-native-svg": "^15.10.1", "react-native-svg-transformer": "^1.5.0", "react-native-windows": "^0.76.2" }, "devDependencies": { "@babel/core": "^7.25.2", "@babel/preset-env": "^7.25.3", "@babel/runtime": "^7.25.0", "@react-native-community/cli": "15.0.1", "@react-native-community/cli-platform-android": "15.0.1", "@react-native-community/cli-platform-ios": "15.0.1", "@react-native/babel-preset": "0.76.2", "@react-native/eslint-config": "0.76.2", "@react-native/metro-config": "0.76.2", "@react-native/typescript-config": "0.76.2", "@types/react": "^18.2.6", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.6.3", "eslint": "^8.19.0", "jest": "^29.6.3", "metro-config": "^0.81.0", "prettier": "2.8.8", "react-test-renderer": "18.3.1", "typescript": "5.0.4" }, "engines": { "node": ">=18" }, "react-native-windows": { "init-windows": { "name": "svgNavigation", "namespace": "svgNavigation", "template": "old/uwp-cpp-app" } } }

This is helpful, but what I was referring to was the diagnostic information requested in the bug template and left unfilled above. Specifically this:

npx @react-native-community/cli info

If you can provide this it makes it easier to help you.

Exception thrown at 0x00007FFEB573FA4C in Forms.exe: Microsoft C++ exception: winrt::hresult_invalid_argument at memory location 0x0000007373AFD488.
Exception thrown at 0x00007FFEB573FA4C in Forms.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
Exception thrown at 0x00007FFEB573FA4C in Forms.exe: Microsoft C++ exception: winrt::hresult_invalid_argument at memory location 0x0000007373AFDD08.
Exception thrown at 0x00007FFEB573FA4C in Forms.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
A breakpoint instruction (__debugbreak() statement or a similar call) was executed in Forms.exe.

If your familiar with the debugger, can you possibly get the exception callstack for when this is thrown? As in what is the stack where an invalid argument exception is originating? (generally you can get this by setting Visual Studio to break on thrown WinRT Originate exceptions, if you don't get it broken in by default)

@chrisglein chrisglein added Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) and removed Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) labels Dec 19, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the no-recent-activity Issue/PR has gone stale and may be closed (label applied by bot) label Dec 26, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) Needs: Issue Template no-recent-activity Issue/PR has gone stale and may be closed (label applied by bot)
Projects
None yet
Development

No branches or pull requests

2 participants