http://oss.sgi.com/bugzilla/show_bug.cgi?id=892
Summary: pmchart dies if any PMDA dies
Product: pcp
Version: unspecified
Platform: All
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P3
Component: pcp-gui
AssignedTo: nathans@xxxxxxxxxx
ReportedBy: gnb@xxxxxxxxxxx
CC: pcp@xxxxxxxxxxx
Estimated Hours: 0.0
Classification: Unclassified
To reproduce:
1. kill a PMDA
2. in pmchart, click the New Chart tool
3. in the Available Metrics window, click down through the namespace
to find one or more metrics whose source is the dead PMDA
4. expect to see a popup with "Cannot find metric descriptor at "foo.bar.baz".
Unknown or illegal metric identifier". Click Ok.
5. double-click on a metric to add it to the chart. pmchart aborts.
The abort is this:
// src/chart/namespace.cpp
429 NameSpace *NameSpace::dup(QTreeWidget *, NameSpace *tree,
430 QString scheme, int *sequence)
...
439 if (my.type == NoType || my.type == ChildMinder) {
440 console->post("NameSpace::dup bad type=%d on %p %s)",
441 my.type, this, (const char *)metricName().toAscii());
442 abort(); <-------------------------------
443 }
Debugger shows that my.type is NoType. If I understand the code correctly,
this is a default type that should have been changed to either LeafNullIndom
or LeafWithIndom at the point when the last body node of the tree was expanded.
Unfortunately it seems that because the PMDA died, pmLookupDesc() will fail
and the error handling behaviour is to leave the failed metric, and all
subsequent siblings, visible in the tree and selectable but with NoType.
212 void NameSpace::expandMetricNames(QString parent, bool show)
...
317 for (i = 0; i < nleaf; i++) {
318 m = leaflist[i];
319 sts = pmLookupDesc(pmidlist[i], &m->my.desc);
320 if (sts < 0) {
321 if (!show)
322 goto done;
323 QString msg = QString();
324 msg.sprintf("Cannot find metric descriptor at
\"%s\".\n%s.\n\n",
325 offspring[i], pmErrStr(sts));
326 QMessageBox::warning(NULL, pmProgname, msg,
327 QMessageBox::Ok | QMessageBox::Default |
328 QMessageBox::Escape,
329 QMessageBox::NoButton, QMessageBox::NoButton);
330 goto done; <--------------------
331 }
332 if (m->my.desc.indom == PM_INDOM_NULL) {
333 m->my.type = LeafNullIndom;
334 m->setExpandable(false);
335 m->setSelectable(true);
336 }
337 else {
338 m->my.type = LeafWithIndom;
339 m->setExpandable(true);
340 m->setSelectable(false);
341 }
342 }
...
346 done:
Ideally, error handling should not involve leaving landmines for others to
trip over later.
--
Configure bugmail: http://oss.sgi.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
|