Question about signals in apptainer

22 views
Skip to first unread message

Wentao Lu

unread,
Aug 14, 2025, 1:53:50 AMAug 14
to discuss
Hello! I have a quick and maybe dumb question about signals in apptainer. How does apptainer intercept and handle signals?

Let's say I first enter the container and run a Python script

```
apptainer exec mycontainer.sif /usr/bin/python3 myPyScript.py
```

and then the Python script sets up my custom environment and launches my main program using `subprocess.Popen()`.

When my main program receives a crash signal such as SIGSEGV, is apptainer going to kill it? does it do something special? or maybe it depends? when would apptainer send signals to a child process?

I've noticed that sometimes when my main program crashed hard, it brought down the entire apptainer. I also have a signal handler in my main program, but it wasn't always able to catch the signal in some cases after moving into the container. I don't think apptainer is doing wrong, but just want to understand how it handles signals and maybe get some hints.

Thanks!

Dave Dykstra

unread,
Aug 14, 2025, 2:31:41 PMAug 14
to Wentao Lu, discuss
Hi Wentao,

In the case of your program getting a SIGSEGV, apptainer won't be involved in handling it all. The operating system will send that signal directly to your program.

apptainer does manage a few signals such as SIGINT and SIGTERM, but it does nothing with SIGSEGV.

Dave
> --
> You received this message because you are subscribed to the Google Groups "discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@apptainer.org.
> To view this discussion visit https://groups.google.com/a/apptainer.org/d/msgid/discuss/c7434ce8-c5aa-4a26-ba4f-085e258f6222n%40apptainer.org.

Reply all
Reply to author
Forward
0 new messages