Bug 234814 - x11/libfm: fix x11-fm/pcmanfm segfault on start.
Summary: x11/libfm: fix x11-fm/pcmanfm segfault on start.
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alexandre C. Guimarães
URL: https://reviews.freebsd.org/D18840
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-10 09:01 UTC by Walter Schwarzenfeld
Modified: 2019-03-29 04:30 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (portmaster)
rigoletto: maintainer-feedback? (jsm)


Attachments
pcmanfm.gdb (17.39 KB, text/plain)
2019-01-10 09:01 UTC, Walter Schwarzenfeld
no flags Details
Enhance flavors x11/libfm (25.86 KB, patch)
2019-01-12 21:17 UTC, Olivier Duchateau
no flags Details | Diff
Patch to split x11/libfm (29.47 KB, patch)
2019-01-14 19:09 UTC, Olivier Duchateau
no flags Details | Diff
Patch to split x11/libfm (30.20 KB, patch)
2019-01-14 19:23 UTC, Olivier Duchateau
no flags Details | Diff
Bump qt portrevisions since it changed meanwhile (15.66 KB, patch)
2019-01-20 20:04 UTC, Jesper Schmitz Mouridsen
no flags Details | Diff
added missing libfm-gtk part (28.77 KB, patch)
2019-01-20 22:39 UTC, Jesper Schmitz Mouridsen
no flags Details | Diff
Everything is building now. (35.45 KB, patch)
2019-01-22 19:59 UTC, Alexandre C. Guimarães
no flags Details | Diff
This should apply. (29.80 KB, patch)
2019-01-23 16:50 UTC, Alexandre C. Guimarães
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Walter Schwarzenfeld freebsd_triage 2019-01-10 09:01:00 UTC
Created attachment 200978 [details]
pcmanfm.gdb

x11-fm/pcmanfm and x11-fm/pcmanfm-gtk3 segfaults on start without any error message.
(11.2amd64).
Comment 1 Walter Schwarzenfeld freebsd_triage 2019-01-12 08:18:47 UTC
Now I got:
(pcmanfm:47422): GLib-GObject-WARNING **: 09:12:58.548: invalid (NULL) pointer instance

(pcmanfm:47422): GLib-GObject-CRITICAL **: 09:12:58.549: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(pcmanfm:47422): GLib-GObject-WARNING **: 09:12:58.549: invalid (NULL) pointer instance

(pcmanfm:47422): GLib-GObject-CRITICAL **: 09:12:58.549: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(pcmanfm:47422): GLib-GObject-CRITICAL **: 09:12:58.549: g_object_set_qdata_full: assertion 'G_IS_OBJECT (object)' failed

(pcmanfm:47422): GLib-GObject-WARNING **: 09:12:58.549: invalid (NULL) pointer instance

(pcmanfm:47422): GLib-GObject-CRITICAL **: 09:12:58.549: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(pcmanfm:47422): GLib-GObject-WARNING **: 09:12:58.549: invalid (NULL) pointer instance

(pcmanfm:47422): GLib-GObject-CRITICAL **: 09:12:58.549: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(pcmanfm:47422): Gtk-CRITICAL **: 09:12:58.549: IA__gtk_widget_show: assertion 'GTK_IS_WIDGET (widget)' failed

(pcmanfm:47422): Gtk-CRITICAL **: 09:12:58.549: IA__gtk_container_add: assertion 'GTK_IS_WIDGET (widget)' failed

(pcmanfm:47422): Gtk-WARNING **: 09:12:58.568: Radio group does not contain an action with value '-1'

(pcmanfm:47422): Gtk-WARNING **: 09:12:58.568: Radio group does not contain an action with value '-1'

(pcmanfm:47422): Gtk-WARNING **: 09:12:58.571: Radio group does not contain an action with value '-1'

(pcmanfm:47422): GLib-GObject-CRITICAL **: 09:12:58.868: g_object_set: assertion 'G_IS_OBJECT (object)' failed
Segmentation fault (core dumped)
Comment 2 Walter Schwarzenfeld freebsd_triage 2019-01-12 08:33:21 UTC
(Seems no bug). But something is weird there. I can open pcmanfm with root, but not as user.
Comment 3 Olivier Duchateau 2019-01-12 21:17:51 UTC
Created attachment 201081 [details]
Enhance flavors x11/libfm

I made a patch which enhances flavors (now there are core, gtk2 and gtk3). It was tested with PCManFM (with Gtk2 flavor) without coredump (but still GLib warnings).

Be careful, some ports needs to be updated.
Comment 4 Walter Schwarzenfeld freebsd_triage 2019-01-12 23:14:12 UTC
Thanks, seems to work.
Comment 5 Alexandre C. Guimarães freebsd_committer freebsd_triage 2019-01-13 15:15:25 UTC
Hi.

What is the purpose of the Core flavor? I mean, what will benefit of it, -qt versions?

Thanks! :-)
Comment 6 Olivier Duchateau 2019-01-13 17:35:22 UTC
(In reply to Alexandre C. Guimarães from comment #5)

Yes, core flavor is for Qt applications. But I think my patch needs more refinement, because poudriere complains about Gtk flavors.

We must add this line:

FLAVOR?=       ${FLAVORS:[1]}

And change this one:

LIB_DEPENDS=   libfm.so:x11/libfm@core

by

LIB_DEPENDS=   libfm.so:x11/libfm

Currently I can't test my changes, because I'm building (on my poudriere box) something else.
Comment 7 Alexandre C. Guimarães freebsd_committer freebsd_triage 2019-01-13 18:00:14 UTC
Btw, new FLAVOR needs portsmgr approvement. I wasn't had time to test this patch yet but I will do later today. :)
Comment 8 Olivier Duchateau 2019-01-14 19:09:39 UTC
Created attachment 201136 [details]
Patch to split x11/libfm

I made new patch, because poudriere complains about malformed port. So I created slave port (x11/libfm-gtk), I think it is better.

The new port contains Gtk flavors, and x11/libfm its core library (linking to GLib, Gio).

The patch contains ports affected by these changes and I updated x11/Makefile too.
Comment 9 Olivier Duchateau 2019-01-14 19:23:32 UTC
Created attachment 201138 [details]
Patch to split x11/libfm

Fix build issue.
Comment 10 Alexandre C. Guimarães freebsd_committer freebsd_triage 2019-01-14 20:14:30 UTC
Olivier,

Could test libfm with sysutils/bsdisks instead of disabling udisks support?

Pcmanfm run well for me without segfaulting.

Thanks!
Comment 11 Olivier Duchateau 2019-01-14 20:59:33 UTC
(In reply to Alexandre C. Guimarães from comment #10)
 
You can remove udisks configure option.
Comment 12 Walter Schwarzenfeld freebsd_triage 2019-01-15 01:00:24 UTC
I don't understand which sense this make. On the one side flavor for pcmanfm and on the other side  
split of libfm (??).
Comment 13 Alexandre C. Guimarães freebsd_committer freebsd_triage 2019-01-15 02:26:47 UTC
(In reply to w.schwarzenfeld from comment #12)

FLAVORs are usually just accepted for versions gtk2-gtk3 and similar situations. The `core` is supposedly to be a SLAVEPORT like it was a sub-package; however I am still waiting to hear from portsmgr.

The difference is conceptual.
Comment 14 Olivier Duchateau 2019-01-15 05:36:16 UTC
(In reply to w.schwarzenfeld from comment #12)

Split of libfm is for Qt related ports. As poudriere can't create subpackage (or I don't know how to fix this error), I decided to create slave port for GTK flavors.

When flavors were committed, I asked mat@ why Qt ports are linked to Gtk2 (and why not Gtk3). He says me, it was for historical reason. I understand, but now flavors are present, we can split libfm, and let end users decided which flavor they want to use.
Comment 15 Olivier Duchateau 2019-01-15 05:41:31 UTC
To rigoletto@, in review the patch is buggy. Use rather the last one, with new port x11/libfm-gtk.
Comment 16 Jesper Schmitz Mouridsen freebsd_committer freebsd_triage 2019-01-20 20:04:13 UTC
Created attachment 201296 [details]
Bump qt portrevisions since it changed meanwhile

no functional changes from 201138
Comment 17 Jesper Schmitz Mouridsen freebsd_committer freebsd_triage 2019-01-20 22:39:36 UTC
Created attachment 201299 [details]
added missing libfm-gtk part

I forgot to svn add libfm-gtk before svn diff. So another attachment was required.

I am building the dependencies of libfm in poudriere now.
I'll give feedback as maintainer when it is done.
Comment 18 Alexandre C. Guimarães freebsd_committer freebsd_triage 2019-01-20 22:55:11 UTC
(In reply to Jesper Schmitz Mouridsen from comment #17)
There are a few pkg-plist issues on libfm/libfm-gtk to be fixed. I will do them today.

Also, did you got the patch from the phab? In there libfm-gtk comes from a `svn cp` from libfm. If not, no problem, since I will be working on it today.

Thanks!
Comment 19 Jesper Schmitz Mouridsen freebsd_committer freebsd_triage 2019-01-21 16:17:38 UTC
  (In reply to Alexandre C. Guimarães from comment #18)
Yeah I noted the pkg-plist problems. I did not use the phab diff, I took attachment #201138 [details], and changed the portrevisions for qt ports.
Comment 20 Alexandre C. Guimarães freebsd_committer freebsd_triage 2019-01-22 19:59:58 UTC
Created attachment 201341 [details]
Everything is building now.
Comment 21 Jesper Schmitz Mouridsen freebsd_committer freebsd_triage 2019-01-23 16:11:28 UTC
(In reply to Alexandre C. Guimarães from comment #20)
I cannot apply the patch against a clean ports r491044
libmfm-gtk is not in the tree.
I used svn cp x11/libfm x11/libfm-gtk first and then applied the patch succesfully.

I that the correct procedure?
Comment 22 Alexandre C. Guimarães freebsd_committer freebsd_triage 2019-01-23 16:50:11 UTC
Created attachment 201364 [details]
This should apply.

Hi.

I've just attached another patch. Identical to the previous one but created with `svn diff --show-copies-as-adds`. This should apply correctly. ^^

Thanks!
Comment 23 Alexandre C. Guimarães freebsd_committer freebsd_triage 2019-01-24 14:40:25 UTC
So, we can use `core` as a FLAVOR. I will revert to it and stuff.

Thanks! :-)
Comment 24 Jesper Schmitz Mouridsen freebsd_committer freebsd_triage 2019-01-27 19:29:18 UTC
(In reply to Alexandre C. Guimarães from comment #23)
Perhaps libfm core is perhaps very soon to be obsolete since 
https://github.com/lxqt/libfm-qt/blob/781bbe3da673b3e9d5a141163b64959234e211b1/CHANGELOG#L4 (Released as 0.14 2019-01-25) 
I could not find any qt ports dependent on libfm not through libfm-qt..
https://www.freshports.org/search.php?stype=depends_all&method=match&query=libfm 
lxqt-panel builds without menu-cache, 
since https://github.com/lxqt/lxqt-panel/commit/d7a441cc7150b73adae1cf69114f5d8e3ac87a15#diff-af3b638bc2a3e6c650974192a53c7291R7

I'm planning to start upgrading the LXQt ports to 0.14 in the comming days.

BTW the pcmanfm@gtk2 and pcmanfm@gtk3 runs fine build from  
attachment #201341 [details] (I have not tested attachment #201364 [details])
Comment 25 Alexandre C. Guimarães freebsd_committer freebsd_triage 2019-01-28 20:57:39 UTC
Might be better to wait the LXQt updates to know better what to do then.

Thanks.
Comment 26 Alexandre C. Guimarães freebsd_committer freebsd_triage 2019-03-28 20:57:12 UTC
Do pcmanfm-gtk2/gtk3 still segfault for you? I never managed to reproduce in here.
Comment 27 Walter Schwarzenfeld freebsd_triage 2019-03-28 23:22:35 UTC
The patch is needed. libfm does not compile without it and libfm-gtk does not install.
Comment 28 Alexandre C. Guimarães freebsd_committer freebsd_triage 2019-03-29 01:38:49 UTC
Hello.

We have pcmanfm@gtk2 (pcmanfm), pcmanfm@gtk3 (pcmanfm-gtk3), libfm@gtk2 (libfm), libfm@gtk3 (libfm-gtk3), and libfm-extra. All of them are building (poudriere), installing, and running fine in here, and I have no segfault or anything.

The -qt versions are now completely unrelated.

Can you provide some specific steps to reproduce?

Thank you.
Comment 29 Walter Schwarzenfeld freebsd_triage 2019-03-29 03:08:57 UTC
Sorry, it is complete chaotic in the moment trying install pcmanfm (with patch):

/x11-fm/pcmanfm]$ sudo make FLAVOR=gtk3
===>   pcmanfm-gtk3-1.3.1_1 depends on executable: update-desktop-database - found
===>   pcmanfm-gtk3-1.3.1_1 depends on executable: gmake - found
===>   pcmanfm-gtk3-1.3.1_1 depends on file: /usr/local/bin/intltool-extract - found
===>   pcmanfm-gtk3-1.3.1_1 depends on executable: msgfmt - found
===>   pcmanfm-gtk3-1.3.1_1 depends on package: pkgconf>=1.3.0_1 - found
===>   pcmanfm-gtk3-1.3.1_1 depends on file: /usr/local/libdata/pkgconfig/x11.pc - found
===>   pcmanfm-gtk3-1.3.1_1 depends on shared library: libfontconfig.so - found (/usr/local/lib/libfontconfig.so)
===>   pcmanfm-gtk3-1.3.1_1 depends on shared library: libfreetype.so - found (/usr/local/lib/libfreetype.so)
===>   pcmanfm-gtk3-1.3.1_1 depends on shared library: libfm.so - not found
===>   pcmanfm-gtk3-1.3.1_1 depends on shared library: libfm.so - not found
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/x11-fm/pcmanfm
*** Error code 1

-----
 sudo make FLAVOR=gtk2
===>   pcmanfm-1.3.1_1 depends on executable: update-desktop-database - found
===>   pcmanfm-1.3.1_1 depends on executable: gmake - found
===>   pcmanfm-1.3.1_1 depends on file: /usr/local/bin/intltool-extract - found
===>   pcmanfm-1.3.1_1 depends on executable: msgfmt - found
===>   pcmanfm-1.3.1_1 depends on package: pkgconf>=1.3.0_1 - found
===>   pcmanfm-1.3.1_1 depends on file: /usr/local/libdata/pkgconfig/x11.pc - found
===>   pcmanfm-1.3.1_1 depends on shared library: libfontconfig.so - found (/usr/local/lib/libfontconfig.so)
===>   pcmanfm-1.3.1_1 depends on shared library: libfreetype.so - found (/usr/local/lib/libfreetype.so)
===>   pcmanfm-1.3.1_1 depends on shared library: libfm.so - not found
===>   pcmanfm-1.3.1_1 depends on shared library: libfm.so - not found
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/x11-fm/pcmanfm
*** Error code 1
---

udo make 
===>   pcmanfm-1.3.1_1 depends on executable: update-desktop-database - found
===>   pcmanfm-1.3.1_1 depends on executable: gmake - found
===>   pcmanfm-1.3.1_1 depends on file: /usr/local/bin/intltool-extract - found
===>   pcmanfm-1.3.1_1 depends on executable: msgfmt - found
===>   pcmanfm-1.3.1_1 depends on package: pkgconf>=1.3.0_1 - found
===>   pcmanfm-1.3.1_1 depends on file: /usr/local/libdata/pkgconfig/x11.pc - found
===>   pcmanfm-1.3.1_1 depends on shared library: libfontconfig.so - found (/usr/local/lib/libfontconfig.so)
===>   pcmanfm-1.3.1_1 depends on shared library: libfreetype.so - found (/usr/local/lib/libfreetype.so)
===>   pcmanfm-1.3.1_1 depends on shared library: libfm.so - not found
===>   pcmanfm-1.3.1_1 depends on shared library: libfm.so - not found
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/x11-fm/pcmanfm
*** Error code 1
Comment 30 Walter Schwarzenfeld freebsd_triage 2019-03-29 03:19:38 UTC
Trying to install first libfm. Then pcmanfm

http://wiki.lxde.org/en/PCManFM
pcmanfm-1.3.1_1: "/usr/ports/x11/libfm-gtk" non-existent -- dependency list incomplete
===>  Cleaning for pcmanfm-1.3.1_1
ngorx@newgorx:/usr/ports/x11-fm/pcmanfm % pcmanfm 
Segmentation fault

It is in the moment impossible to install pcmanfm.
Comment 31 Alexandre C. Guimarães freebsd_committer freebsd_triage 2019-03-29 03:35:57 UTC
(In reply to w.schwarzenfeld from comment #29)

Revert the patch and test/use the version in the ports tree (with any change).

(In reply to w.schwarzenfeld from comment #30)

x11/libfm-gtk doesn't exist (and never existed) in the official tree.

It seems your ports tree is pretty messed. :-)
Comment 32 Walter Schwarzenfeld freebsd_triage 2019-03-29 03:46:22 UTC
Caused by the patch, look in it:

--- x11/libfm-gtk/Makefile	(nonexistent)
+++ x11/libfm-gtk/Makefile	(working copy)
@@ -0,0 +1,34 @@ 
+# Created by: Olivier Duchateau
+# $FreeBSD$
+
+PORTNAME=	libfm
+PKGNAMESUFFIX=	-gtk
+
+FLAVORS=	gtk2 gtk3
+FLAVOR?=	${FLAVORS:[1]}
+
+.if ${FLAVOR:U} == gtk2
+COMMENT=	LibFM library with GTK+ 2 support
+
+PLIST_SUB=	GTKVERSION=gtk
+.elif ${FLAVOR:U} == gtk3
+COMMENT=	LibFM libra
.....
Comment 33 Alexandre C. Guimarães freebsd_committer freebsd_triage 2019-03-29 03:49:01 UTC
If you are installing ports using `make` you will get plenty of misaligned libraries due to ABI mismatch because `make` does not take care of that, and so you will need to find out what have ABI mismatch and fix them manually.

You probably have many already, not all of them will make the port fail to build or run but give others less visible problems.

I suggest using poudriere or synth, or at very least portmaster with the -R (or -r - I don't remember) option to rebuild the whole port dependency tree.
Comment 34 Alexandre C. Guimarães freebsd_committer freebsd_triage 2019-03-29 03:49:36 UTC
(In reply to w.schwarzenfeld from comment #32)

That patch was never comitted to the tree.
Comment 35 Walter Schwarzenfeld freebsd_triage 2019-03-29 04:21:39 UTC
(In reply to Alexandre C. Guimarães from comment #33)
No! Till now NONE problem with the ports-tree.  It's only the libfm port.