Score:1

How can a command crash the shell it runs from?

jp flag

I am running some tests in an android emulator. I launch them from the command line:

npm run start:e2e

and once in a while, the command crashes so hard that the terminal window closes abruptly. If I am running it in the IDE, then that crashes too.

I am not trying to solve the problem, merely to understand how such a thing happens.

Even if I make the following script:

#!/bin/bash

exit

and source it in the shell, the terminal window does not close.

Is there some way to post-mortem such a crash?

Raffa avatar
jp flag
Many ways possible for "crashing the shell" some of which might be imposed from outside the shell process itself e.g. system OOM killer ... But internally the exit call e.g. `bash -c 'exit'` will terminate the sub-shell forked for that script ... While the parent-shell running in the terminal will still be running ... To kill the parent-shell from a sub-shell, you can do e.g. `bash -c 'kill -9 $PPID'` ... Where the environment variable `$PPID` holds the parent process ID of the current sub-shell.
jp flag
@user68186 Ubuntu 22.04.1 LTS with 5.15.0-60-generic kernel.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.