bugGNU Zile (Zile is Lossy Emacs) - Bugs: bug #35584, After resuming, SIGTSTPs are...

 
 

bug #35584: After resuming, SIGTSTPs are ignored

Submitted by:  Gary V. Vaughan <gary>
Submitted on:  Tue 21 Feb 2012 02:22:54 PM UTC  
 
Category: LuaSeverity: 3 - Normal
Status: FixedAssigned to: Reuben Thomas <rrt>
Open/Closed: ClosedRelease: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 29 Feb 2012 02:34:19 PM UTC, comment #4:

Having implemented handler chaining in luaposix, by having it return a usable version of any previous C handler, I discovered that this wasn't the actual problem; rather, it was the mechanism I put in place to avoid a signal being raised again before the Lua handler could be run.

The problem is that in the signal handler there is no way to determine what the process's signal mask was before the signal was raised, because at that point the signal being handled may be blocked (indeed, all signals are blocked while in the luaposix signal handler).

Hence, it's impossible correctly to restore the signal mask afterwards. So another approach is needed: rather than blocking signals when the C signal handler is run, a count is incremented. Then when the Lua signal handler is run, signals are blocked (because now the process is running with its "normal" mask, so we can save the old value) it is run the number of times it has been raised, and then signals are unblocked again.

Updating to the latest luaposix from git will therefore fix this bug, and I'll make a release (5.1.17) shortly.

Reuben Thomas <rrt>
Project AdministratorIn charge of this item.
Wed 22 Feb 2012 11:29:12 PM UTC, comment #3:

It's not currently possible to chain signal handlers, as C handler are returned as light userdata. I will have to change this. Please hold on.

Reuben Thomas <rrt>
Project AdministratorIn charge of this item.
Wed 22 Feb 2012 10:50:00 PM UTC, comment #2:

The problem appears to be commit 7f7cbaee, which installs a SIGCONT handler, so likely there's a bug either in your SIGCONT handler or (equally likely) luaposix. I'll investigate further.

Reuben Thomas <rrt>
Project AdministratorIn charge of this item.
Wed 22 Feb 2012 03:00:10 PM UTC, comment #1:

I recently fixed exactly this bug; I can confirm I can reproduce it. I'm on it just as soon as I can find a minute!

Reuben Thomas <rrt>
Project AdministratorIn charge of this item.
Tue 21 Feb 2012 02:22:54 PM UTC, original submission:

To reproduce:

$ src/zile
^Z
$ fg
^Z

I've chased this around in lua zile, and the process gets stuck after suspend-emacs calls posix.raise (posix.SIGTSTP).

As the expert on luaposix signal handling, I hope it's obvious to you what to fix :)

If not, let me know and I'll debug libposix too.

Some conjecture you should take with a pinch of salt:

1. I suppose it's possible that my lack of full understanding of the non-legacy unix signalling APIs might mean that I'm not upholding zile's side of the bargain when SIGCONT is handled (e.g. in addition to resetting application cursor mode, maybe I should be reinitialising the signal handlers? Although I hope not... because we're just letting the curses SIGTSTP handler do everything right now.)
2. There's an awaiting-lposix-sigtstp-bugfix branch, which is how I originally wanted to implement suspend/resume with luaposix signalling, but that still doesn't work. Maybe the same (or a related) bug?

Gary V. Vaughan <gary>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rrt (Posted a comment)
  • -unavailable- added by gary (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 29 Feb 2012 02:34:19 PM UTCrrtStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1