Bug 398235

Summary: kdesrc-build-setup dialog does not have access to explicit fd
Product: [Developer tools] kdesrc-build Reporter: Matt Whipple <matt>
Component: setup wizardAssignee: Michael Pyne <mpyne>
Status: RESOLVED WORKSFORME    
Severity: minor CC: nate
Priority: NOR    
Version First Reported In: Git   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Matt Whipple 2018-09-04 12:32:27 UTC
When running kdesrc-build-setup I receive the following error:


> Using fd 5
> Cannot open output-fd
> Canceled the dialog at ./kdesrc-build-setup line 80.

Commenting out the --output-fd argument on L90 of that script avoids the issue.
This seems to be a permissions problem but seemed like it may be able to be avoided.
Comment 1 Matt Whipple 2018-09-04 12:35:38 UTC
From what I gather at a glance this seems to be a problem with dialog trying to get access to an fd tied to being invoked with a pipe (which it can't due to some permission restriction on my system) but just leaving it to use the default stdout works fine. Is there a use case for explicitly specifying the fd or could stdout be normally used?
Comment 2 Michael Pyne 2018-09-29 03:12:46 UTC
kdesrc-build-setup has used output-fd since I wrote it in 2011, as far as I can glean from git.

My memory is not *that* good as to say why but the dialog(1) manpage explains that dialog(1) normally writes to stderr, which might mix with error messages from dialog(1), if any. Using --output-fd would ensure that any output that is received is related to the user input.

By default dialog(1) does not write to stdout, but to stderr instead. stdout is used to drive the TTY after all (though it seems dialog(1) can try to reopen the TTY even if you ask for output to go to stdout).

You may also try adjusting the value for $^F on line 57 to something higher than 4 (e.g. 5 or even 10 or 15). The value chosen here is used by Perl to set which file descriptors should *not* be closed-on-exec. 4 should be sufficient but if your configuration involves extra file descriptors being open, or randomizes descriptor values, you may need to adjust this value to be >= whatever the pipe(2) call would be returning here.

As an alternative, it might be easier to just fallback to a readline-based interface if dialog(1) fails?
Comment 3 Justin Zobel 2022-12-01 04:34:46 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 4 Bug Janitor Service 2022-12-16 05:13:37 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Bug Janitor Service 2022-12-31 05:23:47 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!