[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort() |
Date: |
Tue, 16 Mar 2010 19:35:41 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Jamie Lokier <address@hidden> writes:
> Paolo Bonzini wrote:
>> On 03/15/2010 07:36 PM, Markus Armbruster wrote:
>> >Please don't tell me that user emulators make abort() return. abort()
>> >is declared __noreturn__, and the optimizer may well rely on that.
>>
>> If the user programs make a "signal (SIGABRT, SIG_IGN)" call, I suppose
>> abort() will return.
>
> On Linux, man abort says:
>
> If the SIGABRT signal is ignored, or caught by a handler that returns,
> the abort() function will still terminate the process. It does this by
> restoring the default disposition for SIGABRT and then raising the sig‐
> nal for a second time.
>
> However I have a suspicious that I've seen abort() return on some
> other OS in the distant past, maybe SunOS 4.
Dark age.
> I wouldn't rely on abort() always terminating the process on all OSes.
Such behavior is not permitted by ISO C:
7.20.4.1 The abort function
[...]
The abort function causes abnormal program termination to occur,
unless the signal SIGABRT is being caught and the signal handler
does not return. [...]
The abort function does not return to its caller.
- Re: [Qemu-devel] [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), (continued)
- Re: [Qemu-devel] [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Markus Armbruster, 2010/03/15
- [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Paolo Bonzini, 2010/03/16
- Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Markus Armbruster, 2010/03/16
- Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Jamie Lokier, 2010/03/16
- Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Paolo Bonzini, 2010/03/17
- Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Blue Swirl, 2010/03/17
- Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Jamie Lokier, 2010/03/18
- Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Blue Swirl, 2010/03/19
- Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Markus Armbruster, 2010/03/18
- Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(), Jamie Lokier, 2010/03/16
- Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort(),
Markus Armbruster <=