Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 547519 - map of maps encoding broken (c++ agent, python console)
Summary: map of maps encoding broken (c++ agent, python console)
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-qmf
Version: Development
Hardware: All
OS: Linux
Target Milestone: 1.3
: ---
Assignee: Ted Ross
QA Contact: Jan Sarenik
: 553919 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2009-12-14 20:55 UTC by Matthew Farrellee
Modified: 2011-08-12 16:04 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed:
Target Upstream Version:

Attachments (Terms of Use)
standalone c++ qmf-agent tarball (deleted)
2010-04-14 10:19 UTC, Jan Sarenik
no flags Details
updated standalone c++ qmf-agent tarball (deleted)
2010-05-05 07:42 UTC, Jan Sarenik
no flags Details

Description Matthew Farrellee 2009-12-14 20:55:13 UTC
Description of problem:

C++ QMF agent is sending map of maps of maps, python console, e.g. qpid-tool, crashes.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:

>>> import logging
>>> from qmf.console import Session
>>> logging.getLogger().setLevel(logging.DEBUG)
>>> s=Session()
>>> b=s.addBroker()
No handlers could be found for logger ""
>>> js=s.getObjects(_class="jobserver")[0]
>>> js
>>> js.GetJobs('"matt@robin.local#8"')
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.6/", line 525, in __bootstrap_inner
  File "/usr/lib/python2.6/", line 477, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.6/site-packages/qpid/", line 84, in run
  File "/usr/lib/python2.6/site-packages/qmf/", line 1820, in _replyCb
    elif opcode == 'm': self.session._handleMethodResp      (self, codec, seq)
  File "/usr/lib/python2.6/site-packages/qmf/", line 836, in _handleMethodResp
    outArgs[] = self._decodeValue(codec, arg.type, broker)
  File "/usr/lib/python2.6/site-packages/qmf/", line 963, in _decodeValue
    code = sc.read_uint8()
  File "/usr/lib/python2.6/site-packages/qpid/", line 85, in read_uint8
    return self.unpack("!B")
  File "/usr/lib/python2.6/site-packages/qpid/", line 29, in unpack
    values = struct.unpack(fmt,
error: unpack requires a string argument of length 1

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/qmf/", line 241, in <lambda>
    return lambda *args, **kwargs : self._invoke(name, args, kwargs)
  File "/usr/lib/python2.6/site-packages/qmf/", line 339, in _invoke
    raise RuntimeError("Timed out waiting for method to respond")
RuntimeError: Timed out waiting for method to respond

Comment 1 Ted Ross 2009-12-21 18:51:35 UTC
Fixed upstream at r889619.

Comment 2 Ted Ross 2010-01-11 16:28:04 UTC
*** Bug 553919 has been marked as a duplicate of this bug. ***

Comment 3 Jan Sarenik 2010-03-10 10:08:23 UTC
Please add more info on what is needed to test this bug.
I tried to run condor with qmf modules enabled on the
broker, but I still do not see any jobserver _class.

Comment 4 Ted Ross 2010-03-31 21:27:46 UTC
In the upstream revision 929716, the qmf-agent example (cpp/examples/qmf-agent/example.cpp) tests this feature (see the constructor for CoreClass).

Build and run this example, then use the following Python code to verify the recursive map:

from qmf.console import Session
s = Session()
b = s.addBroker()
parents = s.getObjects(_class="parent")
print parents[0].args

Comment 5 Jan Sarenik 2010-04-13 13:04:48 UTC
Verified on trunk (r933560) so far.

Comment 6 Jan Sarenik 2010-04-14 10:04:15 UTC
Verified with python-qmf-0.7.930108-1.el5.noarch.rpm
along with qpid-cpp-server 0.7.929717-1.el5
on both RHEL5 i386 and x86_64.

Comment 7 Jan Sarenik 2010-04-14 10:19:08 UTC
Created attachment 406462 [details]
standalone c++ qmf-agent tarball

Extract and see README file. This source is simplified to
not look for other qpid-cpp source files in the source tree
but it finds them rather in /usr/include (given the required
packages are installed).

The agent comes from r929716 of source tree.

Comment 8 Jan Sarenik 2010-05-05 07:40:40 UTC
Halt, there were some code changes and it does not work so flawlessly now.

[root@mrg-qe-09 qmf-agent]# ./ 
qmf-gen -o ./gen/qmf ./schema.xml
make[1]: Entering directory `/root/jsarenik/qmf-agent'
make[2]: Entering directory `/root/jsarenik/qmf-agent'
make[2]: `qmf-agent' is up to date.
make[2]: Leaving directory `/root/jsarenik/qmf-agent'
make[1]: Leaving directory `/root/jsarenik/qmf-agent'
{u'second': 34, u'map-data': {u'numeric-data': 10000, u'string-data': 'Text'}, u'first': 'String data'}
[root@mrg-qe-09 qmf-agent]# ./ 
qmf-gen -o ./gen/qmf ./schema.xml
make[1]: Entering directory `/root/jsarenik/qmf-agent'
make[2]: Entering directory `/root/jsarenik/qmf-agent'
make[2]: `qmf-agent' is up to date.
make[2]: Leaving directory `/root/jsarenik/qmf-agent'
make[1]: Leaving directory `/root/jsarenik/qmf-agent'
Traceback (most recent call last):
  File "<stdin>", line 5, in ?
IndexError: list index out of range

This happens randomly. See the current attached tarball.
Tested on

Comment 9 Jan Sarenik 2010-05-05 07:42:36 UTC
Created attachment 411502 [details]
updated standalone c++ qmf-agent tarball


Comment 12 Ted Ross 2010-05-05 21:43:51 UTC
This should be fixed in the next release.  The problem you are seeing was fixed in the upstream revision 937472.

Also, the new symptom is not related to the original map-of-maps bug but was rather caused by the fact that the test script didn't always get a "parent" object from the getObjects call.

Comment 13 Jan Sarenik 2010-05-07 09:23:13 UTC
Ok, so map of maps is verified and I am filing a new bug as the
above-described still does not work on qpid-cpp-server-0.7.939184-1.el5

The new bug is at

Note You need to log in before you can comment on or make changes to this bug.