After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 668759 - Glom crashes when a related choice shows a field other than the primary key
Glom crashes when a related choice shows a field other than the primary key
Status: RESOLVED FIXED
Product: glom
Classification: Other
Component: general
1.21.x
Other Linux
: High critical
: ---
Assigned To: Murray Cumming
Murray Cumming
Depends on:
Blocks:
 
 
Reported: 2012-01-26 16:59 UTC by alien
Modified: 2012-01-30 21:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
stack frame from kdevelop (3.57 KB, text/plain)
2012-01-26 20:50 UTC, alien
Details
test case which glom exits (589.08 KB, application/xml)
2012-01-27 13:49 UTC, alien
Details

Description alien 2012-01-26 16:59:01 UTC
Every time I try to open a table that has relation choice to another time glom just exit. The console shows the following messages. This doesn't allow to make relations.

Glom::DbTreeModel::DbTreeModel(const Glom::FoundSet&, const type_vec_const_layout_items&, bool, bool, Glom::Base_DB::type_vecConstLayoutFields&): no primary key field found in the list of items:
  field: description
Glom::DbTreeModelWithExtraText::DbTreeModelWithExtraText(const Glom::FoundSet&, const type_vec_const_layout_items&, bool, bool, Glom::Base_DB::type_vecConstLayoutFields&): m_column_index_key is not set, or is out of range. m_column_index_key=-1, size=1
virtual void Glom::DbTreeModelWithExtraText::get_value_vfunc(const iterator&, int, Glib::ValueBase&) const: m_column_index_key is not set.
virtual void Glom::DbTreeModelWithExtraText::get_value_vfunc(const iterator&, int, Glib::ValueBase&) const: m_column_index_key is not set.
Comment 1 André Klapper 2012-01-26 18:33:57 UTC
Thanks for taking the time to report this bug.
Without a stack trace from the crash it's very hard to determine what caused it.
Can you get us a stack trace? Please see http://live.gnome.org/GettingTraces for more information on how to do so. Thanks in advance!
Comment 2 Murray Cumming 2012-01-26 19:47:04 UTC
Before even doing that, I would like to know the exact version number. For instance, see the About box, or run "glom --version" in the terminal.

And what distro is this, and how did you install Glom?
Comment 3 alien 2012-01-26 20:49:40 UTC
(In reply to comment #2)
> Before even doing that, I would like to know the exact version number. For
> instance, see the About box, or run "glom --version" in the terminal.
> 
> And what distro is this, and how did you install Glom?

Hi 

The version is Glom 1.21.2.

This version was compiled from svn on Fedora 16. The last version from svn from 25th i can not compile it yet because error on libgda. Regarding the backtrace, because I have compiled dont have the debug information, and also cannot compile due to libgba dependecy which cannot be compiled also. lol
Comment 4 alien 2012-01-26 20:50:33 UTC
Created attachment 206223 [details]
stack frame from kdevelop
Comment 5 Murray Cumming 2012-01-26 21:48:31 UTC
Thanks. Could you try
a) Fixing the libgda build problem by using the --disable-introspection option.
b) Bulding the latest tarball version, or the code from git master.

You might also try a stable 1.20.x release.

Or could you tell me exactly how to reproduce this? However, I suspect that this crash won't happen with the latest code.
Comment 6 alien 2012-01-26 22:12:59 UTC
Going to try to compile the lastest. 

To reproduce:

Developer mode
for example, Table A and B,  
create a table relationship AB between field A.field1 and B.field_id. 
Select table A Fields, 
select field1, click open. 
On choice tab select the relationship AB,
select the field to show and confirm.

After this steps if you try to open again the field1 the application crash. The same thing happens when you close the field window and glom tries to draw the table form.

I have some ideas that I would like to add to glom, some of them I emailed to Murray I don't know if he get it. So I intend to contribute my specially need is to compile for windows because we are trying to use glom in a company for a temporary solution before have an erp.

Thanks for the hint regarding libgda.
Regards
Comment 7 Murray Cumming 2012-01-26 22:17:01 UTC
Can you reproduce this with any of the examples? That would be simpler.


> I have some ideas that I would like to add to glom, some of them I emailed to
> Murray I don't know if he get it.

Probably not. You are welcome to suggest them on the mailing list or bugzilla.

> So I intend to contribute my specially need
> is to compile for windows because we are trying to use glom in a company for a
> temporary solution before have an erp.

That would be interesting. I don't know how close the new Windows support is to being ready in GTK+ 3. But it would be great if someone tried.
Comment 8 alien 2012-01-27 07:58:21 UTC
 glibmm-2.31.2

Tried to compile and now gives me:

In file included from /usr/include/glibmm-2.4/glibmm.h:87:0,
                 from /usr/include/gtkmm-3.0/gtkmm/notebook.h:9,
                 from glom/utility_widgets/notebookglom.h:24,
                 from glom/utility_widgets/notebooklabelglom.h:24,
                 from glom/utility_widgets/notebooklabelglom.cc:21:
/usr/include/glibmm-2.4/glibmm/thread.h: In member function ‘T* Glib::StaticPrivate<T>::get()’:
/usr/include/glibmm-2.4/glibmm/thread.h:1067:26: warning: ‘void* g_static_private_get(GStaticPrivate*)’ is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:245): Use 'g_private_get' instead [-Wdeprecated-declarations]
/usr/include/glibmm-2.4/glibmm/thread.h: In member function ‘void Glib::StaticPrivate<T>::set(T*, Glib::StaticPrivate<T>::DestroyNotifyFunc)’:
/usr/include/glibmm-2.4/glibmm/thread.h:1073:3: warning: ‘void g_static_private_set(GStaticPrivate*, gpointer, GDestroyNotify)’ is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:248): Use 'g_private_set' instead [-Wdeprecated-declarations]
/usr/include/glibmm-2.4/glibmm/thread.h: In constructor ‘Glib::Private<T>::Private(Glib::Private<T>::DestructorFunc)’:
/usr/include/glibmm-2.4/glibmm/thread.h:1089:13: warning: ‘GPrivate* g_private_new(GDestroyNotify)’ is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:231) [-Wdeprecated-declarations]
  CXX    glom/navigation/glom_glom-box_tables.o
In file included from /usr/include/glibmm-2.4/glibmm.h:87:0,
                 from /usr/include/gtkmm-3.0/gtkmm/box.h:7,
                 from ./glom/box_withbuttons.h:24,
                 from ./glom/navigation/box_tables.h:24,
                 from glom/navigation/box_tables.cc:21:
/usr/include/glibmm-2.4/glibmm/thread.h: In member function ‘T* Glib::StaticPrivate<T>::get()’:
/usr/include/glibmm-2.4/glibmm/thread.h:1067:26: warning: ‘void* g_static_private_get(GStaticPrivate*)’ is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:245): Use 'g_private_get' instead [-Wdeprecated-declarations]
/usr/include/glibmm-2.4/glibmm/thread.h: In member function ‘void Glib::StaticPrivate<T>::set(T*, Glib::StaticPrivate<T>::DestroyNotifyFunc)’:
/usr/include/glibmm-2.4/glibmm/thread.h:1073:3: warning: ‘void g_static_private_set(GStaticPrivate*, gpointer, GDestroyNotify)’ is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:248): Use 'g_private_set' instead [-Wdeprecated-declarations]
/usr/include/glibmm-2.4/glibmm/thread.h: In constructor ‘Glib::Private<T>::Private(Glib::Private<T>::DestructorFunc)’:
/usr/include/glibmm-2.4/glibmm/thread.h:1089:13: warning: ‘GPrivate* g_private_new(GDestroyNotify)’ is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:231) [-Wdeprecated-declarations]
  CXXLD  glom/glom
/usr/bin/ld: /usr/local/lib/libepc-1.0.a(libepc_libepc_1_0_la-tls.o): undefined reference to symbol 'gnutls_x509_crt_set_activation_time@@GNUTLS_1_4'
/usr/bin/ld: note: 'gnutls_x509_crt_set_activation_time@@GNUTLS_1_4' is defined in DSO /usr/lib/libgnutls.so.26 so try adding it to the linker command line
/usr/lib/libgnutls.so.26: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [glom/glom] Error 1
make[2]: Leaving directory `/home/alien/Projects/glom'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/alien/Projects/glom'
make: *** [all] Error 2
*** Failed ***
Comment 9 Murray Cumming 2012-01-27 08:25:28 UTC
> /usr/bin/ld: /usr/local/lib/libepc-1.0.a(libepc_libepc_1_0_la-tls.o): undefined
> reference to symbol 'gnutls_x509_crt_set_activation_time@@GNUTLS_1_4'
> /usr/bin/ld: note: 'gnutls_x509_crt_set_activation_time@@GNUTLS_1_4' is defined
> in DSO /usr/lib/libgnutls.so.26 so try adding it to the linker command line
> /usr/lib/libgnutls.so.26: could not read symbols: Invalid operation

I have not noticed that myself, but I don't use gentoo. I guess you could try mentioning gnutls in the libepc .pc.in file.
Comment 10 alien 2012-01-27 09:33:11 UTC
Well I'm using fedora 16. I tried but didn't work. I think is a link problem from liepc.
Comment 11 Murray Cumming 2012-01-27 09:51:37 UTC
Ah, sorry for my confusion. Have you built libepc from source? That might be necessary.

I would like to create packages for Fedora but I miss something like Ubuntu's PPAs.
Comment 12 alien 2012-01-27 12:35:16 UTC
yes built libepc from source, using the last version.
Comment 13 alien 2012-01-27 13:14:16 UTC
compile problem resolve by --enable-static

./configure --prefix=/usr --enable-static
Comment 14 Murray Cumming 2012-01-27 13:18:38 UTC
When building libepc?
Comment 15 Murray Cumming 2012-01-27 13:20:11 UTC
Note that if you really want to build from source, and keep working with the source, jhbuild makes this much easier. I build Glom regularly on Fedora 16 with jbhuild.
Comment 16 alien 2012-01-27 13:49:17 UTC
Created attachment 206264 [details]
test case which glom exits 

this is my my file with all tables, saved as an example to test there problem when open the invoice table.
Comment 17 alien 2012-01-27 13:50:57 UTC
could you supply the jhbuild configuration file for me?

I built the lastest version with the same problem, so i submitted my glom file. Maybe i'm doing something wrong.
Comment 18 Murray Cumming 2012-01-27 13:53:07 UTC
(In reply to comment #17)
> could you supply the jhbuild configuration file for me?

I'm just using the regular GNOME 3.4 moduleset.
>
> I built the lastest version with the same problem, so i submitted my glom file.

Thanks. I'll take a look at that later.
Comment 19 Murray Cumming 2012-01-28 22:48:34 UTC
I assume that you mean the "Vendas" table. This was triggered by your area (Área emissora) field there having a related choice that showed just the departamentos:description field rather than the departamentos's table's primary key, as is more common. I am working on the correct fix.

Note that you probably did want that drop-down to show the ID and also the description, with the ID being the main field that would be used for the field's value.



I also need to fix this crash when clicking in the "Invoices Lines: Reference Month" field in the Vendas table's Details view:


Program received signal SIGSEGV, Segmentation fault.
0x081bdc70 in Gtk::CellRenderer::gobj (this=0x0) at /opt/gnome/include/gtkmm-3.0/gtkmm/cellrenderer.h:194
194	  GtkCellRenderer*       gobj()       { return reinterpret_cast<GtkCellRenderer*>(gobject_); }
Missing separate debuginfos, use: debuginfo-install boost-python-1.47.0-6.fc16.i686 cyrus-sasl-lib-2.1.23-27.fc16.i686 freetype-2.4.6-4.fc16.i686 gettext-libs-0.18.1.1-8.fc16.i686 glibc-2.14.90-24.fc16.4.i686 keyutils-libs-1.5.2-1.fc16.i686 krb5-libs-1.9.2-4.fc16.i686 libX11-1.4.3-1.fc16.i686 libXau-1.0.6-2.fc15.i686 libXcomposite-0.4.3-2.fc15.i686 libXcursor-1.1.11-3.fc15.i686 libXdamage-1.1.3-2.fc15.i686 libXext-1.3.0-1.fc16.i686 libXfixes-5.0-1.fc16.i686 libXi-1.4.5-1.fc16.i686 libXinerama-1.1.1-2.fc15.i686 libXrandr-1.3.1-2.fc15.i686 libXrender-0.9.6-2.fc15.i686 libffi-3.0.10-1.fc16.i686 libgcc-4.6.2-1.fc16.i686 libpng-1.2.46-1.fc16.i686 libselinux-2.1.6-5.fc16.i686 libstdc++-4.6.2-1.fc16.i686 libudev-173-3.fc16.i686 libunistring-0.9.3-2.fc15.i686 libuuid-2.20.1-2.1.fc16.i686 libxcb-1.7-3.fc16.i686 nss-3.13.1-10.fc16.i686 nss-softokn-freebl-3.13.1-15.fc16.i686 nss-util-3.13.1-3.fc16.i686 openldap-2.4.26-5.fc16.i686 openssl-1.0.0g-1.fc16.i686 postgresql-libs-9.1.2-2.fc16.i686 python-libs-2.7.2-5.2.fc16.i686 zlib-1.2.5-6.fc16.i686
(gdb) bt
  • #0 Gtk::CellRenderer::gobj
    at /opt/gnome/include/gtkmm-3.0/gtkmm/cellrenderer.h line 194
  • #1 Gtk::CellLayout::pack_start
    at celllayout.cc line 471
  • #2 Glom::CellRendererDbList::repack_cells_related
    at glom/mode_data/datawidget/cellrenderer_dblist.cc line 192
  • #3 Glom::CellRendererDbList::on_editing_started
    at glom/mode_data/datawidget/cellrenderer_dblist.cc line 220
  • #4 Gtk::CellRenderer_Class::editing_started_callback
    at cellrenderer.cc line 591
  • #5 _gtk_marshal_VOID__OBJECT_STRING
    at gtkmarshalers.c line 2468
  • #6 g_type_class_meta_marshal
    at gclosure.c line 885
  • #7 g_closure_invoke
    at gclosure.c line 774
  • #8 signal_emit_unlocked_R
    at gsignal.c line 3232
  • #9 g_signal_emit_valist
    at gsignal.c line 3033
  • #10 g_signal_emit
    at gsignal.c line 3090
  • #11 gtk_cell_renderer_start_editing
    at gtkcellrenderer.c line 869
  • #12 gtk_cell_area_activate_cell
    at gtkcellarea.c line 3421
  • #13 gtk_cell_area_real_event
    at gtkcellarea.c line 1117
  • #14 gtk_cell_area_event
    at gtkcellarea.c line 1828
  • #15 _gtk_tree_view_column_cell_event
    at gtktreeviewcolumn.c line 2983
  • #16 gtk_tree_view_button_press
    at gtktreeview.c line 3030
  • #17 Gtk::Widget_Class::button_press_event_callback
    at widget.cc line 4413
  • #18 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 85
  • #19 g_type_class_meta_marshal
    at gclosure.c line 885
  • #20 g_closure_invoke
    at gclosure.c line 774
  • #21 signal_emit_unlocked_R
    at gsignal.c line 3340
  • #22 g_signal_emit_valist
    at gsignal.c line 3043
  • #23 g_signal_emit
    at gsignal.c line 3090
  • #24 gtk_widget_event_internal
    at gtkwidget.c line 6147
  • #25 gtk_widget_event
    at gtkwidget.c line 5863
  • #26 gtk_propagate_event
    at gtkmain.c line 2417
  • #27 gtk_main_do_event
    at gtkmain.c line 1634
  • #28 _gdk_event_emit
    at gdkevents.c line 71
  • #29 gdk_event_source_dispatch
    at gdkeventsource.c line 360
  • #30 g_main_dispatch
    at gmain.c line 2513
  • #31 g_main_context_dispatch
    at gmain.c line 3050
  • #32 g_main_context_iterate
    at gmain.c line 3121
  • #33 g_main_loop_run
    at gmain.c line 3315
  • #34 gtk_main
    at gtkmain.c line 1159
  • #35 Gtk::Main::run_impl
    at main.cc line 423
  • #36 Gtk::Main::run
    at main.cc line 387
  • #37 main
    at glom/main.cc line 629

Comment 20 Murray Cumming 2012-01-28 22:52:49 UTC
> I also need to fix this crash when clicking in the "Invoices Lines: Reference
> Month" field in the Vendas table's Details view

Note that that field has a similar problem, though it's made worse there by you naming the Relationship (used in the choice) "Months ID" rather than Months. Here too you use Description as the main field, though it's really the ID that you want, with Description just being an "Also show" field.

Anyway it should not crash, so I will work on that too.
Comment 21 alien 2012-01-29 08:12:17 UTC
(In reply to comment #20)
> > I also need to fix this crash when clicking in the "Invoices Lines: Reference
> > Month" field in the Vendas table's Details view
> 
> Note that that field has a similar problem, though it's made worse there by you
> naming the Relationship (used in the choice) "Months ID" rather than Months.
> Here too you use Description as the main field, though it's really the ID that
> you want, with Description just being an "Also show" field.
> 
> Anyway it should not crash, so I will work on that too.

Thanks you,

It was my mistake then, I will correct this. I was studding also the small business example, and notice that first it has a choice with id relationship and the other related fields were lookup value based on change value of relationship.

Regards
Comment 22 Murray Cumming 2012-01-29 19:45:15 UTC
This first crash is fixed by this commit:
http://git.gnome.org/browse/glom/commit/?id=ca6854063a2561bea3379b7d08caee8542f6bfe8

I'm working on the second crash ( comment #19 ).
Comment 23 Murray Cumming 2012-01-29 20:13:08 UTC
That second crash is fixed by this commit:
http://git.gnome.org/browse/glom/commit/?id=0d7acedc2162617dd91cdfde051d45a885c8736e
Comment 24 Murray Cumming 2012-01-29 20:20:04 UTC
(In reply to comment #21)
> I was studding also the small
> business example, and notice that first it has a choice with id relationship
> and the other related fields were lookup value based on change value of
> relationship.

Or you can just show the related field instead of copying its value (looking it up) into a field in the parent table. For instance, you would want to look up (copy) the current price of a product rather than show its price at the time that you are looking at the UI.


This commit should help you by automatically choosing the field that you probably want for a related choice:
http://git.gnome.org/browse/glom/commit/?id=5eb8d49384a917c61f7bb5fd3d24db30ff08184d


By the way, your test case in comment #4 has lots of "column_width=" attributes. I guess that they were added when you created the file with an older version of Glom. They should not be created now, because Glom now does a better job of guessing the right width for TreeView (list) columns in the UI. You should probably remove those attributes from the XML.

If they come back without you manually entering a number for the column width, please let me know.

Thanks again for reporting these problems.
Comment 25 alien 2012-01-29 20:43:22 UTC
Ok updated.

Just an apart, did anyone compiled this last version on windows? I have being struggle to create a new windows version. Regarding the column-width, I started to use the glom 1.18 version from my fedora 16 repo, but then I had problem because I need to open the file on Windows computers and there were only 1.14 version available, so there is a bit of mixture in XML that I need to clean up.

As soon I start to understand the code I will start developing some features. 

Thanks
Comment 26 Murray Cumming 2012-01-29 20:46:30 UTC
> did anyone compiled this last version on windows?

Not that I know of. I am waiting to hear if the Windows support in GTK+ 3 has been updated. I believe that it is in progress and that it should be a great improvement.

> Regarding the column-width, I started to use the glom 1.18 version from my fedora 16 repo

Yes, that explains it.
Comment 27 Murray Cumming 2012-01-30 21:26:46 UTC
(In reply to comment #8)
> /usr/bin/ld: /usr/local/lib/libepc-1.0.a(libepc_libepc_1_0_la-tls.o): undefined
> reference to symbol 'gnutls_x509_crt_set_activation_time@@GNUTLS_1_4'
> /usr/bin/ld: note: 'gnutls_x509_crt_set_activation_time@@GNUTLS_1_4' is defined
> in DSO /usr/lib/libgnutls.so.26 so try adding it to the linker command line
> /usr/lib/libgnutls.so.26: could not read symbols: Invalid operation
> collect2: ld returned 1 exit status

This is apparently now fixed. See bug #668882 .