Re: [Patch] Fix undefined behaviors in regex

2013-10-17 Thread Tim Shen
On Thu, Oct 17, 2013 at 5:03 AM, Paolo Carlini wrote: >> Though, in the above case, the question is why people ignore warnings from >> the compiler and need to have special runtime instrumentation to remind them >> instead. I'm not objecting to that sanitization, only find it weird. That's my fau

Re: [Patch] Fix undefined behaviors in regex

2013-10-17 Thread Paolo Carlini
On 10/17/2013 09:17 AM, Jakub Jelinek wrote: Though, in the above case, the question is why people ignore warnings from the compiler and need to have special runtime instrumentation to remind them instead. I'm not objecting to that sanitization, only find it weird. I had the same thought. Pao

Re: [Patch] Fix undefined behaviors in regex

2013-10-17 Thread Jakub Jelinek
On Thu, Oct 17, 2013 at 09:12:41AM +0200, Marek Polacek wrote: > On Wed, Oct 16, 2013 at 07:02:03PM -0400, Tim Shen wrote: > > > To be honest, I was thinking something much smaller than the whole > > > ;) But let's add Marek in CC. > > > > int work() { > > } > > > > int main() { > > int a =

Re: [Patch] Fix undefined behaviors in regex

2013-10-17 Thread Marek Polacek
On Wed, Oct 16, 2013 at 07:02:03PM -0400, Tim Shen wrote: > > To be honest, I was thinking something much smaller than the whole > > ;) But let's add Marek in CC. > > int work() { > } > > int main() { > int a = work(); > return a; > } > > /* This is a smaller case to test the sanitizer.

Re: [Patch] Fix undefined behaviors in regex

2013-10-16 Thread Tim Shen
On Wed, Oct 16, 2013 at 6:42 PM, Paolo Carlini wrote: > On 10/17/2013 12:39 AM, Tim Shen wrote: >> >> On Wed, Oct 16, 2013 at 6:33 PM, Paolo Carlini >> wrote: >>> >>> By the way, please feel free to prepare a reduced testcase for the >>> -fsanitize people (Marek, Jakub?) >> >> Here it is. >> >> A

Re: [Patch] Fix undefined behaviors in regex

2013-10-16 Thread Paolo Carlini
On 10/17/2013 12:39 AM, Tim Shen wrote: On Wed, Oct 16, 2013 at 6:33 PM, Paolo Carlini wrote: By the way, please feel free to prepare a reduced testcase for the -fsanitize people (Marek, Jakub?) Here it is. And we should get undefined behaviors before this commit(r203732). To be honest, I was

Re: [Patch] Fix undefined behaviors in regex

2013-10-16 Thread Tim Shen
On Wed, Oct 16, 2013 at 6:33 PM, Paolo Carlini wrote: > By the way, please feel free to prepare a reduced testcase for the > -fsanitize people (Marek, Jakub?) Here it is. And we should get undefined behaviors before this commit(r203732). -- Tim Shen split.cc Description: Binary data

Re: [Patch] Fix undefined behaviors in regex

2013-10-16 Thread Paolo Carlini
On 10/17/2013 12:29 AM, Tim Shen wrote: On Wed, Oct 16, 2013 at 6:13 PM, Paolo Carlini wrote: Thank you! Committed. By the way, please feel free to prepare a reduced testcase for the -fsanitize people (Marek, Jakub?) Thanks, Paolo.

Re: [Patch] Fix undefined behaviors in regex

2013-10-16 Thread Tim Shen
On Wed, Oct 16, 2013 at 6:13 PM, Paolo Carlini wrote: > Thank you! Committed. Thanks! -- Tim Shen

Re: [Patch] Fix undefined behaviors in regex

2013-10-16 Thread Paolo Carlini
On 10/16/2013 11:48 PM, Tim Shen wrote: It's detected by `clang++ -g -std=c++11 -fsanitize=undefined` but not detected by g++ with flags `g++ -g -std=c++11 -fsanitize=undefined -lpthread`. Am I on the right way? -m32 and -m64 tested :) Thank you! Paolo.