Motif library v4.0.4 causes segfault in legacy app

Bug #1472826 reported by Quang Ong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
motif (Ubuntu)
Incomplete
Undecided
Unassigned

Bug Description

Our group develops an X application that uses the Motif Library (package libxm4 v2.3.4-5). It appears that in the latest version of libXm.4.0.4 on Trusty (14.04), on certain types of X events, it causes a segfault. I've isolated this to a particular version of the library and OS rev. Our application works fine for OS older than 14.04, ie 12.04 etc. I also confirmed the version issue by copying libXm.4.0.3 from a 12.04 machine onto a 14.04 machine and it allows the program to work normally. I basically copied libXm.4.0.3 from a 12.04 machine to the 14.04 machine and created a symlink to it:
ln -s /usr/lib/x86_64-linux-gnu/libXm.4.0.3 /usr/lib/x86_64-linux-gnu/libXm.4.0.4

So, whatever has changed between 4.0.3 and 4.0.4 has broken some API calls. It's hard for us to debug this from the application side b/c it generates a segfault, which causes the application to crash.

Example of what causes the crash. When our application generates a child window which has text field widgets like a text field or textarea, typing into the field causes this crash.

Any ideas on why the new version would cause these crashes? Looking at the release notes (/usr/share/doc/libmotif-dev/RELNOTES.gz), I see there were a number of bug fixes. Is it possible one of these fixes caused another bug?
Thanks in advance.

Quang

Revision history for this message
Sebastien Bacher (seb128) wrote :

Could you get a backtrace of the issue using gdb?

no longer affects: unity
affects: unity (Ubuntu) → motif (Ubuntu)
Revision history for this message
Graham Inggs (ginggs) wrote :

Hi Quang

Thank you for reporting this.

This might be the same issue as LP: #1354961.

Please try this version from my PPA and report back:

https://launchpad.net/~ginggs/+archive/ubuntu/motif1565

Regards
Graham

Revision history for this message
Quang Ong (quang777) wrote :

Graham,
   thanks for the update. I'll give the fix a try and get back to you. I've only used gdb a couple of times. Are there instructions on how to use gdb to get a backtrace?

Q

Graham Inggs (ginggs)
Changed in motif (Ubuntu):
status: New → Incomplete
Revision history for this message
Quang Ong (quang777) wrote :

I added the PPA to my test system and tried to fetch the updated package:
1) apt-get update
2) apt-get install motif failed
3) apt-get install motif-2.3.4-8 failed
4) apt-get install libmotif3 => updated to Preparing to unpack .../libmotif3_2.3.4-5_amd64.deb but from Ubuntu repo
5) apt-get install libmotif4 => also updated from Ubuntu repo version .../libmotif4_2.3.4-5_amd64.deb

What's the name of the patched package?

Q

Revision history for this message
Graham Inggs (ginggs) wrote :

After adding the PPA, you should only have to do:
apt-get update
apt-get upgrade

The packages are named libxm4, libmrm4, libuil4, as they are named in the Ubuntu repository.

Revision history for this message
Quang Ong (quang777) wrote :

I after I added the PPA, I see it added a file in /etc/apt/sources.list:
deb-src http://ppa.launchpad.net/ginggs/motif1565/ubuntu trusty main

 however it doesn't see updated packages for motif. Do I need to tell it to override the version that's installed from Ubuntu?

apt-get update
apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  linux-generic linux-headers-generic linux-image-generic
The following packages will be upgraded:
  apparmor apport apport-gtk bash-completion bind9-host bsdutils dnsutils
  e2fslibs e2fsprogs firefox gir1.2-gdkpixbuf-2.0 google-chrome-beta gvfs
  gvfs-backends gvfs-bin gvfs-common gvfs-daemons gvfs-fuse gvfs-libs
  irqbalance libapparmor-perl libapparmor1 libbind9-90 libblkid1 libcomerr2
  libdns100 libexpat1 libfreetype6 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common
  libicu52 libisc95 libisccc90 libisccfg90 libldap-2.4-2 liblwres90 libmount1
  liboxideqt-qmlplugin liboxideqtcore0 liboxideqtquick0 libslp1 libsmbclient
  libsnmp-base libsnmp30 libspice-server1 libss2 libuuid1 libwbclient0
  linux-firmware linux-libc-dev mount onboard onboard-data openssh-client
  openssh-server openssh-sftp-server oxideqt-codecs python-samba
  python3-apport python3-problem-report samba-common samba-common-bin
  samba-libs smbclient ssh-askpass-gnome sudo thunderbird
  thunderbird-gnome-support tzdata unity-settings-daemon util-linux
  uuid-runtime xul-ext-ubufox
73 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Need to get 198 MB of archives.
After this operation, 9,118 kB of additional disk space will be used.

Revision history for this message
Graham Inggs (ginggs) wrote :

How did you add the PPA?

You should have the line as follows (i.e. without -src):

deb http://ppa.launchpad.net/ginggs/motif1565/ubuntu trusty main

You only need the deb-src line if you want to download the source packages as well.

Revision history for this message
Quang Ong (quang777) wrote :
Download full text (3.1 KiB)

Hmm, I ran
add-apt-repository ppa:ginggs/motif1565, which added this file:
/etc/apt/sources.list.d/ginggs-motif1565-trusty.list
with the following contents:
# deb-src http://ppa.launchpad.net/ginggs/motif1565/ubuntu trusty main

add-apt-repository ppa:ginggs/motif1565
 Motif built with upstream's fixes for bug #1565 [1] reverted.
Should behave as in Motif 2.3.3. and fix LP: #1354961 and LP: #1255473.

[1] http://bugs.motifzone.net/show_bug.cgi?id=1565
 More info: https://launchpad.net/~ginggs/+archive/ubuntu/motif1565
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmp3fjgg8my/secring.gpg' created
gpg: keyring `/tmp/tmp3fjgg8my/pubring.gpg' created
gpg: requesting key 08CC41D2 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp3fjgg8my/trustdb.gpg: trustdb created
gpg: key 08CC41D2: public key "Launchpad PPA for Graham Inggs" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK

Since I didn't see the updated packages, I uncommented the only line in
/etc/apt/sources.list.d/ginggs-motif1565-trusty.list

After re-running the steps again, this time it added to ginggs-motif1565-trusty.list:
deb http://ppa.launchpad.net/ginggs/motif1565/ubuntu trusty main

Looks like it worked this time:

 apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  libmotif-common libmotif-dev libmrm4 libuil4 libxm4 linux-generic
  linux-headers-generic linux-image-generic uil
The following packages will be upgraded:
  apparmor apport apport-gtk bash-completion bind9-host biosdevname bsdutils
  dnsutils e2fslibs e2fsprogs firefox gir1.2-gdkpixbuf-2.0 gir1.2-gudev-1.0
  google-chrome-beta gtk2-engines-pixbuf gvfs gvfs-backends gvfs-bin
  gvfs-common gvfs-daemons gvfs-fuse gvfs-libs irqbalance libapparmor-perl
  libapparmor1 libbind9-90 libblkid1 libcomerr2 libdns100 libexpat1
  libfreetype6 libgail-common libgail18 libgdk-pixbuf2.0-0
  libgdk-pixbuf2.0-common libgtk2.0-0 libgtk2.0-bin libgtk2.0-common
  libgudev-1.0-0 libicu52 libisc95 libisccc90 libisccfg90 libldap-2.4-2
  liblwres90 libmotif3 libmotif4 libmount1 liboxideqt-qmlplugin
  liboxideqtcore0 liboxideqtquick0 libpam-systemd libpython3.4
  libpython3.4-minimal libpython3.4-stdlib libslp1 libsmbclient libsnmp-base
  libsnmp30 libspice-server1 libss2 libsystemd-daemon0 libsystemd-journal0
  libsystemd-login0 libudev1 libufe-xidgetter0 libuuid1 libwbclient0
  linux-firmware linux-libc-dev lshw mount onboard onboard-data openssh-client
  openssh-server openssh-sftp-server oxideqt-codecs python-samba
  python3-apport python3-gdbm python3-problem-report python3.4
  python3.4-minimal samba-common samba-common-bin samba-libs smbclient
  ssh-askpass-gnome sudo systemd-services thunderbird
  thunderbird-gnome-support tzdata udev unity-settings-daemon util-linux
  uuid-runtime webaccounts-extension-common xul-ext-ubufox xul-ext-unity
  xul-ext-webaccounts xul-ext-websites-integration
103 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Need to get 207 MB of archives.

Will test out these "new/old" versions and report back. Than...

Read more...

Revision history for this message
Quang Ong (quang777) wrote :

I just realized that apt-get upgrade wasn't sufficient b/c it warns that the packages I need updated will be held back:
The following packages have been kept back:
  libmotif-common libmotif-dev libmrm4 libuil4 libxm4 linux-generic

I had to do:
apt-get dist-upgrade
The following packages will be upgraded:
  libmotif-common libmotif-dev libmrm4 libuil4 libxm4 linux-generic

After this, I do see the updated motif library (dated March-2015 vs 2013):
ls -l /usr/lib/x86_64-linux-gnu/libXm.so.4.0.4
-rw-r--r-- 1 root root 2837728 Mar 24 2015 /usr/lib/x86_64-linux-gnu/libXm.so.4.0.4

Using my test case, it no longer causes a segfault. I'll do some more testing but it looks like this fixed it.
Any chance this update will get pushed into the official Ubuntu updates?

Thanks!

Revision history for this message
Graham Inggs (ginggs) wrote :

> Using my test case, it no longer causes a segfault. I'll do some more testing
> but it looks like this fixed it.

Glad to hear it!

> Any chance this update will get pushed into the official Ubuntu updates?

Yes, I will start the SRU process.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.