Project

Profile

Help

Issue #2067

closed

non-ascii message to gofer segfaults httpd

Added by mhrivnak over 7 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.6.5
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

From an excellent bug report on bugzilla:

If goferd puts to task output a string with non-ASCII characters, wsgi:pulp script segfaults trying to call "str" method on it.

Trying to restart it fails the same way, since the wsgi script fetches the same message from pulp.task qpid queue at early beginning.

This causes wsgi script and in fact pulp tasks at all completely unuseable - until one forcefully removes the message from pulp.task queue.

Version-Release number of selected component (if applicable):
python-gofer-2.6.8-1.el7sat.noarch

How reproducible:
100%

Steps to Reproduce:
1. Have a client with French locale.
2. Fill its disk such that installing a bigger package would fail.
3. Try to install a package via Satellite.
4. Check if wsgi:pulp process is running
5. restart httpd to recover

Actual results:
4. the script segfaulted:

Jul  7 14:30:39 pmoravec-sat61-rhel7 kernel: httpd[19377]: segfault at 10 ip 00007f24db9d70ef sp 00007f24cc9ed440 error 4 in libpython2.7.so.1.0[7f24db976000+179000]

5. httpd restart wont help - segfault would happen just after it, again

Expected results:
No segfault.

Additional info:
(*) backtrace:

(gdb) bt
#0  0x00007f24db9d70ef in UnicodeEncodeError_str (
    self=exceptions.UnicodeEncodeError('ascii', u'Erreurs de la transaction de test\xa0:   installing package kernel-2.6.32-573.22.1.el6.x86_64 needs 5MB on the /boot filesystem\n', 33, 34, 'ordinal not in range(128)'))
    at /usr/src/debug/Python-2.7.5/Objects/exceptions.c:1660
#1  0x00007f24db9fb61a in _PyObject_Str (
    v=exceptions.UnicodeEncodeError('ascii', u'Erreurs de la transaction de test\xa0:   installing package kernel-2.6.32-573.22.1.el6.x86_64 needs 5MB on the /boot filesystem\n', 33, 34, 'ordinal not in range(128)')) at /usr/src/debug/Python-2.7.5/Objects/object.c:430
#2  0x00007f24db9fb6ea in PyObject_Str (v=<optimized out>) at /usr/src/debug/Python-2.7.5/Objects/object.c:451
#3  0x00007f24dba0e720 in string_new (type=0x7f24dbd0aae0 <PyString_Type>, args=<optimized out>, kwds=<optimized out>)
    at /usr/src/debug/Python-2.7.5/Objects/stringobject.c:3707
#4  0x00007f24dba15e53 in type_call (type=0x7f24dbd0aae0 <PyString_Type>, 
    args=(exceptions.UnicodeEncodeError('ascii', u'Erreurs de la transaction de test\xa0:   installing package kernel-2.6.32-573.22.1.el6.x86_64 needs 5MB on the /boot filesystem\n', 33, 34, 'ordinal not in range(128)'),), kwds=0x0)
    at /usr/src/debug/Python-2.7.5/Objects/typeobject.c:729
#5  0x00007f24db9c00c3 in PyObject_Call (func=func@entry=<type at remote 0x7f24dbd0aae0>, 
    arg=arg@entry=(exceptions.UnicodeEncodeError('ascii', u'Erreurs de la transaction de test\xa0:   installing package kernel-2.6.32-573.22.1.el6.x86_64 needs 5MB on the /boot filesystem\n', 33, 34, 'ordinal not in range(128)'),), kw=kw@entry=0x0)
    at /usr/src/debug/Python-2.7.5/Objects/abstract.c:2529
#6  0x00007f24dba5438c in do_call (nk=<optimized out>, na=1, pp_stack=0x7f24cc9ed690, func=<type at remote 0x7f24dbd0aae0>)
    at /usr/src/debug/Python-2.7.5/Python/ceval.c:4316
#7  call_function (oparg=<optimized out>, pp_stack=0x7f24cc9ed690) at /usr/src/debug/Python-2.7.5/Python/ceval.c:4121
#8  PyEval_EvalFrameEx (
    f=f@entry=Frame 0x7f24c000cb00, for file /usr/lib/python2.7/site-packages/gofer/rmi/async.py, line 240, in __str__ (self=<Failed(origin=None, exval=exceptions.UnicodeEncodeError('ascii', u'Erreurs de la transaction de test\xa0:   installing package

(*) failing line of code:

/usr/lib/python2.7/site-packages/gofer/rmi/async.py:240
s.append('  exval: %s' % str(self.exval))

self.exval containing nonASCII character cant be converted to str..

(*) For developers: trivial reproducer is to have jrnl file of pulp.task queue with such nonASCII message in it. Then the reproducer is:

service qpidd stop

cp 61c0eb3e-daad-4894-a9b9-2277df73d5fa.jrnl /var/lib/qpidd/.qpidd/qls/jrnl/pulp.task/*

service qpidd start

service httpd restart
Actions #1

Updated by mhrivnak over 7 years ago

  • Version changed from 2.8.5 to 2.6.5

Just on looks alone, this might already be fixed in gofer 2.8. See the code here calling unicode(), where it used to call str() in the version that was seen to fail:

https://github.com/jortel/gofer/blob/gofer-2.8/src/gofer/rmi/async.py#L246

Actions #2

Updated by mhrivnak over 7 years ago

Based on investigation from @jortel, this was fixed in gofer 2.7.

Actions #3

Updated by dkliban@redhat.com over 7 years ago

  • Status changed from NEW to CLOSED - CURRENTRELEASE
  • Triaged changed from No to Yes
Actions #4

Updated by bmbouter almost 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF