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 afternoon and found something
here (src/google/protobuf/descriptor.cc:204):

struct PointerStringPairHash {
  size_t operator()(const PointerStringPair& p) const {
    // FIXME(kenton):  What is the best way to compute this hash?  I have
    // no idea!  This seems a bit better than an XOR.
    hash<const char*> cstring_hash;
    return reinterpret_cast<intptr_t>(p.first) * ((1 << 16) - 1) +
           cstring_hash(p.second);
  }

this can produce integer overflows, and there is a similar one about
a dozen lines earlier in PointerIntegerPairHash.  There are more though.
so you might want to point upstream at this to confirm to them that there
are indeed integer overflow errors that can't just be pushed aside and
blamed on the compiler...

fixing both of these doesn't fix the problem, though the protoc program
does get a tiny bit further before abort()ing.


        sean

Attachment: signature.asc
Description: Digital signature

Reply via email to