xdiskusage has been broken for some time. It hangs when you start it, unless you pipe du output into it. As such it has been marked IGNORE, and recently given an expiration date. I've just been looking into this. It currently looks like a bug in fltk. xdiskusage hangs at one point when it tries to read from a pipe (it gets piped input from df and/or du). I have reduced the program to nothing but this (no fltk calls) and it still hangs. However, if you don't link it with fltk it works. So presumably fltk does something offensive when its shared library loads, though what it would be I don't know. It may have something to do with threads. As a workaround, however, linking with -static also fixes it. I don't know why; I guess this suppresses the troublesome load behavior of fltk. But this gives us a way to get xdiskusage working again: simply add -static to the link command. I'm going to keep investigating this and hopefully fix or at least report the fltk bug. Hopefully this will earn xdiskusage a stay of execution, it's a very useful program.
Ah. Figured it out. Not a bug in fltk, it seems. fltk can optionally be compiled with threads enabled. If you disable fltk's threads, xdiskusage works as is. If you have threads enabled for fltk, you must compile xdiskusage with -pthread (or probably at least -lc_r or -DREENTRANT). Otherwise xdiskusage uses the ordinary stdio calls from libc and it doesn't correctly interact with the locking that's being done by fltk's threading stuff, resulting in a hang. I'll leave it to you to figure out the best way of implementing this in the makefile... Thanks! -- Nate Eldredge nge@cs.hmc.edu
Oh, and incidentally, xdiskusage is now at version 1.47. -- Nate Eldredge nge@cs.hmc.edu
Responsible Changed From-To: freebsd-ports-bugs->trevor Over to maintainer.
Hi Anders, it appears you are the new maintainer for xdiskusage, so you might want to have a look at this PR 68194. It still applies to xdiskusage 1.47. It's the original reason the port was scheduled to expire. Looks like it doesn't happen for you (since you un-expired it with the comment "this port works"); maybe you don't have fltk compiled with threads. Anyway, as I mention, I know the fix but not the best way to implement it. Just thought I'd bring it to your attention. Thanks for picking up xdiskusage, it's a very useful tool. -- Nate Eldredge nge@cs.hmc.edu
Responsible Changed From-To: trevor->anders Reassign to new volunteer maintainer.
Hi, How about you try the attached patch. I added a knob for adding threads support to the xdiskusage port. If you have a threaded fltk library, xdiskusage should be threaded too. At least, that way your problem does not occur. Cheers, -- Anders.
State Changed From-To: open->closed I have added a knob/option to support threaded fltk library.