I'm tracking down an issue with then run0 command in f41.

In a KDE konsole terminal run0 fails to work after
stty intr ^g

It just exits without an error message, exit code 130.

Running run0 via gdb or strace makes things work.
Which leaves me with fprintf debugging.

I have been adding fprintf to the code to trace the path
of execution and print key information.

What I am seeing is very odd.

For the following code the ppoll does not return, the process exits.

From io-utils.c:191

int ppoll_usec(struct pollfd *fds, size_t nfds, usec_t timeout) {
        int r;

        fprintf(stderr, "QQQ io-util.c:194 ppoll_usec\n");

        assert(fds || nfds == 0);

        /* This is a wrapper around ppoll() that does primarily two things:
         *
         *  ✅ Takes a usec_t instead of a struct timespec
         *
         *  ✅ Guarantees that if an invalid fd is specified we return EBADF 
(i.e. converts POLLNVAL to
         *     EBADF). This is done because EBADF is a programming error 
usually, and hence should bubble up
         *     as error, and not be eaten up as non-error POLLNVAL event.
         *
         *  ⚠️ ⚠️ ⚠️ Note that this function does not add any special handling 
for EINTR. Don't forget
         *  poll()/ppoll() will return with EINTR on any received signal 
always, there is no automatic
         *  restarting via SA_RESTART available. Thus, typically you want to 
handle EINTR not as an error,
         *  but just as reason to restart things, under the assumption you use 
a more appropriate mechanism
         *  to handle signals, such as signalfd() or signal handlers. ⚠️ ⚠️ ⚠️
         */

        if (nfds == 0)
                return 0;

        fprintf(stderr, "QQQ io-util.c:216 ppoll_usec\n");
        const struct timespec *tmp_timeout = timeout == USEC_INFINITY ? NULL : 
TIMESPEC_STORE(timeout);
        fprintf(stderr, "QQQ io-util.c:218 ppoll_usec fds %d nfds %lu timeout 
%lu\n", fds[0].fd, nfds, timeout);
        r = ppoll(fds, nfds, tmp_timeout, NULL);
        fprintf(stderr, "QQQ io-util.c:220 ppoll_usec r %d\n", r);


I see the fprintf for line 218 but not for 220 is stty intr ^g has been run.

It seems that the ppoll call kills the process and I see an exit code of 130.

I'm not sure how to further the debugging process.

How can I make progress on this problem?

Here are the fprintf logs from working and not working.

$ 
LD_LIBRARY_PATH=../BUILD/systemd-256.7-build/systemd-256.7/redhat-linux-build/src/shared
  ../BUILD/systemd-256.7-build/BUILDROOT/usr/bin/run0QQQ run.c:2355
QQQ run.c:2362
QQQ run.c:788 parse_argv_sudo_mode
QQQ run.c:883 parse_argv_sudo_mode
QQQ run.c:898 parse_argv_sudo_mode
QQQ run.c:901 parse_argv_sudo_mode arg_stdio 1
QQQ run.c:934 parse_argv_sudo_mode
QQQ run.c:974 parse_argv_sudo_mode
QQQ run.c:984 parse_argv_sudo_mode
QQQ pretty-print.c:423 terminal_tint_color 3
QQQ terminal-util.c:1728 get_default_background_colors
QQQ terminal-util.c:1746 get_default_background_colors
QQQ terminal-util.c:1758 get_default_background_colors
QQQ terminal-util.c:1769 get_default_background_colors
QQQ terminal-util.c:1779 get_default_background_colors
QQQ io-util.c:238 fd_wait_for_event
QQQ io-util.c:194 ppoll_usec
QQQ io-util.c:216 ppoll_usec
QQQ io-util.c:218 ppoll_usec fds 0 nfds 1 timeout 100000
QQQ io-util.c:220 ppoll_usec r 1
QQQ io-util.c:245 fd_wait_for_event ppoll_usec r 1
QQQ io-util.c:245 fd_wait_for_event ppoll_usec pollfd.revents 1
QQQ terminal-util.c:1782 get_default_background_colors fd_wait_for_event r 1
QQQ terminal-util.c:1792 get_default_background_colors read(STDIN_FILENO,) l 24
QQQ terminal-util.c:1802 get_default_background_colors
QQQ terminal-util.c:1809 get_default_background_colors
QQQ pretty-print.c:423 terminal_tint_color get_default_background_color r 0
QQQ pretty-print.c:430 terminal_tint_color
QQQ pretty-print.c:444 terminal_tint_color
QQQ pretty-print.c:449 terminal_tint_color
QQQ run.c:989 parse_argv_sudo_mode
QQQ run.c:2364 parse_argv_sudo_mode r 1
QQQ run.c:2366 r 1
QQQ io-util.c:194 ppoll_usec
QQQ io-util.c:216 ppoll_usec
QQQ io-util.c:218 ppoll_usec fds 3 nfds 1 timeout 24999993
QQQ io-util.c:220 ppoll_usec r 1
QQQ io-util.c:194 ppoll_usec
QQQ io-util.c:216 ppoll_usec
QQQ io-util.c:218 ppoll_usec fds 3 nfds 1 timeout 24999996
QQQ io-util.c:220 ppoll_usec r 1
QQQ io-util.c:238 fd_wait_for_event
QQQ io-util.c:194 ppoll_usec
QQQ io-util.c:216 ppoll_usec
QQQ io-util.c:218 ppoll_usec fds 6 nfds 1 timeout 18446744073709551615
QQQ io-util.c:220 ppoll_usec r 1
QQQ io-util.c:245 fd_wait_for_event ppoll_usec r 1
QQQ io-util.c:245 fd_wait_for_event ppoll_usec pollfd.revents 16
QQQ io-util.c:194 ppoll_usec
QQQ io-util.c:216 ppoll_usec
QQQ io-util.c:218 ppoll_usec fds 3 nfds 1 timeout 24999991
QQQ io-util.c:220 ppoll_usec r 1
Failed to start transient service unit: Access denied

$ stty intr ^g
$ 
LD_LIBRARY_PATH=../BUILD/systemd-256.7-build/systemd-256.7/redhat-linux-build/src/shared
  ../BUILD/systemd-256.7-build/BUILDROOT/usr/bin/run0
QQQ run.c:2355
QQQ run.c:2362
QQQ run.c:788 parse_argv_sudo_mode
QQQ run.c:883 parse_argv_sudo_mode
QQQ run.c:898 parse_argv_sudo_mode
QQQ run.c:901 parse_argv_sudo_mode arg_stdio 1
QQQ run.c:934 parse_argv_sudo_mode
QQQ run.c:974 parse_argv_sudo_mode
QQQ run.c:984 parse_argv_sudo_mode
QQQ pretty-print.c:423 terminal_tint_color 3
QQQ terminal-util.c:1728 get_default_background_colors
QQQ terminal-util.c:1746 get_default_background_colors
QQQ terminal-util.c:1758 get_default_background_colors
QQQ terminal-util.c:1769 get_default_background_colors
QQQ terminal-util.c:1779 get_default_background_colors
QQQ io-util.c:238 fd_wait_for_event
QQQ io-util.c:194 ppoll_usec
QQQ io-util.c:216 ppoll_usec
QQQ io-util.c:218 ppoll_usec fds 0 nfds 1 timeout 99999

$


-- 
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to