juddmon / jpilot

Desktop Organizer Software for the Palm Pilot
GNU General Public License v2.0
53 stars 13 forks source link

Crash when selecting item from address search results #56

Closed unihedron closed 2 weeks ago

unihedron commented 2 months ago

Jpilot crashes just after I click on an item that shows up in the search results.

Using Jpilot 2.0.1 on Arch Linux

I can reproduce this as follows:

gdb shows:

Thread 1 "jpilot" received signal SIGSEGV, Segmentation fault.
0x00005555555789bb in address_gui (vbox=0x555555bcc370, hbox=0x555555a94250) at address_gui.c:4330
4330                if (GTK_IS_COMBO_BOX(phone_type_list_menu[i]) &&
eklausme commented 2 months ago

Hmm, I cannot reproduce this behaviour you described in detail on Arch Linux.

Versions:

$ jpilot -v

J-Pilot version 2.0.1
  Copyright (C) 1999-2014 by Judd Montgomery
  judd@jpilot.org, http://jpilot.org

J-Pilot comes with ABSOLUTELY NO WARRANTY; for details see the file
COPYING included with the source code, or in /usr/share/docs/jpilot/.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.

Date compiled May  9 2023 16:32:54
Compiled with these options:
  Installed Path - /usr
  pilot-link version - 0.12.5
  USB support - yes
  Private record support - yes
  Datebk support - yes
  Plugin support - yes
  Manana support - yes
  NLS support (foreign languages) - yes
  GTK3 support - yes

Let's check on our libraries in Arch Linux.

$ ldd /bin/jpilot
        linux-vdso.so.1 (0x0000703357eef000)
        libpisock.so.9 => /usr/lib/libpisock.so.9 (0x0000703357d89000)
        libgtk-3.so.0 => /usr/lib/libgtk-3.so.0 (0x0000703357400000)
        libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0x0000703357c59000)
        libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0x0000703357233000)
        libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x0000703357bfa000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007033570e5000)
        libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x0000703356f79000)
        libc.so.6 => /usr/lib/libc.so.6 (0x0000703356d88000)
        libusb-0.1.so.4 => /usr/lib/libusb-0.1.so.4 (0x0000703357bf0000)
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x0000703357beb000)
        libbluetooth.so.3 => /usr/lib/libbluetooth.so.3 (0x0000703357bbd000)
        libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x0000703357bb4000)
        libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0x0000703356d78000)
        libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x0000703356d0f000)
        libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x0000703356bf5000)
        libcairo.so.2 => /usr/lib/libcairo.so.2 (0x0000703356ac2000)
        libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x0000703356aa6000)
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x0000703356a54000)
        libfribidi.so.0 => /usr/lib/libfribidi.so.0 (0x0000703356a34000)
        libcairo-gobject.so.2 => /usr/lib/libcairo-gobject.so.2 (0x0000703356a2b000)
        libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x0000703356a04000)
        libepoxy.so.0 => /usr/lib/libepoxy.so.0 (0x00007033568f7000)
        libm.so.6 => /usr/lib/libm.so.6 (0x0000703356808000)
        libXi.so.6 => /usr/lib/libXi.so.6 (0x00007033567f3000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0x00007033566b2000)
        libatk-bridge-2.0.so.0 => /usr/lib/libatk-bridge-2.0.so.0 (0x0000703356676000)
        libcloudproviders.so.0 => /usr/lib/libcloudproviders.so.0 (0x000070335665d000)
        libtracker-sparql-3.0.so.0 => /usr/lib/libtracker-sparql-3.0.so.0 (0x0000703356586000)
        libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x000070335657e000)
        libxkbcommon.so.0 => /usr/lib/libxkbcommon.so.0 (0x0000703356534000)
        libwayland-client.so.0 => /usr/lib/libwayland-client.so.0 (0x0000703356525000)
        libwayland-cursor.so.0 => /usr/lib/libwayland-cursor.so.0 (0x000070335651b000)
        libwayland-egl.so.1 => /usr/lib/libwayland-egl.so.1 (0x0000703356516000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0x0000703356501000)
        libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x00007033564f3000)
        libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x00007033564ee000)
        libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0x00007033564e9000)
        libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x00007033564dc000)
        libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x00007033564d7000)
        libpng16.so.16 => /usr/lib/libpng16.so.16 (0x000070335649b000)
        libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007033563ff000)
        libtiff.so.6 => /usr/lib/libtiff.so.6 (0x0000703356374000)
        libz.so.1 => /usr/lib/libz.so.1 (0x000070335635b000)
        libmount.so.1 => /usr/lib/libmount.so.1 (0x000070335630c000)
        libffi.so.8 => /usr/lib/libffi.so.8 (0x00007033562ff000)
        libpcre2-8.so.0 => /usr/lib/libpcre2-8.so.0 (0x0000703356260000)
        /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x0000703357ef1000)
        libthai.so.0 => /usr/lib/libthai.so.0 (0x0000703356255000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x000070335618b000)
        libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x0000703356169000)
        libXrender.so.1 => /usr/lib/libXrender.so.1 (0x000070335615b000)
        libxcb.so.1 => /usr/lib/libxcb.so.1 (0x0000703356130000)
        libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0x0000703356121000)
        libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0x000070335611c000)
        libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0x0000703356072000)
        libexpat.so.1 => /usr/lib/libexpat.so.1 (0x0000703356047000)
        libatspi.so.0 => /usr/lib/libatspi.so.0 (0x0000703356011000)
        libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x0000703355fc0000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x0000703355f92000)
        libjson-glib-1.0.so.0 => /usr/lib/libjson-glib-1.0.so.0 (0x0000703355f68000)
        libxml2.so.2 => /usr/lib/libxml2.so.2 (0x0000703355e1a000)
        libzstd.so.1 => /usr/lib/libzstd.so.1 (0x0000703355d3b000)
        liblzma.so.5 => /usr/lib/liblzma.so.5 (0x0000703355d08000)
        libjbig.so.2.1 => /usr/lib/libjbig.so.2.1 (0x0000703355cfa000)
        libblkid.so.1 => /usr/lib/libblkid.so.1 (0x0000703355cc1000)
        libdatrie.so.1 => /usr/lib/libdatrie.so.1 (0x0000703355cb6000)
        libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x0000703355ca3000)
        libbrotlidec.so.1 => /usr/lib/libbrotlidec.so.1 (0x0000703355c94000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0x0000703355c8f000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x0000703355c87000)
        libsystemd.so.0 => /usr/lib/libsystemd.so.0 (0x0000703355b91000)
        libicuuc.so.75 => /usr/lib/libicuuc.so.75 (0x0000703355997000)
        libbrotlicommon.so.1 => /usr/lib/libbrotlicommon.so.1 (0x0000703355974000)
        libcap.so.2 => /usr/lib/libcap.so.2 (0x0000703355968000)
        libicudata.so.75 => /usr/lib/libicudata.so.75 (0x0000703353c00000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x0000703353800000)

Relevant GTK 3 include files containing GTK_IS_COMBO_BOX:

/usr/include$ md5sum gtk-4.0/gtk/deprecated/gtkcomboboxtext.h gtk-4.0/gtk/deprecated/gtkcombobox.h gtk-3.0/gtk/gtkcomboboxtext.h gtk-3.0/gtk/a11y/gtkcomboboxaccessible.h
69cfeb41afd84f0f4202b5459f9f9fe3  gtk-4.0/gtk/deprecated/gtkcomboboxtext.h
c1e1b0d21c943e4dcf2e84811ce29b35  gtk-4.0/gtk/deprecated/gtkcombobox.h
b774e9596f8f7be9e30e48de7f2ca8c6  gtk-3.0/gtk/gtkcomboboxtext.h
f7cfa8789b439040c70092d54a058da2  gtk-3.0/gtk/a11y/gtkcomboboxaccessible.h
unihedron commented 2 months ago

Some differences from mine that was just installed from AUR.

$ jpilot -v
...
Date compiled Aug 17 2023 19:45:54
  pilot-link version - 0.13.0

Some of your library list values are different than mine. Not sure if that is important:

$ ldd /bin/jpilot                                                                                                                                                                                          
        linux-vdso.so.1 (0x00007ade05bd1000)                                                                                                                                                               
        libpisock.so.9 => /usr/lib/libpisock.so.9 (0x00007ade05a79000)
        libgtk-3.so.0 => /usr/lib/libgtk-3.so.0 (0x00007ade05200000)
        libgdk-3.so.0 => /usr/lib/libgdk-3.so.0 (0x00007ade05114000)
        libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0x00007ade05a35000)
        libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0x00007ade04f47000)
        libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x00007ade059d6000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007ade04df9000)
        libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x00007ade04c8d000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007ade04a9c000)
        libusb-0.1.so.4 => /usr/lib/libusb-0.1.so.4 (0x00007ade059cc000)
        libbluetooth.so.3 => /usr/lib/libbluetooth.so.3 (0x00007ade04a6e000)
        libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x00007ade059c5000)
        libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0x00007ade04a5e000)
        libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x00007ade049f5000)
        libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007ade048db000)
        libcairo.so.2 => /usr/lib/libcairo.so.2 (0x00007ade047a8000)
        libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x00007ade0478c000)
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00007ade0473c000)
        libfribidi.so.0 => /usr/lib/libfribidi.so.0 (0x00007ade0471c000)
        libcairo-gobject.so.2 => /usr/lib/libcairo-gobject.so.2 (0x00007ade059b8000)
        libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x00007ade046f5000)
        libepoxy.so.0 => /usr/lib/libepoxy.so.0 (0x00007ade045e8000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007ade044f9000)
        libXi.so.6 => /usr/lib/libXi.so.6 (0x00007ade044e6000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0x00007ade043a5000)
        libatk-bridge-2.0.so.0 => /usr/lib/libatk-bridge-2.0.so.0 (0x00007ade04369000)
        libcloudproviders.so.0 => /usr/lib/libcloudproviders.so.0 (0x00007ade04350000)
        libtracker-sparql-3.0.so.0 => /usr/lib/libtracker-sparql-3.0.so.0 (0x00007ade04279000)
        libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00007ade04271000)
        libxkbcommon.so.0 => /usr/lib/libxkbcommon.so.0 (0x00007ade04229000)
        libwayland-client.so.0 => /usr/lib/libwayland-client.so.0 (0x00007ade0421a000)
        libwayland-cursor.so.0 => /usr/lib/libwayland-cursor.so.0 (0x00007ade04210000)
        libwayland-egl.so.1 => /usr/lib/libwayland-egl.so.1 (0x00007ade0420b000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0x00007ade041f6000)
        libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x00007ade041ea000)
        libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x00007ade041e3000)
        libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0x00007ade041de000)
        libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x00007ade041d1000)
        libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x00007ade041cc000)
        libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007ade04192000)
        libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007ade040f4000)
        libtiff.so.6 => /usr/lib/libtiff.so.6 (0x00007ade04069000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00007ade04050000)
        libmount.so.1 => /usr/lib/libmount.so.1 (0x00007ade04001000)
        libffi.so.8 => /usr/lib/libffi.so.8 (0x00007ade03ff6000)
        libpcre2-8.so.0 => /usr/lib/libpcre2-8.so.0 (0x00007ade03f55000)
        /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007ade05bd3000)
        libthai.so.0 => /usr/lib/libthai.so.0 (0x00007ade03f4a000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007ade03e80000)
        libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007ade03e5e000)
        libXrender.so.1 => /usr/lib/libXrender.so.1 (0x00007ade03e52000)
        libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007ade03e25000)
        libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0x00007ade03e16000)
        libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0x00007ade03e11000)
        libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0x00007ade03d67000)
        libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007ade03d3e000)
        libatspi.so.0 => /usr/lib/libatspi.so.0 (0x00007ade03d06000)
        libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x00007ade03cb5000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007ade03c87000)
        libjson-glib-1.0.so.0 => /usr/lib/libjson-glib-1.0.so.0 (0x00007ade03c5d000)
        libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007ade03b11000)
        libzstd.so.1 => /usr/lib/libzstd.so.1 (0x00007ade03a30000)
        liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007ade039fd000)
        libjbig.so.2.1 => /usr/lib/libjbig.so.2.1 (0x00007ade039ef000)
        libblkid.so.1 => /usr/lib/libblkid.so.1 (0x00007ade039b6000)
        libdatrie.so.1 => /usr/lib/libdatrie.so.1 (0x00007ade039ad000)
        libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007ade03998000)
        libbrotlidec.so.1 => /usr/lib/libbrotlidec.so.1 (0x00007ade03989000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0x00007ade03984000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007ade0397c000)
        libsystemd.so.0 => /usr/lib/libsystemd.so.0 (0x00007ade03888000)
        libicuuc.so.75 => /usr/lib/libicuuc.so.75 (0x00007ade0368c000)
        libbrotlicommon.so.1 => /usr/lib/libbrotlicommon.so.1 (0x00007ade03669000)
        libcap.so.2 => /usr/lib/libcap.so.2 (0x00007ade0365d000)
        libicudata.so.75 => /usr/lib/libicudata.so.75 (0x00007ade01800000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007ade01400000)

And your "relevant" GTK checksums do ot appear in my list, maybe no big deal:

$ md5sum gtk-4.0/gtk/deprecated/gtkcomboboxtext.h gtk-4.0/gtk/deprecated/gtkcombobox.h gtk-3.0/gtk/gtkcomboboxtext.h gtk-3.0/gtk/a11y/gtkcomboboxaccessible.h                                              
md5sum: gtk-4.0/gtk/deprecated/gtkcomboboxtext.h: No such file or directory                                                                                                                                
md5sum: gtk-4.0/gtk/deprecated/gtkcombobox.h: No such file or directory
md5sum: gtk-3.0/gtk/gtkcomboboxtext.h: No such file or directory
md5sum: gtk-3.0/gtk/a11y/gtkcomboboxaccessible.h: No such file or directory
eklausme commented 2 months ago

I compiled J-Pilot again on my Arch Linux machine.

$ ./jpilot -v

J-Pilot version 2.0.1
  Copyright (C) 1999-2014 by Judd Montgomery
  judd@jpilot.org, http://jpilot.org

J-Pilot comes with ABSOLUTELY NO WARRANTY; for details see the file
COPYING included with the source code, or in /usr/share/docs/jpilot/.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.

Date compiled Aug 23 2024 18:57:29
Compiled with these options:
  Installed Path - /usr
  pilot-link version - 0.12.5
  USB support - yes
  Private record support - yes
  Datebk support - yes
  Plugin support - yes
  Manana support - yes
  NLS support (foreign languages) - yes
  GTK3 support - yes

Still, though, I cannot reproduce the error you described.

Can you double check on your pilot-link version. I have 0.12.5, you have 0.13. Also double check on GTK3 support.

I have gtk3 1:3.24.43-1, although I do not think that this version is supercritical.

unihedron commented 2 months ago

Thank you for continuing.

I have a newer pilot-link version - 0.13.0 from pilot-link-git

It turns out that the original pilot-link website: https://www.pilot-link.org/ has expired

And the pilot-link 0.12.5-2 for Arch gives me these compile errors (snippet):

configure:3548: gcc -V >&5
gcc: error: unrecognized command-line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3559: $? = 1
configure:3548: gcc -qversion >&5
gcc: error: unrecognized command-line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.

My gtk3 version is the same as yours 1:3.24.43-1

unihedron commented 2 months ago

Most times it crashes, and I found that clicking on the last found "Address" listing of many causes a crash (boundary error).

I don't know enough about what that section of code is doing, by I commented out the offending bit at line 4330 of address_gui.c to stop it from crashing:

            // if (GTK_IS_COMBO_BOX(phone_type_list_menu[i]) &&
            //     gtk_combo_box_get_has_entry(GTK_COMBO_BOX(phone_type_list_menu[i]))) {
            //     gtk_combo_box_text_remove(GTK_COMBO_BOX_TEXT(phone_type_list_menu[i]), j);
            // }

Something about the GTK_IS_COMBO_BOX macro causes problems with my system.

You might have luck getting it to crash on your system by searching for a term with many address results and randomly and repeatedly clicking on many of those results. I found that sometimes it would not crash for me, so maybe your system is slightly different that mine.

juddmon commented 2 months ago

This bug is not related to GTK or pilot-link. David was the last maintainer of pilot-link, many years ago. That is at https://github.com/desrod/pilot-link I forked that a while back and built a pilot-link 0.13.0 debian package with the python removed. I have never checked it in anywhere and really should. I'd welcome a volunteer for https://github.com/juddmon/pilot-link.

J-Pilot was rock solid with GTK2 and was bug free (as far as I know). When we ported it to GTK3 there are some bugs now and it crashes some times. This is one of those bugs. I traced through the history from GTK2 to the GTK3 port and in the GTK2 version phone_type_list_menu was a 2 dimensional array and I cycled through and set all of the pointers to NULL before they were used because not all compilers would. When that got translated to GTK3 the menus changed and phone_type_list_menu is now an array of pointers. It doesn't make sense to remove the text from an entry that has not been created yet.

It is understandable how this bug got created. I removed that entire nested loop and committed it to main. Thank you very much for finding this annoyance!

eklausme commented 2 months ago

Thanks!

Updated AUR jpilot package accordingly.

unihedron commented 2 months ago

Great!! thanks for the details/history.