ellie-commons / sequeler

SQL Client built in Vala
GNU General Public License v3.0
804 stars 66 forks source link

Crash on arch db connection #315

Open gavr123456789 opened 4 years ago

gavr123456789 commented 4 years ago

Distro: arch Reproduce: Create db

$ sqlite3 databasename
sqlite> create table tblone(one varchar(10), two smallint);
sqlite> insert into tblone values('helloworld',20);
sqlite> insert into tblone values('archlinux', 30);
sqlite> select * from tblone;
.quit

Open db via sequeler:
image When you click the check button, it says " Connection successful!"
After press "Connect" app crash.
Log:

~ ❯❯❯ com.github.alecaddd.sequeler                                                

(Sequeler:30405): Gtk-CRITICAL **: 21:14:02.817: gtk_container_add: assertion 'GTK_IS_WIDGET (widget)' failed

(Sequeler:30405): Gtk-CRITICAL **: 21:14:02.921: gtk_container_add: assertion 'GTK_IS_WIDGET (widget)' failed

(Sequeler:30405): GLib-GObject-CRITICAL **: 21:14:21.475: g_object_ref: assertion 'old_val > 0' failed
fish: 'com.github.alecaddd.sequeler' terminated by signal SIGSEGV (Address boundary error)
Alecaddd commented 4 years ago

Hi, thanks for using Sequeler and for this bug report. indeed, this happens to me as well, I'll fix it ASAP.

Alecaddd commented 4 years ago

I found the issue, is not related to SQLite unfortunately, as it crashes at every new connection creation. So yay, I introduced a pretty nasty bug when I rewrote the sidebar library. Good job!

gavr123456789 commented 4 years ago

omg, )

Alecaddd commented 4 years ago

This is what caused the regression. https://github.com/Alecaddd/sequeler/pull/314/commits/3bc53835b584847bd7e136420abe6e6cadb1594a Onto fixing it.

Alecaddd commented 4 years ago

Hey @gavr123456789, would you be able to pull the PR #317 and see if it fixes everything? Everything works for me with those changes.

gavr123456789 commented 4 years ago

Okey, one sec ^^

gavr123456789 commented 4 years ago

Hmm, found new case, errors is different.
1) Open "add new db..."
2) Select db file with SQLite 3) Change connection name 4) Press "check"

~ ❯❯❯ com.github.alecaddd.sequeler

(Sequeler:102952): Gtk-CRITICAL **: 08:42:15.900: gtk_container_add: assertion 'GTK_IS_WIDGET (widget)' failed

(Sequeler:102952): Gtk-CRITICAL **: 08:42:15.970: gtk_container_add: assertion 'GTK_IS_WIDGET (widget)' failed

(Sequeler:102952): Pango-CRITICAL **: 08:42:28.800: pango_layout_set_attributes: assertion 'layout != NULL' failed

(Sequeler:102952): Pango-CRITICAL **: 08:42:28.800: pango_layout_set_alignment: assertion 'layout != NULL' failed

(Sequeler:102952): Pango-CRITICAL **: 08:42:28.800: pango_layout_set_ellipsize: assertion 'PANGO_IS_LAYOUT (layout)' failed

(Sequeler:102952): Pango-CRITICAL **: 08:42:28.800: pango_layout_set_wrap: assertion 'PANGO_IS_LAYOUT (layout)' failed

(Sequeler:102952): Pango-CRITICAL **: 08:42:28.800: pango_layout_set_single_paragraph_mode: assertion 'PANGO_IS_LAYOUT (layout)' failed
**
Gtk:ERROR:../gtk/gtk/gtklabel.c:3396:gtk_label_update_layout_width: assertion failed: (priv->layout)
Bail out! Gtk:ERROR:../gtk/gtk/gtklabel.c:3396:gtk_label_update_layout_width: assertion failed: (priv->layout)
fish: 'com.github.alecaddd.sequeler' terminated by signal SIGABRT (Abort)

...
Now it's not possible to immediately reproduce it. But if you just spam the "check" button you can catch this crash.

Pango:ERROR:../pango/pango/pango-context.c:1434:itemize_state_process_run: assertion failed: (state->run_end != state->run_start)
Bail out! Pango:ERROR:../pango/pango/pango-context.c:1434:itemize_state_process_run: assertion failed: (state->run_end != state->run_start)
fish: 'com.github.alecaddd.sequeler' terminated by signal SIGABRT (Abort)

Btw old problem looks the same:

~ ❯❯❯ com.github.alecaddd.sequeler                                                

(Sequeler:103753): Gtk-CRITICAL **: 08:50:35.372: gtk_container_add: assertion 'GTK_IS_WIDGET (widget)' failed

(Sequeler:103753): Gtk-CRITICAL **: 08:50:35.469: gtk_container_add: assertion 'GTK_IS_WIDGET (widget)' failed

(Sequeler:103753): GLib-GObject-CRITICAL **: 08:50:41.689: g_object_ref: assertion 'old_val > 0' failed
fish: 'com.github.alecaddd.sequeler' terminated by signal SIGSEGV (Address boundary error)

After open db.

Alecaddd commented 4 years ago

All right, thanks for the review. I'll continue working on it tomorrow.

Alecaddd commented 4 years ago

@gavr123456789 I update the PR and that should fix everything.

I was wrongly handling the async and multi thread methods and not coming out of those at the proper time.

Let me know if that fixed all the issues for you as I can't reproduce the errors you reported anymore, so, finger crossed :crossed_fingers:

Alecaddd commented 4 years ago

I merged the PR because it was a blocker for other updates I'm currently handling, and it introduced some important architectural fixes. I'm gonna reopen this issue and wait for you feedback.

gavr123456789 commented 4 years ago

Same error on master.

❯❯❯ com.github.alecaddd.sequeler                                                

(Sequeler:32342): Gtk-CRITICAL **: 04:34:23.492: gtk_container_add: assertion 'GTK_IS_WIDGET (widget)' failed

(Sequeler:32342): Gtk-CRITICAL **: 04:34:23.596: gtk_container_add: assertion 'GTK_IS_WIDGET (widget)' failed

(Sequeler:32342): GLib-GObject-CRITICAL **: 04:34:40.118: g_object_ref: assertion 'old_val > 0' failed
fish: 'com.github.alecaddd.sequeler' terminated by signal SIGSEGV (Address boundary error)

I'm already starting to think that the file is to blame. The check is successful, but I don't know if it checks for the file or if it really tries to connect.

The first thing I noticed, I get the first 2 CRITICAL messages after opening the new connection creation window.

I will try on another car, my GTK is patched a little, but I don't think it can affect anything. (The file selection window provides thumbnails instead of a list)
image

databasename.zip

Alecaddd commented 4 years ago

Maybe the GTK version is to blame. I'm on GTK 3.22.30, what about you?

Alecaddd commented 4 years ago

Yup, all working properly for me. Screenshot from 2020-04-11 18-45-49

gavr123456789 commented 4 years ago

image Okey, I can also run it from master on my laptop(which is with Elementary). Hmmm

gavr123456789 commented 4 years ago

My main PC is arch, have 3.24.17+22+g99bae0fb5f-1 gtk there.

Alecaddd commented 4 years ago

All right, that is starting to make sense as it seems to be related to your version of Gtk. elementary will soon move to the newest Gtk version as it moves its base to the next Ubuntu LTS. Once that transition happens, I will see if any of my source code needs to be ported to the new version. Until then, I'll mark this issue as out-of-scope.

gavr123456789 commented 4 years ago

OK, can't wait for Elementary on Ubuntu 20.04

Alecaddd commented 4 years ago

Thank you again for your report as you helped identity a super nasty regression I introduced in the previous release :sweat_smile: