liveview-native / liveview-client-swiftui

MIT License
376 stars 37 forks source link

[Bug]: BAD ACCESS when running on device #1249

Closed lawik closed 7 months ago

lawik commented 8 months ago

What happened?

Using the Boston Elixir project after a Cardarella workshop. I updated this swiftui dependency and the mix dependency to the latest main. Then I removed and re-added in XCode because I don't know whether it cleans up after itself.

I tried running on device and I get:

Screenshot 2024-02-01 at 09 24 19

Library Version

3d047c76d7d3b16709af1a123255e4f9cb2663dc

Xcode Version

15.1

Swift Version

swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)

On which device or simulator are you running into the problem?

iPhone

Target Device Operating System Version

17.1.2

Relevant log output

Cache loaded with 5598 pre-cached in CacheData and 62 items in CacheExtra.
AggregateDictionary is deprecated and has been removed. Please migrate to Core Analytics.
Connecting to https://sliver.tailb203e.ts.net/
Initializing NSHTTPCookieStorage singleton
Initializing CFHTTPCookieStorage singleton
Creating default cookie storage with default identifier
Task <19C9646E-2D75-4CF5-B5B9-DF8888E9BA1E>.<1> resuming, timeouts(60.0, 604800.0) QOS(0x19) Voucher (null)
[Telemetry]: Activity <nw_activity 12:2[044D4F81-C0C0-423B-8A5C-947F6C867ABA] (reporting strategy default)> on Task <19C9646E-2D75-4CF5-B5B9-DF8888E9BA1E>.<1> was not selected for reporting
Using HSTS 0x2824056d0 path file:///private/var/mobile/Containers/Data/Application/AB2F8031-9DBC-486A-82D5-45C605ED6CF0/Library/Caches/com.example.BostonElixir/HSTS.plist
Initializing AlternativeServices Storage singleton
Garbage collection for alternative services
NW Proxies override 1 via os_feature
Connection 1: enabling TLS
Connection 1: starting, TC(0x0)
Task <19C9646E-2D75-4CF5-B5B9-DF8888E9BA1E>.<1> setting up Connection 1
Connection 1: asked to evaluate TLS Trust
[TLSCBQ] Need to invoke to satisfy trust callback
Task <19C9646E-2D75-4CF5-B5B9-DF8888E9BA1E>.<1> auth completion disp=1 cred=0x0
System Trust Evaluation yielded status(0)
Connection 1: TLS Trust result 0
Connection 1: connected successfully
Connection 1: TLS handshake complete
Connection 1: ready C(N) E(N)
Task <19C9646E-2D75-4CF5-B5B9-DF8888E9BA1E>.<1> done setting up Connection 1
Connection 1: set is idle false
Task <19C9646E-2D75-4CF5-B5B9-DF8888E9BA1E>.<1> now using Connection 1
Connection 1: received viability advisory(Y)
Task <19C9646E-2D75-4CF5-B5B9-DF8888E9BA1E>.<1> sent request, body N 0
Task <19C9646E-2D75-4CF5-B5B9-DF8888E9BA1E>.<1> received response, status 200 content K
Task <19C9646E-2D75-4CF5-B5B9-DF8888E9BA1E>.<1> done using Connection 1
Connection 1: set is idle true
HTTP/2 Connection 1 Stream 1 ended successfully true
Task <19C9646E-2D75-4CF5-B5B9-DF8888E9BA1E>.<1> response ended
Task <19C9646E-2D75-4CF5-B5B9-DF8888E9BA1E>.<1> finished successfully
Task <B2FE0BC0-8F13-41F3-9814-2D59FFC0892B>.<1> resuming, timeouts(60.0, 604800.0) QOS(0x21) Voucher (null)
[Telemetry]: Activity <nw_activity 12:2[7D08BFF1-76D1-4C22-99B8-B44C708FA4C1] (reporting strategy default)> on Task <B2FE0BC0-8F13-41F3-9814-2D59FFC0892B>.<1> was not selected for reporting
Connection 2: enabling TLS
Connection 2: starting, TC(0x0)
Task <B2FE0BC0-8F13-41F3-9814-2D59FFC0892B>.<1> setting up Connection 2
Connection 2: asked to evaluate TLS Trust
[TLSCBQ] Need to invoke to satisfy trust callback
Task <B2FE0BC0-8F13-41F3-9814-2D59FFC0892B>.<1> auth completion disp=1 cred=0x0
System Trust Evaluation yielded status(0)
Connection 2: TLS Trust result 0
Connection 2: connected successfully
Connection 2: TLS handshake complete
Connection 2: ready C(N) E(N)
Task <B2FE0BC0-8F13-41F3-9814-2D59FFC0892B>.<1> done setting up Connection 2
Task <B2FE0BC0-8F13-41F3-9814-2D59FFC0892B>.<1> now using Connection 2
Connection 2: received viability advisory(Y)
Task <B2FE0BC0-8F13-41F3-9814-2D59FFC0892B>.<1> sent request, body N 0
Task <B2FE0BC0-8F13-41F3-9814-2D59FFC0892B>.<1> received response, status 101 content U
Task <B2FE0BC0-8F13-41F3-9814-2D59FFC0892B>.<1> response ended
Task <B2FE0BC0-8F13-41F3-9814-2D59FFC0892B>.<1> done using Connection 2
[Socket] Opened
[LiveReload] attempting to connect...
Task <6AB74BED-B384-476A-B536-7E406773B87A>.<1> resuming, timeouts(60.0, 604800.0) QOS(0x21) Voucher (null)
[Telemetry]: Activity <nw_activity 12:2[4DBB857D-3583-45CB-B9F6-CBC9F5AE7226] (reporting strategy default)> on Task <6AB74BED-B384-476A-B536-7E406773B87A>.<1> was not selected for reporting
Connection 3: enabling TLS
Connection 3: starting, TC(0x0)
Task <6AB74BED-B384-476A-B536-7E406773B87A>.<1> setting up Connection 3
[Socket] SwiftPhoenixClient: push, Sending ["6","6","lv:phx-F6-vlZO-C39kpwbh","phx_join",{"params":{"_format":"swiftui","_lvn":{"format":"swiftui","os_version":"17.1.2","app_build":"1.0","target":"phone","app_version":"1.0","bundle_id":"com.example.BostonElixir","os":"iOS"},"_csrf_token":"Dh1QDRtmQys9AhFZJHYnGSozDRUmXCw46W5cYVtnUcb8i4FOBWo8umMn","_mounts":0},"session":"SFMyNTY.g2gDaAJhBXQAAAAIdwJpZG0AAAAUcGh4LUY2LXZsWk8tQzM5a3B3Ymh3B3Nlc3Npb250AAAAAHcKcGFyZW50X3BpZHcDbmlsdwhyb290X3BpZHcDbmlsdwZyb3V0ZXJ3HUVsaXhpci5Cb3N0b25FbGl4aXJXZWIuUm91dGVydwR2aWV3dx9FbGl4aXIuQm9zdG9uRWxpeGlyV2ViLkhvbWVMaXZldwxsaXZlX3Nlc3Npb25oAncHZGVmYXVsdG4IAKp5DNSsfK8Xdwlyb290X3ZpZXd3H0VsaXhpci5Cb3N0b25FbGl4aXJXZWIuSG9tZUxpdmVuBgD4h8RjjQFiAAFRgA.S50MnVgG1rcoE53SYnMIXuJEG9AW632hBeN1ePwC8XI","url":"https:\/\/sliver.tailb203e.ts.net\/","static":"SFMyNTY.g2gDaAJhBXQAAAADdwJpZG0AAAAUcGh4LUY2LXZsWk8tQzM5a3B3Ymh3BWZsYXNodAAAAAB3CmFzc2lnbl9uZXdqbgYA-IfEY40BYgABUYA.XglVNSh8voGz5UfC4gbBl-LluxgQXja9B8B39rjYdsE"}]
[Socket] SwiftPhoenixClient: receive , ["6","6","lv:phx-F6-vlZO-C39kpwbh","phx_reply",{"status":"ok","response":{"rendered":{"0":{"0":"","1":"","2":" position:latitude-delta=\"0\"","3":" position:longitude-delta=\"0\"","4":"Stockholm","s":["<!-- <BostonElixirWeb.HomeLive.SwiftUI.render> lib/boston_elixir_web/live/swiftui/home_live.swiftui.neex:1 --><VStack>\n    <Map class=\"frame:300\" position=\"region\"","","",""," phx-change=\"move\" phx-click=\"map-tap\"></Map>\n    <Image name=\"turtlerock\" class=\"clipShape:circle overlay:circle shadowz offset-y:-130 padding-bottom:-130\" phx-click=\"futz\">\n        <Circle template=\"circle\" class=\"stroke:white:4\"></Circle>\n    </Image>\n    <VStack class=\"padding\" alignment=\"leading\">\n        <Text class=\"font:title\">","</Text>\n        <HStack class=\"font:subheadline foregroundStyle:secondary\">\n            <Text>Joshua Tree National Park</Text>\n            <Spacer></Spacer>\n            <Text>Moar</Text>\n        </HStack>\n        <Divider></Divider>\n    </VStack>\n    \n    <Spacer></Spacer>\n</VStack><!-- </BostonElixirWeb.HomeLive.SwiftUI.render> -->"],"r":1},"s":["",""]}}}]
Connection 3: asked to evaluate TLS Trust
[TLSCBQ] Need to invoke to satisfy trust callback
Task <6AB74BED-B384-476A-B536-7E406773B87A>.<1> auth completion disp=1 cred=0x0
System Trust Evaluation yielded status(0)
Connection 3: TLS Trust result 0
Connection 3: connected successfully
Connection 3: TLS handshake complete
Connection 3: ready C(N) E(N)
Task <6AB74BED-B384-476A-B536-7E406773B87A>.<1> done setting up Connection 3
Task <6AB74BED-B384-476A-B536-7E406773B87A>.<1> now using Connection 3
Connection 3: received viability advisory(Y)
Task <6AB74BED-B384-476A-B536-7E406773B87A>.<1> sent request, body N 0
Message from debugger: killed
bcardarella commented 8 months ago

@lawik can you confirm that your Swift Dependency is set to Branch - main like so:

Screenshot 2024-02-01 at 3 42 16 AM
lawik commented 8 months ago

It is set up as a local path dep from the workshop and I pulled the updates on main (which includes the chunk stuff) and then I removed and re-added as well as ran a clean build.

I can try a clean rebuild again see if that helps but 🤷🏻

bcardarella commented 8 months ago

If you’re on local and pulled then the dep should update in xcode. I’ll let Carson weigh in at this point


Brian Cardarella Founder, DockYard

On Thu, Feb 1, 2024 at 3:57 AM Lars Wikman @.***> wrote:

It is set up as a local path dep from the workshop and I pulled the updates on main (which includes the chunk stuff) and then I removed and re-added as well as ran a clean build.

I can try a clean rebuild again see if that helps but 🤷🏻

— Reply to this email directly, view it on GitHub https://github.com/liveview-native/liveview-client-swiftui/issues/1249#issuecomment-1920816737, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEQXBQEUBUD6FLC3NKXGLYRNKH3AVCNFSM6AAAAABCUOZYB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRQHAYTMNZTG4 . You are receiving this because you commented.Message ID: @.*** com>

carson-katri commented 8 months ago

I was not able to replicate this issue. Also tried including the MapKit addon, but that didn't cause it either. Would you be able to provide a repo to test?

I also cannot find the commit you linked as the library version: https://github.com/liveview-native/liveview-client-swiftui/commit/3d047c76d7d3b16709af1a123255e4f9cb2663dc

lawik commented 8 months ago

I will see if I can clean my deps more thoroughly somehow. Might still be building on the old problem, somehow.

carson-katri commented 7 months ago

@lawik Are you still experiencing this crash with the latest on main?

lawik commented 7 months ago

Haven't touched the project in a while. I think you can close this. If I try it again and hit it I can re-report.