By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.

Bug 2477

Summary: tde session won't run if kgtk-qt3-trinity is installed
Product: TDE Reporter: Felix Miata <mrmazda>
Component: qt3Assignee: Michele Calgaro <michele.calgaro>
Status: RESOLVED FIXED    
Severity: normal CC: bugwatch, michele.calgaro, slavek.banko
Priority: P5    
Version: R14.0.x [Trinity]   
Hardware: amd64   
OS: Linux   
Compiler Version: TDE Version String:
Application Version: Application Name:
Bug Depends on:    
Bug Blocks: 2696    
Attachments: list of trinity packages currently installed on multiboot jessie host gx780
.tgz of .xsession-errors, Xorg.0.log, dmesg & modified starttde
.xsession-errors + dmesg tail
.xsession-errors + Xorg.0.log for comment 5 response

Description Felix Miata 2015-07-12 17:20:30 CDT
Created attachment 2533 [details]
list of trinity packages currently installed on multiboot jessie host gx780

Removing kgtk-qt3-trinity-14.0.1~pre3-0debian8.0.0+0 solves the problem - TDE session works as expected without kgtk-qt3-trinity installed.

Tail of .xsession-errors following crash:
[starttde] XDG_DATA_DIRS: /opt/trinity/share:/usr/local/share:/usr/share
[starttde] TDEDIR: /opt/trinity
[starttde] TDEDIRS: 
Segmentation fault
[starttde] Starting Trinity...
[tdeinit] Pipe closed unexpectedly: No such file or directory
[tdeinit] DCOPServer could not be started, aborting.
[kcrash] TDECrash: Application 'kdetcompmgr' crashing...
[kcrash] Warning: socket connection failed: : Connection refused
[kcrash] TDECrash cannot reach tdeinit, launching directly.
[kcrash] TDECrash: Application 'tdeinit_displayconfig' crashing...
[kcrash] Warning: socket connection failed: : Connection refused
[kcrash] TDECrash cannot reach tdeinit, launching directly.
[kcrash] TDECrash: Application 'ksplash' crashing...
[kcrash] Warning: socket connection failed: : Connection refused
[kcrash] TDECrash cannot reach tdeinit, launching directly.
[starttde] TDE_FULL_SESSION: true
[starttde] TDE_SESSION_UID: 0
[tdeinit] Pipe closed unexpectedly: No such file or directory
[tdeinit] DCOPServer could not be started, aborting.
[starttde] tdeinit started successfully.
[kcrash] TDECrash: Application 'tdeinit_phase1' crashing...
[kcrash] Warning: socket connection failed: : Connection refused
[kcrash] TDECrash cannot reach tdeinit, launching directly.
ERROR: Couldn't attach to DCOP server!
[starttde] Shutting down Trinity...
[tdeinit wrapper] Warning: socket connection failed: : Connection refused
[tdeinit wrapper] Error: Can't contact tdeinit!
[starttde] Running Trinity shutdown scripts...
[starttde] Trinity shutdown complete.
Comment 1 Michele Calgaro 2016-02-07 07:21:39 CST
Hi Felix, is the problem still happening?
I can not reproduce the problem on my Jessie VM (TDE runs fine both with and without kgtk-qt3-trinity installed).
Your .xsession-errors file gives some clues. Can you edit the file /opt/trinity/bin/starttde and add some echo commands between the lines:
1) echo "[starttde] TDEDIRS: $TDEDIRS" 1>&2 (approx line 550)
2) echo "[starttde] Starting Trinity..."  (approx line 640)
The more echos you put the better. Ideally one every important section.
Just echo progressive numbers, something like "Felix 1, Felix 2" and so on.
Then test again until you repeat the crash.
After the crash please post both the starttde file and the .xsessions-errors file. 
NOTE: before posting, please make sure you can see some of your echos command in ./xsession-errors
Comment 2 Felix Miata 2016-02-08 02:52:29 CST
Created attachment 2624 [details]
.tgz of .xsession-errors, Xorg.0.log, dmesg & modified starttde

AFAICT, everything worked well enough until I reinstalled kgtk-qt3-trinity in order to respond here. I was seeing (and still see) segfaults at boot (and in dmesg), but they posed/pose no apparent problem with TDE. Uninstalling kgtk-qt3-trinity reenabled access to TDE.
Comment 3 Michele Calgaro 2016-02-08 06:21:39 CST
Hi Felix, 
thanks for the feedback. Your Xorg log file shows an error loading a dl driver (line 288)

[    69.577] (EE) AIGLX error: dlopen of /usr/lib/x86_64-linux-gnu/dri/i965_dri.so failed (/usr/lib/x86_64-linux-gnu/dri/i965_dri.so: cannot open shared object file: No such file or directory)

This is probably only triggered when kgtk-qt3-trinity is installed. I googled a little bit and the problem seems to be a known one. Basically the required file is not in the expected location and so the call to dlopen fails.

Can you search your system for this file "i965_dri.so"? If you find it, try to copy it to the required /usr/lib/x86_64-linux-gnu/dri folder.
If you can not find it, you are probably missing this package "libgl1-mesa-dri".
If so, try to install and see what happen. Maybe kgtk-qt3-trinity needs an additional dependency.
Comment 4 Felix Miata 2016-02-08 15:02:11 CST
Created attachment 2625 [details]
.xsession-errors + dmesg tail

# aptitude search mesa-dri
p   libegl1-mesa-drivers            - free implementation of the EGL API -- har
p   libegl1-mesa-drivers-dbg        - free implementation of the EGL API -- dri
p   libgl1-mesa-dri                 - free implementation of the OpenGL API --
p   libgl1-mesa-dri-dbg             - Debugging symbols for the Mesa DRI module
v   libgl1-mesa-dri-dev             -
# aptitude install libgl1-mesa-dri kgtk-qt3-trinity
The following NEW packages will be installed:
  kgtk-qt3-trinity libgl1-mesa-dri
The following packages are RECOMMENDED but will NOT be installed:
  libtxc-dxtn-s2tc0 libtxc-dxtn0
0 packages upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
Need to get 3,384 kB/3,450 kB of archives. After unpacking 14.1 MB will be used.
Get: 1 http://mirrors.us.kernel.org/debian/ jessie/main libgl1-mesa-dri amd64 10.3.2-1+deb8u1 [3,384 kB]
Fetched 3,384 kB in 4s (685 kB/s)
Selecting previously unselected package libgl1-mesa-dri:amd64.
(Reading database ... 73572 files and directories currently installed.)
Preparing to unpack .../libgl1-mesa-dri_10.3.2-1+deb8u1_amd64.deb ...
Unpacking libgl1-mesa-dri:amd64 (10.3.2-1+deb8u1) ...
Selecting previously unselected package kgtk-qt3-trinity.
Preparing to unpack .../kgtk-qt3-trinity_4%3a14.0.2-0debian8.0.0+0_amd64.deb ...
Unpacking kgtk-qt3-trinity (4:14.0.2-0debian8.0.0+0) ...
Setting up libgl1-mesa-dri:amd64 (10.3.2-1+deb8u1) ...
Setting up kgtk-qt3-trinity (4:14.0.2-0debian8.0.0+0) ...

# reboot
# startx

Problem remains. Maybe fixing whatever puts those call traces in dmesg would solve the problem, but I don't know how to find out what's causing them.
Comment 5 Michele Calgaro 2016-02-11 08:04:24 CST
Hi Felix,
the warning in dmes are not TDE related. Googling "i915/intel_display.c:10194", it appears that there was a bug in kernel 3.16.7 in the Intel drivers, so not much we can do about it.

Regarding the segmentation fault, there are 3 commands executed between calgaro2477-19 and calgaro2477-20 in starttde:

test -d "$sys_fdir" && xset fp+ "$sys_fdir"
xset fp rehash
xsetroot -cursor_name left_ptr

Can you add an echo after each of those lines and see which one is causing the segfault? That may give some more clues.
Please echo the value of $sys_fdir before the line 
test -d "$sys_fdir" && xset fp+ "$sys_fdir". Please also check whether the folder exists or not.
Comment 6 Felix Miata 2016-04-21 01:24:36 CDT
Happens in 14.0.3 too.
Comment 7 Michele Calgaro 2016-04-21 01:53:24 CDT
Felix, see comment 5. If you can help with that, maybe we can have further clues.
Comment 8 Felix Miata 2016-04-21 01:54:05 CDT
Created attachment 2650 [details]
.xsession-errors + Xorg.0.log for comment 5 response

(In reply to Michele Calgaro from comment #5)
> Regarding the segmentation fault, there are 3 commands executed between
> calgaro2477-19 and calgaro2477-20 in starttde:

> test -d "$sys_fdir" && xset fp+ "$sys_fdir"
> xset fp rehash
> xsetroot -cursor_name left_ptr
 
> Can you add an echo after each of those lines and see which one is causing
> the segfault? That may give some more clues.
> Please echo the value of $sys_fdir before the line 
> test -d "$sys_fdir" && xset fp+ "$sys_fdir". Please also check whether the
> folder exists or not.

/opt/trinity/share/fonts/ does not exist.
Comment 9 Felix Miata 2016-08-15 19:36:32 CDT
This was happening in minimal Stretch installation on host fi965, updated last in March, freshly updated to server 1.18.4 and kernel 4.6.4, with 14.0.4pre newly added, until removing kgtk-qt3-trinity. i965 is not relevant here, as I'm testing it with various combinations of AMD and/or NVidia gfxcards and it has no onboard video.
Comment 10 Michele Calgaro 2016-08-16 08:34:00 CDT
Hi Felix, thanks for the update, I actually had a look into this bug a few days ago but without better luck. 
So you are saying the bug is still there or that it is no longer there? I could not understand clearly from your last comment.
Comment 11 Felix Miata 2016-08-16 11:22:18 CDT
I installed Stretch on a spare HD last March. I put the extra disk in host fi965 Sunday. Then I updated Stretch. Then I installed TDE selectively, starting with tdebase, tdm and other packages I know either it or I require, plus some I suspect are needed on account of non-native apps like Gimp and SeaMonkey but are only suggested. That included kgtk-qt3-trinity, because it's clear as mud which non-required gtk|qt packages are desirable for good behavior from gtk apps in any minimalist non-Gnome qt*-based DE. From .bash_history:

# apt-key adv --keyserver keys.gnupg.net --recv-keys A04BE668
# apt-get update
# aptitude install tdebase-trinity tdm-trinity gtk-qt-engine-trinity gtk2-engines-gtk-qt-trinity kgtk-qt3-trinity gtk3-tqt-engine-trinity konsole-trinity kcalc-trinity kpdf-trinity ksnapshot-trinity arts-trinity gwenview-trinity kcontrol-trinity kcpuload-trinity kdpkg-trinity kicker-applets-trinity kmenuedit-trinity kmix-trinity konqueror-trinity kpackage-trinity kpager-trinity kruler-trinity ksensors-trinity ksmserver-trinity kwin-trinity smb4k-trinity tdeprint-trinity udisks2 cups-client rpm zip unzip tdemultimedia-tdeio-plugins-trinity dosfstools ntfs-3g 

Trying startx only gave me a baby-blue screen, exited back to the shell, and left a segfault message in .xsession-errors. Then I found this bug and removed kgtk-qt3-trinity. TDE has been working fine ever since.
Comment 12 Michele Calgaro 2016-08-17 11:31:51 CDT
OK, I will try to replicate the same setup on a VM and see what happens.
Thanks for the feedback one again.
Comment 13 Felix Miata 2017-08-16 03:44:48 CDT
Problem is not limited to Jessie. It happens in Stretch too, and with 14.0.5b.
Comment 14 Michele Calgaro 2018-05-01 06:16:29 CDT
Hi Felix,
I will look at this again in the coming weeks. I will setup a VM exactly as you proposed, in order to try to replicate the bug. Just to confirm:
- debian stretch netinstall, no DE
- then install selected TDE packages as per your list
Correct?

Are you able to replicate the bug in a VM too? or just on your hardware? I remember something related to your i965 card or something like that. I will need to review again.

Please let me know the current status.
Comment 15 Michele Calgaro 2018-06-09 09:23:34 CDT
Great news Felix. I can reproduce the problem in a VM with buster + the list of packages from TDE R14.0.5 that you have provided.
I will work on it (yes, I know two years have gone by from comment 12, sorry for that).
Comment 16 Michele Calgaro 2018-06-16 07:56:06 CDT
This is finally fixed in commit af8244e (R14.1) and f63092c (R14.0).
The problem was caused by the override of the dlsym function in kgtk2.so and its inhability to find the real dlsym function, which in turns was causing all sort of problems (including the segmentation fault of xsetroot when trying to set the mouse pointer).

Felix, if you are on the preliminary stable builds, please test as well once the updated package is available.
Comment 17 Felix Miata 2018-06-17 00:28:47 CDT
host p5bse:
Jessie: 14.0.4				fail
Ubuntu 16.04: 14.0.4		fail
Stretch: 14.0.5		success
Buster: 14.0.5		success
Comment 18 Michele Calgaro 2018-06-17 03:58:56 CDT
Thanks a lot, Felix. Sorry it took 3 years to fix the problem :-)