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

Crash on source selection #899

Closed
sssoleileraaa opened this issue Mar 9, 2020 · 6 comments
Closed

Crash on source selection #899

sssoleileraaa opened this issue Mar 9, 2020 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@sssoleileraaa
Copy link
Contributor

sssoleileraaa commented Mar 9, 2020

Description

When clicking on a source after source deletion, the client crashes with w sqlalchemy.orm.exc.ObjectDeletedError: Instance '<Source at 0x7f0f51ed7b10>' has been deleted, or its row is otherwise not present.

Related to #906

STR

  1. NUM_SOURCES=10 make dev
  2. LOGLEVEL=debug ./run.sh --sdc-home ~/.securedrop_client (just in case you need to share logs later)
  3. Login
  4. Log out in offline mode
  5. Stop the server and run NUM_SOURCES=10 make dev
  6. Sign back in
  7. Quickly select an old source widget and then a new one and back again (you can click around as much as you like)

Expected

For the client to keep running

Actual

Crash with the following output:

...
...
...
2020-03-09 14:31:37,167 - securedrop_client.crypto:152(import_key) DEBUG: Importing key with fingerprint D2D9B89B9AB8B454839820756963969D26D94919
2020-03-09 14:31:37,212 - securedrop_client.storage:205(update_sources) DEBUG: Added new source efe14965-71c6-4eef-8e99-2501a5fe6d1d
2020-03-09 14:31:37,222 - securedrop_client.crypto:152(import_key) DEBUG: Importing key with fingerprint 856386521CDF47386E869A7474529ADD73771F50
2020-03-09 14:31:37,254 - securedrop_client.storage:205(update_sources) DEBUG: Added new source d4ee3bb6-dd39-48af-932b-d9d42b42b906
2020-03-09 14:31:37,263 - securedrop_client.crypto:152(import_key) DEBUG: Importing key with fingerprint A89237552F289AB319AEB1E47709F007E967972A
2020-03-09 14:31:37,294 - securedrop_client.storage:205(update_sources) DEBUG: Added new source 7b9da810-f9cd-4016-b9a7-458a244b9c94
2020-03-09 14:31:37,303 - securedrop_client.crypto:152(import_key) DEBUG: Importing key with fingerprint C5FDF120428CB9D6081ACDE58A9294FCDD4EF304
2020-03-09 14:31:37,331 - securedrop_client.storage:205(update_sources) DEBUG: Added new source 462760e0-ef2c-4c35-8feb-14777208601f
2020-03-09 14:31:37,338 - securedrop_client.crypto:152(import_key) DEBUG: Importing key with fingerprint 8F3B2469A138A0A7D86316CBCF548296842ECFD2
2020-03-09 14:31:37,365 - securedrop_client.storage:205(update_sources) DEBUG: Added new source cc38a7d6-b60d-4321-a4ae-b18c7eede7be
2020-03-09 14:31:37,373 - securedrop_client.crypto:152(import_key) DEBUG: Importing key with fingerprint 92E72BD4DB56E8371A809774C5F940B6DC7632C7
2020-03-09 14:31:37,401 - securedrop_client.storage:205(update_sources) DEBUG: Added new source 036a27c2-19af-47b0-a067-e881a3fe4585
2020-03-09 14:31:37,409 - securedrop_client.crypto:152(import_key) DEBUG: Importing key with fingerprint 7D620D9BBF3F7BC440795A05739B5FCC8F51A3EC
2020-03-09 14:31:37,435 - securedrop_client.storage:205(update_sources) DEBUG: Added new source d47a124c-deb7-4638-8592-6439f9faa3c3
2020-03-09 14:31:37,444 - securedrop_client.crypto:152(import_key) DEBUG: Importing key with fingerprint D873A17F58C35BFC44A1AE5DC89A31E00D938061
2020-03-09 14:31:37,470 - securedrop_client.storage:205(update_sources) DEBUG: Added new source 483b36f5-6da9-429b-a20a-20244c5dc9a0
2020-03-09 14:31:37,478 - securedrop_client.crypto:152(import_key) DEBUG: Importing key with fingerprint 50901D7FF0E74690CAF2EB86F87A84E94B067482
2020-03-09 14:31:37,506 - securedrop_client.storage:205(update_sources) DEBUG: Added new source 57e768e9-14bc-4b0c-904a-4516cec857f7
2020-03-09 14:31:37,513 - securedrop_client.crypto:152(import_key) DEBUG: Importing key with fingerprint E51CF260C3308B8337686BD6C064458922A05672
2020-03-09 14:31:37,540 - securedrop_client.storage:205(update_sources) DEBUG: Added new source fb4b7b0e-48a7-4758-8f02-bd4973afc2c5
2020-03-09 14:31:37,546 - securedrop_client.storage:215(update_sources) DEBUG: Deleted source 37de690c-1536-4399-9dc6-31de0bfcb81b
2020-03-09 14:31:37,553 - securedrop_client.storage:215(update_sources) DEBUG: Deleted source dff056b1-455b-4526-a747-4a3503945f22
2020-03-09 14:31:37,559 - securedrop_client.storage:215(update_sources) DEBUG: Deleted source dd6faef4-e61b-4fb6-ad34-725e7e473499
2020-03-09 14:31:37,563 - securedrop_client.storage:215(update_sources) DEBUG: Deleted source 9dbb12ab-9738-4ab3-aa88-a8ce3b6bd5db
2020-03-09 14:31:37,569 - securedrop_client.storage:215(update_sources) DEBUG: Deleted source e02c3037-f29d-403d-84b0-5efb842c8aec
2020-03-09 14:31:37,575 - securedrop_client.storage:215(update_sources) DEBUG: Deleted source 14602e34-8580-4ff6-9f8e-82333d448e82
2020-03-09 14:31:37,581 - securedrop_client.storage:215(update_sources) DEBUG: Deleted source a3756070-107c-410e-8cae-55a856c7b945
2020-03-09 14:31:37,586 - securedrop_client.storage:215(update_sources) DEBUG: Deleted source a30158d2-a445-4dcd-89d7-26ac045bbfcd
2020-03-09 14:31:37,591 - securedrop_client.storage:215(update_sources) DEBUG: Deleted source 963a3e9d-c216-42c0-8b84-41457c41df38
2020-03-09 14:31:37,597 - securedrop_client.storage:215(update_sources) DEBUG: Deleted source 1b7f48e5-2d21-47d2-b90a-0c4c872fe5c7
...
...
...
2020-03-09 14:31:37,744 - root:53(excepthook) ERROR: Unrecoverable error
Traceback (most recent call last):
  File "/home/creviera/workspace/freedomofpress/securedrop-client/securedrop_client/logic.py", line 450, in on_sync_success
    self.update_sources()
  File "/home/creviera/workspace/freedomofpress/securedrop-client/securedrop_client/logic.py", line 489, in update_sources
    self.gui.show_sources(sources)
  File "/home/creviera/workspace/freedomofpress/securedrop-client/securedrop_client/gui/main.py", line 150, in show_sources
    self.main_view.show_sources(sources)
  File "/home/creviera/workspace/freedomofpress/securedrop-client/securedrop_client/gui/widgets.py", line 692, in show_sources
    self.empty_conversation_view.show_no_source_selected_message()
  File "/home/creviera/workspace/freedomofpress/securedrop-client/securedrop_client/gui/widgets.py", line 790, in show_no_source_selected_message
    'Select a source from the list, to:\n\n'
RuntimeError: wrapped C/C++ object of type QLabel has been deleted

I believe this will be fixed by no longer deleting the EmptyConversationView widget in MainView.on_source_changed.

@sssoleileraaa sssoleileraaa added the bug Something isn't working label Mar 9, 2020
@eloquence eloquence changed the title crash on source selection Crash on source selection Mar 10, 2020
@eloquence
Copy link
Member

Tracking as release blocker because it's a crasher.

@sssoleileraaa
Copy link
Contributor Author

Same steps, different error now that we are deleting source conversation wrappers in a new way:

Traceback (most recent call last):
  File "/home/creviera/workspace/freedomofpress/securedrop-client/securedrop_client/logic.py", line 450, in on_sync_success
    self.update_sources()
  File "/home/creviera/workspace/freedomofpress/securedrop-client/securedrop_client/logic.py", line 489, in update_sources
    self.gui.show_sources(sources)
  File "/home/creviera/workspace/freedomofpress/securedrop-client/securedrop_client/gui/main.py", line 150, in show_sources
    self.main_view.show_sources(sources)
  File "/home/creviera/workspace/freedomofpress/securedrop-client/securedrop_client/gui/widgets.py", line 698, in show_sources
    self.delete_source(source_uuid)
  File "/home/creviera/workspace/freedomofpress/securedrop-client/securedrop_client/gui/widgets.py", line 732, in delete_source
    conversation_wrapper.deleteLater()
RuntimeError: wrapped C/C++ object of type SourceConversationWrapper has been deleted

@kushaldas
Copy link
Contributor

kushaldas commented Mar 13, 2020

Redshiftzero edits: This was broken out into its own issue #947

Today on master I could see around 3 old sources are still remaining on the UI, and clicking on them will cause an exception like the following:

Traceback (most recent call last):
  File "/home/kdas/code/securedrop-client/securedrop_client/gui/widgets.py", line 705, in on_source_changed
    source = self.source_list.get_current_source()
  File "/home/kdas/code/securedrop-client/securedrop_client/gui/widgets.py", line 886, in get_current_source
    if source_widget and source_exists(self.controller.session, source_widget.source.uuid):
  File "/home/kdas/code/securedrop-client/venv/lib/python3.7/site-packages/sqlalchemy/orm/attributes.py", line 276, in __get__
    return self.impl.get(instance_state(instance), dict_)
  File "/home/kdas/code/securedrop-client/venv/lib/python3.7/site-packages/sqlalchemy/orm/attributes.py", line 677, in get
    value = state._load_expired(state, passive)
  File "/home/kdas/code/securedrop-client/venv/lib/python3.7/site-packages/sqlalchemy/orm/state.py", line 660, in _load_expired
    self.manager.deferred_scalar_loader(self, toload)
  File "/home/kdas/code/securedrop-client/venv/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 985, in load_scalar_attributes
    raise orm_exc.ObjectDeletedError(state)
sqlalchemy.orm.exc.ObjectDeletedError: Instance '<Source at 0x7f2bd80abba8>' has been deleted, or its row is otherwise not present.

@ntoll
Copy link
Contributor

ntoll commented Mar 16, 2020

Hi Folks, so this is discussed / fixed here: #870 (comment)

@eloquence
Copy link
Member

What's the state of this issue? Is it still open, and if so, is #944 expected to resolve it (its precursor PR was, per above)?

@eloquence
Copy link
Member

Closing, appears to have been resolved via #890/#943.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants