[protobuf] Issue 625 in protobuf: Exception safety issues in RepeatedPtrField

2014-04-01 Thread protobuf

Status: New
Owner: liuj...@google.com
Labels: Type-Defect Priority-Medium

New issue 625 by f.volej...@gmail.com: Exception safety issues in  
RepeatedPtrField

http://code.google.com/p/protobuf/issues/detail?id=625

Hello,

the method RepeatedPtrFieldBase::Add has a exception safety problem, which  
reveals itself when TypeHandler::New throws an exception (for example out  
of memory exceptions).


The result is that allocated_size_ gets incremented, but the elements_  
array does not get the element initialized, leading to segmentation faults  
when working with the repeated ptr field or upon it's destruction.


I propose a fix fir this issue by incrementing the allocated_size_ only  
after the allocation succeeds.


Attachments:
exception_safety.patch  516 bytes

--
You received this message because this project is configured to send all  
issue notifications to this address.

You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Re: Issue 434 in protobuf: With PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp, parent object deleted while child still exists: causes segmentation fault

2014-04-01 Thread protobuf


Comment #10 on issue 434 by adam.gra...@upverter.com: With  
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp, parent object deleted while  
child still exists: causes segmentation fault

http://code.google.com/p/protobuf/issues/detail?id=434

A fix for this is crucial for us.  I would be tempted to roll our own  
reference-managed CPP implementation for Python if I didn't know a fix  
already existed internally.  It's Q2 2014... any thoughts on when we might  
see this?


--
You received this message because this project is configured to send all  
issue notifications to this address.

You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.