Skip to content

Crash on iOS from chart using VictoryBarΒ #3059

@wongk

Description

@wongk

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Victory version

37.3.6

Code Sandbox link

No response

Bug report

I am able to reproduce this bug 100% of the time in our app, but there are so many factors at play, I am not certain which combination of variables have to line in order to reproduce it. We have a stacked bar chat, using `VictoryStack` and `VictoryBar`, which will sometimes cause a crash on iOS. The crash is from react-native-svg, and is due to a nil clip path name. The following is a partial stack trace:


[CoreFoundation] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSDictionaryM setObject:forKey:]: key cannot be nil'
*** First throw call stack:
(
0   CoreFoundation                      0x00000001804ae0f8 __exceptionPreprocess + 172
1   libobjc.A.dylib                     0x0000000180087db4 objc_exception_throw + 56
2   CoreFoundation                      0x000000018051e7c0 -[__NSDictionaryM setObject:forKey:] + 1032
3   Healthy.debug.dylib                 0x000000010d7a4b54 -[RNSVGSvgView defineClipPath:clipPathName:] + 224
4   Healthy.debug.dylib                 0x000000010d6db934 -[RNSVGClipPath parseReference] + 128
5   Healthy.debug.dylib                 0x000000010d6e1e84 __27-[RNSVGDefs parseReference]_block_invoke + 112
6   Healthy.debug.dylib                 0x000000010d76ec18 -[RNSVGNode traverseSubviews:] + 280
7   Healthy.debug.dylib                 0x000000010d6e1e08 -[RNSVGDefs parseReference] + 60


I can view the screen with this chart on it once. If I switch to another tab, and then switch back, that's when it crashes. I have found a verified a fix. I can raise a PR if that is desired.

https://github.com/wongk/victory/commit/473782e7fb01ab1becadd2cdaf7acaba02ae8ef4

Steps to reproduce

Expected behavior

Actual behavior

Environment

- Device: iOS simulator (iPhone 15 Pro)
- OS: iOS 17.5
- Node: 23.11.0
- npm: 11.4.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: StaleThis issue is marked as stale and will close in 14 daysType: Bug πŸ›Oh no! A bug or unintentional behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions