Ticket #467 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

ctrl+c hangs paludis

Reported by: peper Owned by: ciaranm
Priority: MinorRelease Milestone:
Component: core/paludis Version: 0.26.0_alpha5
Keywords: Cc: tais.hansen@…
Blocked By: Blocking: 445
Distribution:

Description


Attachments

gdb-paludis.log Download (39.0 KB) - added by Mellen 7 years ago.
Updated backtrace as ciaranm requested on irc.

Change History

comment:1 Changed 7 years ago by ferdy

Provide more info. Does it hang ALWAYS? Or do you have to press ctrl+c twice to make it hang?

  • ferdy

comment:2 Changed 7 years ago by ferdy

Also, a first look at the code shows that there is a VERY small window where signal_handler would try to Lock the same lock (tasks_mutex) that the main paludis thread has already locked. Thus leading to a deadlock.

Now, once you see it hung, attach gdb to it and post backtraces of every thread.

  • ferdy

comment:3 Changed 7 years ago by ciaranm

I think it's the new run_command handler that's screwing things up... We did have a very small window, in that I stopped noticing it ever locking up, up until a few days ago.

comment:4 Changed 7 years ago by ciaranm

This consistently hangs for me:

nice sudo paludis -i1 hilite & sleep 3 ; sudo killall paludis ; fg

Can't figure out what it is. It's related to the new run_command handler, but not the way I thought. This doesn't help:

diff --git a/paludis/util/system.cc b/paludis/util/system.cc
index 00befb2..cf17b0f 100644
--- a/paludis/util/system.cc
+++ b/paludis/util/system.cc
@@ -529,6 +529,14 @@ paludis::run_command(const Command & cmd)
                 throw RunCommandError("select failed: " + stringify(strerror(errno)));
             else if (0 == retval)
             {
+                int status(-1);
+                if (0 != waitpid(child, &status, WNOHANG))
+                {
+                    Log::get_instance()->message(ll_warning, lc_no_context) << "Child process " << child <<
+                        " appears to have exited abnormally with exit status " << status;
+                    return (WIFSIGNALED(status) ? WTERMSIG(status) + 128 : WEXITSTATUS(status));
+
+                }
                 Log::get_instance()->message(ll_debug, lc_context) << "Waiting for child " << child << " to finish";
                 continue;
             }

comment:5 Changed 7 years ago by ciaranm

  • Status changed from new to closed
  • Resolution set to fixed

r4294. Unix sucks.

comment:6 Changed 7 years ago by Mellen

  • Cc tais.hansen@… added
  • Status changed from closed to reopened
  • Resolution fixed deleted

I've attached a backtrace of paludis-0.26.0_alpha9 hanging on ctrl-c while calculating dependencies on "sudo paludis --install --pretend --compact everything".

Changed 7 years ago by Mellen

Updated backtrace as ciaranm requested on irc.

comment:7 Changed 7 years ago by ciaranm

  • Status changed from reopened to closed
  • Resolution set to fixed

That's a different issue, and it looks like it's unrelated to anything we're doing.

Note: See TracTickets for help on using tickets.