==4015== Invalid read of size 8
==4015== at 0x5108FF2: google::protobuf::DescriptorPool::FindFileByName(std::string const&) const (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.8.0.0)
==4015== by 0x47F3F4: transit_realtime::protobuf_AssignDesc_gtfs_2drealtime_2eproto() (in /home/patrick/repos/trajserver/trajhttpserv)
==4015== by 0x50DC2CF: google::protobuf::internal::FunctionClosure0::Run() (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.8.0.0)
==4015== by 0x50DC4F0: google::protobuf::GoogleOnceInitImpl(long*, google::protobuf::Closure*) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.8.0.0)
==4015== by 0x474444: transit_realtime::FeedMessage::GetMetadata() const (in /home/patrick/repos/trajserver/trajhttpserv)
==4015== by 0x513FF6F: google::protobuf::Message::GetTypeName() const (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.8.0.0)
==4015== by 0x50EB090: ??? (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.8.0.0)
==4015== by 0x50EB891: google::protobuf::MessageLite::ParseFromString(std::string const&) (in /usr/lib/x86_64-linux-gnu/libprotobuf.so.8.0.0)
==4015== by 0x442E83: GtfsRealTimeReader::getTripUpdates() (in /home/patrick/repos/trajserver/trajhttpserv)
==4015== by 0x4824AB: updateRealtimeReaders(std::vector<GtfsRealTimeReader, std::allocator<GtfsRealTimeReader> >*, unsigned int) (in /home/patrick/repos/trajserver/trajhttpserv)
==4015== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==4015==
[22/05/2014 15:21:02,241645] FATAL: CRASH HANDLED; Application has crashed due to [SIGSEGV] signal
Again, this crash happens every time I try to parse some random string as a GTFS-realtime protobuf feed.
I reproduced the segfault on three different machines: a Ubuntu 13.10 machine with libprotoc 2.4.1, a Ubuntu 14.04 machine with libprotoc 2.5.0 and a Debian machine with libprotoc 2.4.1. I tried different c++ version, Ii tried -O1, -O2, -O3, I tried fixing the
gtfs-realtime.pb.cc line by hand, I played around with the protoc parameters, I compiled and installed libprotoc 2.5.0 by hand on all 3 machines, I tried parsing the feed from a stream and from a string, I created an application that only reads
http://www.google.com and feeds it to parseFromString() function - the behaviour is always exactly the same: no problem on well-formed data, segfault on bad data.
I am using the original gtfs-realtime.proto file from the GTFS realtime page.
Anyone?