Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 509394 - x11-misc/xdiskusage_1.48_p20111016 - re-add reading from pipe plus segfault fix
Summary: x11-misc/xdiskusage_1.48_p20111016 - re-add reading from pipe plus segfault fix
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Desktop Misc. Team
URL: https://sourceforge.net/p/xdiskusage/...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-05-02 14:26 UTC by Bernd Feige
Modified: 2016-03-02 08:30 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Re-add the isatty() test removed in CVS version 1.23 (xdiskusage_1.48_p20111016_isatty.patch,442 bytes, patch)
2014-05-02 14:27 UTC, Bernd Feige
Details | Diff
Fix segfault caused by missing root name when reading from a pipe (xdiskusage_1.48_p20111016_segfault.patch,415 bytes, patch)
2014-05-02 14:28 UTC, Bernd Feige
Details | Diff
Alternative patch making "xdiskusage -" work (xdiskusage_1.48_p20111016_fix_hyphen.patch,756 bytes, patch)
2014-05-02 16:19 UTC, Bernd Feige
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Feige 2014-05-02 14:26:44 UTC
Hello,
CVS version 1.23 distributed as p20111016 by gentoo  (http://xdiskusage.cvs.sourceforge.net/viewvc/xdiskusage/xdiskusage/xdiskusage.C?view=log, Dec 3 18:20:12 2009 UTC) removed the ability to detect whether input is a tty, perhaps in response to bug reports that "du * | xdiskusage" crashed (http://sourceforge.net/p/xdiskusage/bugs/19/).

Note that, although it was removed from the program, the functionality to read from a pipe is still advertised by both "xdiskusage -h" and the man page...

Now I really wanted that functionality back and re-added it (first patch) and also found the reason for above segfault and fixed it (second patch). The reason was that the name of the input file serves as a root node and is NULL for a pipe, so we need to fall back to a fixed name of "stdin".
(For reference, the gdb log was:
#0  0x0000000000403b01 in OutputWindow::draw_tree (this=0x62bb40, n=0x630c90, column=0, row=0, scale=29.9375, offset=0)
    at xdiskusage.C:720)

Best regards,
Bernd

Reproducible: Always
Comment 1 Bernd Feige 2014-05-02 14:27:43 UTC
Created attachment 376210 [details, diff]
Re-add the isatty() test removed in CVS version 1.23
Comment 2 Bernd Feige 2014-05-02 14:28:34 UTC
Created attachment 376212 [details, diff]
Fix segfault caused by missing root name when reading from a pipe
Comment 3 Bernd Feige 2014-05-02 16:19:01 UTC
Additional note:
CVS version 1.23 really tried to make "xdiskusage -" read from a pipe. This never worked however because arg_cb(), responsible for accepting arguments, "accepts" the "-" as (no-op) argument and therefore the subsequent test for "-" never sees it. If you try to make arg_cb() not accept it, as intended, a segfault results because the argument "-" is forcibly set to NULL and then d->show(argc,argv) is called, having FLTK accessing the elements of argv[].

I attach another patch, as alternative to the first patch, which makes the intended syntax of "xdiskusage -" work. While "xdiskusage -h" output is correct, the man page still needs to be adapted to this use.

Regards,
Bernd
Comment 4 Bernd Feige 2014-05-02 16:19:42 UTC
Created attachment 376250 [details, diff]
Alternative patch making "xdiskusage -" work
Comment 5 Bernd Feige 2015-12-23 13:40:05 UTC
I just saw that in the course of 2014, the issue was fixed upstream. Current version is 1.51, I confirmed that it fixes this.
Could we revbump please?
Thanks,
Bernd
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2016-02-16 05:25:11 UTC
(In reply to Bernd Feige from comment #5)

> Could we revbump please?

A revision bump, not a version bump?