Sequel-Ace / Sequel-Ace

MySQL/MariaDB database management for macOS
https://sequel-ace.com
Other
6.69k stars 247 forks source link

Intermittent Crashes #2033

Open billynoah opened 3 months ago

billynoah commented 3 months ago

Is Issue Present in Latest Beta? Yes

Description Sequel Ace crashes 2 - 3 times per day for no apparent reason. The only factor I vaguely suspect is it might be happening shortly after a connection is closed due to timeout. Hard to say for sure.

FWIW - this used to happen at approx the same frequency with Sequel Pro. Sequel Ace seemed to be a quite a bit more stable until this last beta. Not sure if it's a regression or just coincidence.

Steps To Reproduce Difficult to reproduce since it happens intermittently throughout the day.

Expected Behaviour Not have of crash.

Related Issues None that I know of.

Additional Context See attached. sequel_ace_crash_log_2024-07-03.log

Jason-Morcos commented 3 months ago

This is a weird one - thank you for including the log. It looks like some sort of odd pointer/seg fault error. I haven't seen this one happen myself but will keep an eye out. We haven't made overall connection changes recently so it's probably unrelated to the beta

Maef commented 1 month ago

I can confirm that the crash occurs after a connection is closed. For example, if you have tabs open while working at home, close your laptop, and then restart at work, or if the VPN has a hiccup and you need to restart it, the application crashes in both cases. The connection loss leads to a crash, but not immediately—only when you start using the application again.

yarkm13 commented 1 month ago

Steps to reproduce:

  1. open two tabs with connections to different servers (let's call them "good" and "bad")
  2. shutdown "bad" server (or VPN/SSH tunnel to it)
  3. try to run the query in the "bad" server's tab (*)
  4. after that you will receive the "Connection lost" dialog with "Close" and "Reconnect" buttons.
  5. click "Close"

Shortly after that, the app will crash. It's really annoying.

(*) I often work with local and remote servers via some sort of tunnel that is always connected, and sometimes tunnel connection silently dies. For some reason, SequelAce can examine even inactive tab connections while working with active ones and you will get that "Connection lost" dialog. BTW it's quite confusing because it does not state which connection was actually lost, and it looks like the current tab's connection is lost and you're unable to decide if you should close or reconnect. Once I spent some unreasonable time trying to "Reconnect" to my local MySQL docker instance that looks up and running, but when I finally clicked "Close" I realized that it was about another inactive tab and remote connection.

2024-09-06-SequelAce-crash.txt

billynoah commented 1 month ago

@yarkm13 - thanks for the detailed steps-to-reproduce. I can confirm that this is exactly the scenario that leads to what I've been experiencing.

matejsp commented 3 weeks ago

I have the same issue. Basically are connected using a ssh tunnel over VPN. When the ssh tunnel or VPN is closed, Ace asks if you wanna close or reconnect. If unable to reconnect we pick close connection and then very next thing you click on the UI crashes the APP. I have submitted literaly hundreds of report to apple crash report.

billynoah commented 2 weeks ago

@Jason-Morcos - just curious if you are still not able to reproduce this using the steps outlined by @yarkm13 above? I tried on three different machines running various versions of OS X and the crash happened on all three. Took approx 3 - 5 minutes for the crash to occur after the "Connection lost" message.

Jason-Morcos commented 2 weeks ago

I tried running locally, with the exact set of instructions provided (one DB local, one DB via VPN which I disconnected from after connecting), twice, waiting ten minutes, and it never crashed for me. If someone is able to reproduce this and take a stab at a fix, I am very happy to review and merge.

Jason-Morcos commented 2 weeks ago

Based on the crash log, my guess is it has something to do with NSKeyValue Observers. Probably there's one, somewhere, that's not getting unregistered when the connection is closed

vbrodrigo commented 2 weeks ago

Same problem here.. since ever to me (2019)!

To reproduce:

  1. Open connection using SSH Tunel in a second tab.
  2. Change IP or waiting for close connection (about 10min with no queries)
  3. Try some query and a dialog message shows "Close or Reconnect"

Here, we have 2 ways:

4.1. Click to reconnect and get a infinity loading. 4.2 Click to close. The tab will be closed, but try open a new tab and Sequel will crash and close.

Jason-Morcos commented 2 weeks ago

@vbrodrigo Following those steps exactly, I still can't reproduce it Ace is open source and I encourage contributions from everyone in the community - I'd gladly welcome a fix from anyone

(attached the "Close" case in case it looks like I'm doing something incorrect here)

https://github.com/user-attachments/assets/ce551ea6-5f66-4e10-b2aa-a60247287e32

Jason-Morcos commented 2 weeks ago

Reconnect also doesn't spin forever for me either

https://github.com/user-attachments/assets/364292b8-a15e-474f-a7c8-4ab9ce322c77

billynoah commented 2 weeks ago

@Jason-Morcos - see screen capture. Couple of notes:

  1. I cut out approx 2 boring minutes out of the middle of this clip. The actual crash happened at around 2:38.
  2. You'll see where I click "Table Info" is when the crash happens. I think it's just a coincidence as these crashes happen whenever they happen and not necessarily related to a click or query running.
  3. I have a multiple screen setup so you can see me dragging the crash notification into the screen recording.

Differences between what I did and what you did (possibly unrelated but who knows...)

  1. MySQL 8+ vs MariaDB
  2. Both visible connections are remote
  3. I actually shut down one of the remote servers - not just close the connection.
  4. Both my connections are via SSH tunnel, not TCP/IP or Socket. Are yours?

Hope this helps!

https://github.com/user-attachments/assets/b97a96c4-3366-4222-b47f-b6efa4d13233