Ticket #3634 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Gajim-svn Segfaulting (not sqlite)

Reported by: mokrates Owned by: steve-e
Priority: high Milestone: 0.12
Component: None Version: hg
Severity: critical Keywords: segfault
Cc: steve-e, bronger@… Blocked By:
OS: Unix Blocking:

Description

Working after the description on

 http://trac.gajim.org/wiki/ReportingSegfault

I got the following lines around the segfault:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7db28c0 (LWP 9013)]
0xb584f03e in ?? () from /usr/lib/python2.4/site-packages/_xmlplus/parsers/pyexpat.so
(gdb)

That happens just after i type in my passphrase for the gpg key associated with one account.

Thanks.

Attachments

stanza.xml.gz (303 bytes) - added by mokrates 2 years ago.
the error producing stanza

Change History

Changed 2 years ago by anonymous

I removed the debian "python-xml" package, on in which the segfaulting code is located, and on which gajim-svn doesn't depend (funny, i think).

now i get the following:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7dd78c0 (LWP 16170)]
normal_updatePosition (enc=0xb58d6d00, ptr=0x934d000 <Address 0x934d000 out of bounds>,
    end=0x90c09d5 "<iq from='mokrates.de' to='mokrates@mokrates.de/mokbox-gajim' id='66' type='result'><query xmlns='http://jabber.org/protocol/disco#info'><identity category='server' type='im' name='ejabberd'/><feature"..., pos=0x8f0f450)
    at /home/packages/python/2.4/python2.4-2.4.4/Modules/expat/xmltok_impl.c:1745
1745    /home/packages/python/2.4/python2.4-2.4.4/Modules/expat/xmltok_impl.c: No such file or directory.
        in /home/packages/python/2.4/python2.4-2.4.4/Modules/expat/xmltok_impl.c

, again, when i type in my gpg passphrase

Changed 2 years ago by mokrates

The 2 examples from above are with python 2.4.4 from debian/lenny. Python 2.5.1 produces the following:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7d388c0 (LWP 20147)]
0xb5c921d1 in ?? () from /usr/lib/python2.5/lib-dynload/pyexpat.so

Greetz

Changed 2 years ago by steve-e

  • cc steve-e added

Changed 2 years ago by mokrates

I added the stanza, that was visible in the first amended error message, as an attachment.

You could perhaps try and create an account on mokrates.de. It seems to be a problem with the server.

Greetz

Changed 2 years ago by mokrates

the error producing stanza

Changed 2 years ago by steve-e

<iq from='proxy.jabber.nstx.mokrates.de' to='myTest@mokrates.de/Gajim' xml:lang='de' type='result' id='26'>
<query xmlns='http://jabber.org/protocol/bytestreams'>
<streamhost jid='proxy.jabber.nstx.mokrates.de' host='127.0.0.1' port='7777'/>
</query>
</iq>

Looks like your server is not configured correctly. But I still don't know how your segfaults can occur.

Changed 2 years ago by geekounet

Same segfault here. It only happens when GPG is activated for my account, and my server is jaim.at

Changed 2 years ago by steve-e

Are you two using a GPG-agent? If yes, which one and which version?

Can you please run strace on ./launch.sh?

Changed 2 years ago by mokrates

No, i'm not using the gpg-agent, and "locate launch.sh" yields nothing an my machine.

Changed 2 years ago by mokrates

So. I hope, the configuration on mokrates.de is correct now.

Changed 2 years ago by steve-e

Sorry mokrates. I assumed you are running directly svn version. (it's started with launch.sh). Try to run strace on the gajim-svn binary/startscript.

Changed 2 years ago by steve-e

Please come to gajim@…. We could not reproduce this behavior and need your help debugging it.

Contact Asterix or me. Thanks.

Changed 2 years ago by mokrates

I don't think that the strace helps more that the gdb information above.

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb68e9000
_llseek(31, 0, [0], SEEK_CUR)           = 0
read(31, "<vCard xmlns=\"vcard-temp\"><PHOTO"..., 28672) = 28672
read(31, "lhXT4ZaLHRu7DIEveP6RmF0Nydd/ZYDW"..., 4096) = 985
read(31, "", 4096)                      = 0
close(31)                               = 0
munmap(0xb68e9000, 4096)                = 0
fstat64(20, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
fcntl64(20, F_GETFL)                    = 0x802 (flags O_RDWR|O_NONBLOCK)
gettimeofday({1198427542, 633123}, NULL) = 0
gettimeofday({1198427542, 636691}, NULL) = 0
gettimeofday({1198427542, 647886}, NULL) = 0
writev(16, [{"l\1\0\1\0\0\0\0X\0\0\0r\0\0\0\1\1o\0\25\0\0\0/org/fre"..., 136}, {"", 0}], 2) = 136
gettimeofday({1198427542, 649708}, NULL) = 0
poll([{fd=16, events=POLLIN, revents=POLLIN}], 1, 25000) = 1
read(16, "l\2\1\1\256\0\0\0(\0\0\0=\0\0\0\6\1s\0\5\0\0\0:1.62\0\0"..., 2048) = 254
read(16, 0x92461f8, 2048)               = -1 EAGAIN (Resource temporarily unavailable)
writev(16, [{"l\4\1\1(\0\0\0Y\0\0\0p\0\0\0\1\1o\0\34\0\0\0/org/gaj"..., 128}, {"$\0\0\0\1s\0\0\6\0\0\0online\0\1s\0\0\0\v\0\0\0mokr"..., 40}], 2) = 168
fstat64(20, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
fcntl64(20, F_GETFL)                    = 0x802 (flags O_RDWR|O_NONBLOCK)
fstat64(20, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
fcntl64(20, F_GETFL)                    = 0x802 (flags O_RDWR|O_NONBLOCK)
fstat64(20, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
fcntl64(20, F_GETFL)                    = 0x802 (flags O_RDWR|O_NONBLOCK)
fstat64(20, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
fcntl64(20, F_GETFL)                    = 0x802 (flags O_RDWR|O_NONBLOCK)
fstat64(20, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
fcntl64(20, F_GETFL)                    = 0x802 (flags O_RDWR|O_NONBLOCK)
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Process 31196 detached

That enough?

I observed something: If I detach the gpg-key from my mokrates.de account, i can login, and i can reattach the key afterwards without having gajim segfault. It seems only to happen with attached key on startup.

Changed 2 years ago by steve-e

  • status changed from new to assigned
  • owner changed from asterix to steve-e

Below you can see what we do shortly after canceling the passphrase dialog. This is working for me, but segfaulting for mokrates.

DEBUG: socket       sent  <presence id="7">
  <priority>50</priority>
  <x xmlns="vcard-temp:x:update" />
  <c xmlns="http://jabber.org/protocol/caps" node="http://gajim.org/caps" ext="cstates" ver="0.11.4.0" />
  </presence>
DEBUG: socket       sent  <iq type="get" id="8">
  <vCard xmlns="vcard-temp" />
  </iq>
DEBUG: socket       sent  <iq type="get" id="9">
  <query xmlns="jabber:iq:private">
  <storage xmlns="storage:bookmarks" />
  </query>
  </iq>
DEBUG: socket       sent  <iq type="get" id="10">
  <query xmlns="jabber:iq:private">
  <storage xmlns="storage:rosternotes" />
  </query>
  </iq>
DEBUG: socket       sent  <iq to="mokrates.de" type="get" id="p11">
  <query xmlns="http://jabber.org/protocol/disco#items" />
  </iq>
DEBUG: socket       sent  <iq to="mokrates.de" type="get" id="p12">
  <query xmlns="http://jabber.org/protocol/disco#info" />
  </iq>
DEBUG: socket       sent  <iq to="proxy.jabber.org" type="get" id="13">
  <query xmlns="http://jabber.org/protocol/bytestreams" />
  </iq>
DEBUG: socket       sent  <iq to="proxy.netlab.cz" type="get" id="14">
  <query xmlns="http://jabber.org/protocol/bytestreams" />
  </iq>
DEBUG: socket       sent  <iq to="transfer.jabber.freenet.de" type="get" id="15">
  <query xmlns="http://jabber.org/protocol/bytestreams" />
  </iq>
DEBUG: socket       sent  <iq to="proxy.jabber.cd.chalmers.se" type="get" id="16">
  <query xmlns="http://jabber.org/protocol/bytestreams" />
  </iq>

Changed 2 years ago by mokrates

So. I installed a new clean debian and gajim-svn on a qemu-image and reproduced the error. I will soon make the image available to you. (Hope you have 900MB free on your disks :) )

Greetings

Changed 2 years ago by Jim++

Changed 2 years ago by asterix

I tried with a fresh debian unstable, gajim svn, 2 accounts with autoconnect with 2 different keys, no gpg-agent, I can press cancel in a GPG passphrase window, it connects, then cancel in the second, it connects. Non segfault. Really strange.

Changed 2 years ago by anonymous

I guess a new GPG version is the problem. New GPG versions use pinentry (-> X11/curses) to get the user's passphrase. (I had no problems before updating to the latest GPG version)

Changed 2 years ago by anonymous

PS. Manually setting

use_gpg_agent = True

in the config solved the problem for me.

Changed 2 years ago by anonymous

PPs. (sorry this will definitely be the last one)

Background: When "use_gpg_agent" is active gajim doesn't try to ask me for a passphrase. GPG recognizes that gpg-agent is not running and asks me for my passphrase via pinentry-gtk.

Changed 2 years ago by steve-e

GnuPG-2 has a different architecture than GnuPG-1 (e.g. 1.4.8) in that
it splits up functionality into several modules.  However, both
versions may be installed alongside without any conflict.  In fact,
the gpg version from GnuPG-1 is able to make use of the gpg-agent as
included in GnuPG-2 and allows for seamless passphrase caching.  The
advantage of GnuPG-1 is its smaller size and the lack of dependency on
other modules at run and build time.  We will keep maintaining GnuPG-1
versions because they are very useful for small systems and for server
based applications requiring only OpenPGP support.

I don't know whether it is a good idea to depend on GPG 2.X. Though we could remove the whole internal USE_AGENT handling.

Changed 2 years ago by asterix

use_gpg_agent has a GUI option in svn version of Gajim, just after the choode GPG key things in account modification window. Doesn't this GUI option work for you?

Now when it's disabled, to prevent segfault, I see 2 options:

  • detect GPG version and if it's v2, do as if gpg_agent was True (we can even detevt GPG version at startup and hide use gpg agent option and set it to True)
  • find a command line option to disable GPGv2 module that ask passphrase to have the same behaviour og GPGv1

Changed 2 years ago by Jim++

It doesn't seems it is related to version of gpg. I'm using gpg (GnuPG) 1.4.6.

More, #3635 is a duplicate of this one. Way to reproduce :

15:16:26 bronger: As I said above, the following ingrediences are necessary to reproduce it: use_transports_iconset to "False", use of at least one transport, a GPG key attached to the account, and an SVN Gajim newer or equal to [fd857724a9111593dab9bdd53c29676298dab1c7].

Changed 2 years ago by bronger

  • cc bronger@… added

Changed 2 years ago by Jim++

I think this could be a problem about the gpg dialog that must be modal but is not; so gajim is doing things that shouldn't be done (disco gateways, deal with icons) until we answered to it.

Changed 2 years ago by jim++

  • status changed from assigned to closed
  • resolution set to fixed
  • milestone set to 0.12

(In [ed4454769e916823d1050036402a85e720723efc]) Don't process roster during gpg_passphrase dialog is showed. Fixes #3634, hopefully... :p Please test

Changed 2 years ago by bronger

Works for me now.

Add/Change #3634 (Gajim-svn Segfaulting (not sqlite))

Author


E-mail address and user name can be saved in the Preferences.


Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
Next status will be 'needinfo'
 
Note: See TracTickets for help on using tickets.