status-im / status-desktop

Status Desktop client made in Nim & QML
https://status.app
Mozilla Public License 2.0
286 stars 78 forks source link

App crashed when trying to open a profile link url SIGSEGV: Illegal storage access. (Attempt to read from nil?) #15666

Closed virginiabalducci closed 1 month ago

virginiabalducci commented 1 month ago

Bug Report

Description

User 1 sends their profile link to User2. User2 clicks it and nothing happens. Shortly after that, app crashes.

Steps to reproduce

  1. As User 1, copy the link to your profile.
  2. Send the link to the profile to user 2.
  3. As user 2, click on the link to open User 1 profile.

Expected behavior

User 2 to be able to click on User 1's profile link and link opens.

Actual behavior

User 2 clicks on User 1 profile link and nothing happens. After some seconds, app crashed.

https://github.com/user-attachments/assets/5ff187c6-0f61-4175-b464-2364dc9e34b4

https://github.com/user-attachments/assets/932a999e-4af4-4011-9d84-c5155c11cd80

geth.log of the app that crashed geth.log

Console error

WRN 2024-07-18 19:35:36.897-03:00 qt warning                                 topics="qt" tid=1856314 text="QML RowLayout: Binding loop detected for property \"width\"" file=qrc:/StatusQ/Controls/StatusBaseButton.qml:147 category=default
WRN 2024-07-18 19:35:36.898-03:00 qt warning                                 topics="qt" tid=1856314 text="QML StatusFlatButton: Binding loop detected for property \"implicitWidth\"" file=qrc:/StatusQ/Components/StatusToolBar.qml:29 category=default
DBG 2024-07-18 19:35:36.898-03:00 [threadpool task thread] initiating task   topics="task-threadpool" tid=1856343 file=threadpool.nim:56 messageType=AsyncLoadDevicesTaskArg:ObjectType threadid=1856343 task="{\"$type\":\"AsyncLoadDevicesTaskArg:ObjectType\",\"vptr\":105553182346688,\"slot\":\"asyncDevicesLoaded\"}"
DBG 2024-07-18 19:35:36.898-03:00 NewBE_callPrivateRPC                       topics="rpc" tid=1856343 file=core.nim:27 rpc_method=wakuext_getOurInstallations
WRN 2024-07-18 19:35:40.814-03:00 qt warning                                 topics="qt" tid=1856314 text="QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }" file=qrc:/imports/shared/views/chat/MessageView.qml:383 category=default
WRN 2024-07-18 19:35:40.827-03:00 qt warning                                 topics="qt" tid=1856314 text="Unable to assign [undefined] to int" file=qrc:/imports/shared/views/chat/MessageView.qml:679 category=default
WRN 2024-07-18 19:35:40.827-03:00 qt warning                                 topics="qt" tid=1856314 text="Unable to assign [undefined] to bool" file=qrc:/imports/shared/views/chat/MessageView.qml:51 category=default
WRN 2024-07-18 19:35:40.827-03:00 qt warning                                 topics="qt" tid=1856314 text="TypeError: Cannot read property 'chatDetails' of undefined" file=qrc:/imports/shared/views/chat/MessageView.qml:272 category=default
WRN 2024-07-18 19:35:40.828-03:00 qt warning                                 topics="qt" tid=1856314 text="TypeError: Cannot read property 'chatDetails' of undefined" file=qrc:/imports/shared/views/chat/MessageView.qml:271 category=default
WRN 2024-07-18 19:35:40.828-03:00 qt warning                                 topics="qt" tid=1856314 text="TypeError: Cannot read property 'chatDetails' of undefined" file=qrc:/imports/shared/views/chat/MessageView.qml:267 category=default
DBG 2024-07-18 19:35:46.939-03:00 NewBE_callPrivateRPC                       topics="rpc" tid=1856314 file=core.nim:27 rpc_method=wakuext_speedupArchivesImport
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
[1]    14500 segmentation fault  ./nim_status_client --datadir=~/status-instances/data/test031a

Additional Information

Note: If profile link is copied and pasted into a browser, it opens correctly, for example: https://status.app/u/G6QAAMTn_9yfUeGALq7ByzfQqFdJ-I9_nZwemK-tMOhbzgkkGFJuY2P59Gh0E7oU_6RIV62cC6L8Jdvu91dJsksowTvsVoLIbvYxKquC-6iwz91KbhO7dUGTnaOy8IeFXDfXH7n2u4MLByCtRjTCkUAk5hH9WbwvjtFe9xSR-wA=#zQ3shmxm6qZGrpQ73SXBbpTnpcz7VeHPdhjZWUHxqyKJCRJ3h

User1 can click on the link and see their profile card correctly, but as User2, clicking the same link does nothing.

I tagged infra team because I saw a bug with a similar error assigned to them, please tag the appropriate team if this is not right, thanks!

jrainville commented 1 month ago

@friofry can you check this, it seems related to https://github.com/status-im/status-desktop/issues/15297

jrainville commented 1 month ago

@friofry tried to reproduce and he couldn't.

I just tried and I also can't reproduce. The link works as expected. It's just that the expected behavior is for the link to go to the user's chat, so if you share your own link to someone in the 1-1 chat, the link goes to that chat, so it's pretty useless. The UX could be improved, but that would be for another issue.

As for the link unfurling, we now do sender-side unfurling, meaning that the person sending the link sends the info about the link. So that's why sometimes the link isn't unfurled (if you send too fast for example). In theory, since it's a Status link, we could just force the unfurl, but again, that would be another issue and it's maybe not worth it.

Back to the crash, I looked at the geth log and the last lines are about transactions, so maybe the profile link is a red herring?

DEBUG[07-18|22:49:55.339|github.com/status-im/status-go/protocol/messenger.go:5520]                                  Validating transactions                  site=ValidateTransactions
DEBUG[07-18|22:49:55.340|github.com/status-im/status-go/protocol/messenger.go:5526]                                  Txs                                      site=ValidateTransactions count=0 txs=[]
DEBUG[07-18|22:49:55.340|github.com/status-im/status-go/protocol/transaction_validator.go:55]                        Checking addresses                       addrse="map[0xcc71677e119a06f9b4247678969f4656554c3019:true 0xdebfd28221780ec92c766ed9e042666d2131c5ac:true]"
DEBUG[07-18|22:49:55.340|github.com/status-im/status-go/protocol/transaction_validator.go:232]                       Started validating transactions 
DEBUG[07-18|22:49:55.341|github.com/status-im/status-go/protocol/transaction_validator.go:238]                       Transactions to validated                transactions=[]
DEBUG[07-18|22:49:55.346|go.uber.org/zap/sugar.go:198]                                                               negotiated: /ipfs/ping/1.0.0 (took 36.583µs) 

I think we could close this issue and reopen if it happens again and maybe it would be a wallet issue?

endulab commented 1 month ago

I see that the link does not work on receiver's side. I click and nothing happens.

jrainville commented 1 month ago

I see that the link does not work on receiver's side. I click and nothing happens.

@endulab Yeah that's normal, since we're already in the destination. I explained above:

The link works as expected. It's just that the expected behavior is for the link to go to the user's chat, so if you share your own link to someone in the 1-1 chat, the link goes to that chat, so it's pretty useless. The UX could be improved, but that would be for another issue.

jrainville commented 1 month ago

@virginiabalducci can you try to reproduce the crash? For us it doesn't happen. It's just not super good UX 😅

jrainville commented 1 month ago

Closing as it doesn't seem like the crash was related and it's not reproducible