Bug#572923: signed integer overflow, maybe?

2010-05-22 Thread Iustin Pop
On Thu, Apr 15, 2010 at 09:24:47PM +0200, sean finney wrote: hiya, Hi there, On Thu, Apr 15, 2010 at 09:14:16PM +0200, Iustin Pop wrote: Since I honestly don't know that much here, I think it would be best that you forward this to upstream, to get it integrated. In the meantime, I'll

Bug#572923: signed integer overflow, maybe?

2010-04-15 Thread Iustin Pop
On Mon, Apr 05, 2010 at 07:34:05PM +0200, sean finney wrote: On Sun, Apr 04, 2010 at 09:47:36PM +0200, sean finney wrote: fixing both of these doesn't fix the problem, though the protoc program does get a tiny bit further before abort()ing. also, ConsumeSignedInteger (text_format.cc),

Bug#572923: signed integer overflow, maybe?

2010-04-15 Thread sean finney
hiya, On Thu, Apr 15, 2010 at 09:14:16PM +0200, Iustin Pop wrote: Since I honestly don't know that much here, I think it would be best that you forward this to upstream, to get it integrated. In the meantime, I'll upload a patched version next week with your diff. i sent an email to the

Bug#572923: signed integer overflow, maybe?

2010-04-05 Thread sean finney
On Sun, Apr 04, 2010 at 09:47:36PM +0200, sean finney wrote: fixing both of these doesn't fix the problem, though the protoc program does get a tiny bit further before abort()ing. also, ConsumeSignedInteger (text_format.cc), usage of enum WireType, (wire_format_lite.h), FastUInt32ToBufferLeft

Bug#572923: signed integer overflow, maybe?

2010-04-04 Thread sean finney
On Mon, Mar 15, 2010 at 09:22:25PM +0100, Iustin Pop wrote: Honestly, since it tends to look like gcc bug, the thing I care most is to workaround this issue *somehow*. If the simplest way is to require gcc 4.3, or a different version of gcc, then… i took another dive in the debugger this

Bug#572923: signed integer overflow, maybe?

2010-03-15 Thread Iustin Pop
On Sat, Mar 13, 2010 at 12:17:14PM +0100, sean finney wrote: On Sat, Mar 13, 2010 at 11:07:13AM +0100, Iustin Pop wrote: So again, sorry if I'm talking stupid things. But here the compiler does exactly what you required it to do. 0x8000 as a positive constant doesn't work already, if

Bug#572923: signed integer overflow, maybe?

2010-03-13 Thread Iustin Pop
On Fri, Mar 12, 2010 at 11:33:41PM +0100, sean finney wrote: hi, On Fri, Mar 12, 2010 at 09:47:50PM +0100, Iustin Pop wrote: (without the negation). adding a negation operator to this is what was raising my eyebrows. it could be that as long as everything is a constant that stuff is

Bug#572923: signed integer overflow, maybe?

2010-03-13 Thread sean finney
On Sat, Mar 13, 2010 at 11:07:13AM +0100, Iustin Pop wrote: So again, sorry if I'm talking stupid things. But here the compiler does exactly what you required it to do. 0x8000 as a positive constant doesn't work already, if you for example try to print it it's stored as a negative

Bug#572923: signed integer overflow, maybe?

2010-03-13 Thread Iustin Pop
On Sat, Mar 13, 2010 at 11:07:13AM +0100, Iustin Pop wrote: On Fri, Mar 12, 2010 at 11:33:41PM +0100, sean finney wrote: i'm not saying it *isn't* a compiler error, but inserting a few printfs and the problem disappearing is also pretty common in other situations of undefined behavior...

Bug#572923: signed integer overflow, maybe?

2010-03-12 Thread sean finney
On Tue, Mar 09, 2010 at 11:38:23PM +0100, Iustin Pop wrote: actually, from /usr/lib/limits.h, -0x8000 is indeed the minimum value for signed int32. a brief look at the tests failing show that this is exactly what upstream tries to test, the minimum and maximum valid signed values. whether

Bug#572923: signed integer overflow, maybe?

2010-03-12 Thread Iustin Pop
On Fri, Mar 12, 2010 at 09:22:31PM +0100, sean finney wrote: On Tue, Mar 09, 2010 at 11:38:23PM +0100, Iustin Pop wrote: actually, from /usr/lib/limits.h, -0x8000 is indeed the minimum value for signed int32. a brief look at the tests failing show that this is exactly what upstream

Bug#572923: signed integer overflow, maybe?

2010-03-12 Thread sean finney
hi, On Fri, Mar 12, 2010 at 09:47:50PM +0100, Iustin Pop wrote: (without the negation). adding a negation operator to this is what was raising my eyebrows. it could be that as long as everything is a constant that stuff is okay, but once you negate a non-constant value holding INT_MIN

Bug#572923: signed integer overflow, maybe?

2010-03-09 Thread Iustin Pop
On Mon, Mar 08, 2010 at 06:47:46PM +0100, sean finney wrote: hey folks, just to throw something out there, the last time i ran into a bug like this was a few weeks back with php, also with gcc 4.4 and also on arm. turns out it was a case of signed integer overflow, which has undefined

Bug#572923: signed integer overflow, maybe?

2010-03-08 Thread sean finney
hey folks, just to throw something out there, the last time i ran into a bug like this was a few weeks back with php, also with gcc 4.4 and also on arm. turns out it was a case of signed integer overflow, which has undefined consequences in runtime code. looking through the code i see comments