[Geany-Devel] Changing terminate signal for stopping executing programs

Lex Trotman elextr at xxxxx
Tue Mar 12 21:51:14 UTC 2013


On 13 March 2013 04:47, Dimitar Zhekov <dimitar.zhekov at gmail.com> wrote:
> On Mon, 11 Mar 2013 13:18:10 +1100
> Lex Trotman <elextr at gmail.com> wrote:
>
>> Geany currently uses SIGQUIT to terminate a running program (using the
>> execute menu item or toolbar button when it shows the stop icon).
>> This has always been the case since the stop button was added.
>>
>> There is a big comment in the code explaining why SIGQUIT is used, and
>> its problems:
>>
>>       /* Unix: SIGQUIT is not the best signal to use because it causes a
>> core dump (this should not
>>        * perforce necessary for just killing a process). But we must use a
>> signal which we can
>>        * ignore because the main process get it too, it is declared to
>> ignore in main.c. */
>>
>> ...
>>
>> My understanding of Unix/Linux signals is that the comment above is
>> wrong and always has been wrong, a signal sent to a child process by a
>> parent process does not get delivered to the parent.
>
> When you execute a gdb -exec-interrupt command in debugger or Scope, a
> SIGINT is sent to the inferior, and to gdb, and to Geany. But if you
> start gdb from a terminal, the signal is sent to inferior only.
>
> debugger moves gdb/inferior to a new process group, which sometimes
> fails.

Sounds like -exec-interrupt is sending to the process group, (see
kill(2) with a negative number) which it would have inherited from
Geany and so includes Geany in it.

> Scope disables SIGINT in Geany while debugging.
>
> glib spawn is much more complex than a normal fork/exec...

And mysterious, unless you read the source, but then you can't rely on
that either.

Cheers
Lex

>
> --
> E-gards: Jimmy
> _______________________________________________
> Devel mailing list
> Devel at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/devel


More information about the Devel mailing list