Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-24 Thread Andrey Ryabinin
2014-10-24 12:31 GMT+04:00 y.gribov : >> Unaligned accesses disabled because they are allowed on some arches (see > HAVE_EFFICIENT_UNALIGNED_ACCESS). >> Another reason is that there are to many reports. Not because there are >> lot of bugs, but because >> there are many reports for one bug. > > A

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-24 Thread Peter Zijlstra
On Tue, Oct 21, 2014 at 02:09:14PM +0400, Andrey Ryabinin wrote: > On 10/21/2014 01:47 PM, Peter Zijlstra wrote: > > On Mon, Oct 20, 2014 at 02:54:59PM +0400, Andrey Ryabinin wrote: > >> > >> UBSan uses compile-time instrumentation to catch undefined behavior (UB). > >> Compiler inserts code that

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-24 Thread y.gribov
> Unaligned accesses disabled because they are allowed on some arches (see HAVE_EFFICIENT_UNALIGNED_ACCESS). > Another reason is that there are to many reports. Not because there are > lot of bugs, but because > there are many reports for one bug. A side note - unaligned accesses would prevent

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-24 Thread y.gribov
Unaligned accesses disabled because they are allowed on some arches (see HAVE_EFFICIENT_UNALIGNED_ACCESS). Another reason is that there are to many reports. Not because there are lot of bugs, but because there are many reports for one bug. A side note - unaligned accesses would prevent KASan

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-24 Thread Peter Zijlstra
On Tue, Oct 21, 2014 at 02:09:14PM +0400, Andrey Ryabinin wrote: On 10/21/2014 01:47 PM, Peter Zijlstra wrote: On Mon, Oct 20, 2014 at 02:54:59PM +0400, Andrey Ryabinin wrote: UBSan uses compile-time instrumentation to catch undefined behavior (UB). Compiler inserts code that perform

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-24 Thread Andrey Ryabinin
2014-10-24 12:31 GMT+04:00 y.gribov y.gri...@samsung.com: Unaligned accesses disabled because they are allowed on some arches (see HAVE_EFFICIENT_UNALIGNED_ACCESS). Another reason is that there are to many reports. Not because there are lot of bugs, but because there are many reports for one

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-22 Thread Andrey Ryabinin
On 10/22/2014 01:58 PM, Rasmus Villemoes wrote: > On Mon, Oct 20 2014, Andrey Ryabinin wrote: > >> UBSan uses compile-time instrumentation to catch undefined behavior (UB). >> Compiler inserts code that perform certain kinds of >> checks before operations that could cause UB. >> If check fails

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-22 Thread Rasmus Villemoes
On Mon, Oct 20 2014, Andrey Ryabinin wrote: > UBSan uses compile-time instrumentation to catch undefined behavior (UB). > Compiler inserts code that perform certain kinds of > checks before operations that could cause UB. > If check fails (i.e. UB detected) __ubsan_handle_* function called. > to

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-22 Thread Rasmus Villemoes
On Mon, Oct 20 2014, Andrey Ryabinin a.ryabi...@samsung.com wrote: UBSan uses compile-time instrumentation to catch undefined behavior (UB). Compiler inserts code that perform certain kinds of checks before operations that could cause UB. If check fails (i.e. UB detected) __ubsan_handle_*

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-22 Thread Andrey Ryabinin
On 10/22/2014 01:58 PM, Rasmus Villemoes wrote: On Mon, Oct 20 2014, Andrey Ryabinin a.ryabi...@samsung.com wrote: UBSan uses compile-time instrumentation to catch undefined behavior (UB). Compiler inserts code that perform certain kinds of checks before operations that could cause UB. If

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-21 Thread Randy Dunlap
On 10/20/14 03:54, Andrey Ryabinin wrote: > > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug > index 4e35a5d..7dc9b89 100644 > --- a/lib/Kconfig.debug > +++ b/lib/Kconfig.debug > @@ -646,6 +646,29 @@ config DEBUG_SHIRQ > Drivers ought to be able to handle interrupts coming in at those

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-21 Thread Andrey Ryabinin
On 10/21/2014 01:47 PM, Peter Zijlstra wrote: > On Mon, Oct 20, 2014 at 02:54:59PM +0400, Andrey Ryabinin wrote: >> >> UBSan uses compile-time instrumentation to catch undefined behavior (UB). >> Compiler inserts code that perform certain kinds of >> checks before operations that could cause UB.

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-21 Thread Peter Zijlstra
On Mon, Oct 20, 2014 at 02:54:59PM +0400, Andrey Ryabinin wrote: > > UBSan uses compile-time instrumentation to catch undefined behavior (UB). > Compiler inserts code that perform certain kinds of > checks before operations that could cause UB. > If check fails (i.e. UB detected) __ubsan_handle_*

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-21 Thread Andrey Ryabinin
On 10/20/2014 11:35 PM, Sasha Levin wrote: > On 10/20/2014 06:54 AM, Andrey Ryabinin wrote: >> >> UBSan uses compile-time instrumentation to catch undefined behavior (UB). >> Compiler inserts code that perform certain kinds of >> checks before operations that could cause UB. >> If check fails

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-21 Thread Andrey Ryabinin
On 10/20/2014 11:35 PM, Sasha Levin wrote: On 10/20/2014 06:54 AM, Andrey Ryabinin wrote: UBSan uses compile-time instrumentation to catch undefined behavior (UB). Compiler inserts code that perform certain kinds of checks before operations that could cause UB. If check fails (i.e. UB

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-21 Thread Peter Zijlstra
On Mon, Oct 20, 2014 at 02:54:59PM +0400, Andrey Ryabinin wrote: UBSan uses compile-time instrumentation to catch undefined behavior (UB). Compiler inserts code that perform certain kinds of checks before operations that could cause UB. If check fails (i.e. UB detected) __ubsan_handle_*

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-21 Thread Andrey Ryabinin
On 10/21/2014 01:47 PM, Peter Zijlstra wrote: On Mon, Oct 20, 2014 at 02:54:59PM +0400, Andrey Ryabinin wrote: UBSan uses compile-time instrumentation to catch undefined behavior (UB). Compiler inserts code that perform certain kinds of checks before operations that could cause UB. If check

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-21 Thread Randy Dunlap
On 10/20/14 03:54, Andrey Ryabinin wrote: diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 4e35a5d..7dc9b89 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -646,6 +646,29 @@ config DEBUG_SHIRQ Drivers ought to be able to handle interrupts coming in at those

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-20 Thread Sasha Levin
On 10/20/2014 06:54 AM, Andrey Ryabinin wrote: > > UBSan uses compile-time instrumentation to catch undefined behavior (UB). > Compiler inserts code that perform certain kinds of > checks before operations that could cause UB. > If check fails (i.e. UB detected) __ubsan_handle_* function called.

[RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-20 Thread Andrey Ryabinin
UBSan uses compile-time instrumentation to catch undefined behavior (UB). Compiler inserts code that perform certain kinds of checks before operations that could cause UB. If check fails (i.e. UB detected) __ubsan_handle_* function called. to print error message. So the most of the work is done

[RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-20 Thread Andrey Ryabinin
UBSan uses compile-time instrumentation to catch undefined behavior (UB). Compiler inserts code that perform certain kinds of checks before operations that could cause UB. If check fails (i.e. UB detected) __ubsan_handle_* function called. to print error message. So the most of the work is done

Re: [RFC PATCH] UBSan: run-time undefined behavior sanity checker

2014-10-20 Thread Sasha Levin
On 10/20/2014 06:54 AM, Andrey Ryabinin wrote: UBSan uses compile-time instrumentation to catch undefined behavior (UB). Compiler inserts code that perform certain kinds of checks before operations that could cause UB. If check fails (i.e. UB detected) __ubsan_handle_* function called. to