[SERVER-42509] unwind the `ucontext_t` passed to sigaction handlers Created: 30/Jul/19  Updated: 26/Aug/19  Resolved: 26/Aug/19

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Billy Donahue Assignee: ADAM Martin (Inactive)
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: Dev Tools 2019-08-12, Dev Tools 2019-08-26
Participants:

 Description   

What we do now is have the signal handler create a new context where it's standing, and this is not quite right. We don't want to unwind the handler itself. We want to unwind the context that was executing when the handler took over, and that's provided as a ucontext_t to the sigaction handler (currently ignored). The context argument can and should be used as our unwinding context.

 



 Comments   
Comment by Sara Williamson [ 26/Aug/19 ]

We are closing this because it is not applicable to any of our platforms.

Comment by Billy Donahue [ 30/Jul/19 ]

Oh, as Drew pointed out the thing I'm looking for is probably IA-64 specific and this might not work out.

"On IA-64, unw_context_t has a layout that is compatible with that of ucontext_t and such structures can be initialized with getcontext() instead of unw_getcontext()."

https://www.nongnu.org/libunwind/man/unw_getcontext(3).html

 

This was discussed when dinosaurs ruled the earth, and they ruled at the time that it doesn't matter so much?

https://www.hpl.hp.com/hosted/linux/mail-archives/libunwind/2004-March/000290.html

Comment by Billy Donahue [ 30/Jul/19 ]

https://github.com/mongodb/mongo/blob/0860178805a5a3d9fb94ae057ce70667d206a2d7/src/mongo/util/signal_handlers_synchronous.cpp#L269

Generated at Thu Feb 08 05:00:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.