All of lore.kernel.org
 help / color / mirror / Atom feed
* Error handling in sparse-llvm
@ 2017-03-12 19:40 Dibyendu Majumdar
  2017-03-12 19:53 ` Luc Van Oostenryck
  0 siblings, 1 reply; 4+ messages in thread
From: Dibyendu Majumdar @ 2017-03-12 19:40 UTC (permalink / raw)
  To: Linux-Sparse

Hi,

At present there are a bunch of asserts for scenarios not handled by
Sparse LLVM backend. A more robust error handling method is needed
that works even in release builds, and doesn't abort the process.
Given the way the code is structured currently, I was thinking maybe
it will be easiest to use setjmp/longjmp mechanism to terminate the
LLVM backend on error. I am not sure that this entirely safe with LLVM
as the LLVM code is C++ - I think it might be okay as long as the LLVM
module / context is properly disposed at the end.

Regards
Dibyendu

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Error handling in sparse-llvm
  2017-03-12 19:40 Error handling in sparse-llvm Dibyendu Majumdar
@ 2017-03-12 19:53 ` Luc Van Oostenryck
  2017-03-13 10:43   ` Dibyendu Majumdar
  0 siblings, 1 reply; 4+ messages in thread
From: Luc Van Oostenryck @ 2017-03-12 19:53 UTC (permalink / raw)
  To: Dibyendu Majumdar; +Cc: Linux-Sparse

On Sun, Mar 12, 2017 at 07:40:18PM +0000, Dibyendu Majumdar wrote:
> Hi,
> 
> At present there are a bunch of asserts for scenarios not handled by
> Sparse LLVM backend. A more robust error handling method is needed
> that works even in release builds, and doesn't abort the process.
> Given the way the code is structured currently, I was thinking maybe
> it will be easiest to use setjmp/longjmp mechanism to terminate the
> LLVM backend on error. I am not sure that this entirely safe with LLVM
> as the LLVM code is C++ - I think it might be okay as long as the LLVM
> module / context is properly disposed at the end.

By far, the best thing that can be done is to add support for the missing
features/scenarios so that those asserts can be removed. 

-- Luc Van Oostenryck

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Error handling in sparse-llvm
  2017-03-12 19:53 ` Luc Van Oostenryck
@ 2017-03-13 10:43   ` Dibyendu Majumdar
  2017-03-13 11:00     ` Dibyendu Majumdar
  0 siblings, 1 reply; 4+ messages in thread
From: Dibyendu Majumdar @ 2017-03-13 10:43 UTC (permalink / raw)
  To: Luc Van Oostenryck; +Cc: Linux-Sparse

On 12 March 2017 at 19:53, Luc Van Oostenryck
<luc.vanoostenryck@gmail.com> wrote:
> On Sun, Mar 12, 2017 at 07:40:18PM +0000, Dibyendu Majumdar wrote:
>> At present there are a bunch of asserts for scenarios not handled by
>> Sparse LLVM backend. A more robust error handling method is needed
>> that works even in release builds, and doesn't abort the process.
>> Given the way the code is structured currently, I was thinking maybe
>> it will be easiest to use setjmp/longjmp mechanism to terminate the
>> LLVM backend on error. I am not sure that this entirely safe with LLVM
>> as the LLVM code is C++ - I think it might be okay as long as the LLVM
>> module / context is properly disposed at the end.
>
> By far, the best thing that can be done is to add support for the missing
> features/scenarios so that those asserts can be removed.
>

Agreed, but that will probably take some time. In the meantime even
with the subset supported by Sparse-LLVM it can be used in
applications - provided it deals with supported features gracefully
and generates correct code for supported features.

Regards
Dibyendu

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Error handling in sparse-llvm
  2017-03-13 10:43   ` Dibyendu Majumdar
@ 2017-03-13 11:00     ` Dibyendu Majumdar
  0 siblings, 0 replies; 4+ messages in thread
From: Dibyendu Majumdar @ 2017-03-13 11:00 UTC (permalink / raw)
  To: Luc Van Oostenryck; +Cc: Linux-Sparse

On 13 March 2017 at 10:43, Dibyendu Majumdar <mobile@majumdar.org.uk> wrote:
> On 12 March 2017 at 19:53, Luc Van Oostenryck
> <luc.vanoostenryck@gmail.com> wrote:
>> On Sun, Mar 12, 2017 at 07:40:18PM +0000, Dibyendu Majumdar wrote:
>>> At present there are a bunch of asserts for scenarios not handled by
>>> Sparse LLVM backend. A more robust error handling method is needed
>>> that works even in release builds, and doesn't abort the process.
>>> Given the way the code is structured currently, I was thinking maybe
>>> it will be easiest to use setjmp/longjmp mechanism to terminate the
>>> LLVM backend on error. I am not sure that this entirely safe with LLVM
>>> as the LLVM code is C++ - I think it might be okay as long as the LLVM
>>> module / context is properly disposed at the end.
>>
>> By far, the best thing that can be done is to add support for the missing
>> features/scenarios so that those asserts can be removed.
>>
>
> Agreed, but that will probably take some time. In the meantime even
> with the subset supported by Sparse-LLVM it can be used in
> applications - provided it deals with supported features gracefully
> and generates correct code for supported features.
>

Apologies for the typo - I meant to say 'it deals with unsupported
features gracefully'.

Regards

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-13 11:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-12 19:40 Error handling in sparse-llvm Dibyendu Majumdar
2017-03-12 19:53 ` Luc Van Oostenryck
2017-03-13 10:43   ` Dibyendu Majumdar
2017-03-13 11:00     ` Dibyendu Majumdar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.