You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/04/17 21:58:03 UTC

[GitHub] nickva commented on issue #1286: badarg in mp_parse_atts leading to memory leak with replications of DBs with larger docs/attachments

nickva commented on issue #1286: badarg in mp_parse_atts leading to memory leak with replications of DBs with larger docs/attachments
URL: https://github.com/apache/couchdb/issues/1286#issuecomment-382166890
 
 
   Great find, @wohali !
   
   The call to length is blowing up at https://github.com/apache/couchdb/blob/master/src/couch/src/couch_httpd_multipart.erl#L92
   
   Somehow we call `length(3)` on it as seen in the log line. The `Counters` is an orddict (implemented as a list). 
   
   However in `eof` parsing stage, when writers are removed, the `C2` from `remove_writer` https://github.com/apache/couchdb/blob/master/src/couch/src/couch_httpd_multipart.erl#L115
   doesn't return a list but a number or `abort_parsing` atom: https://github.com/apache/couchdb/blob/master/src/couch/src/couch_httpd_multipart.erl#L225. The value is 3 because N is not put into process dictionary as 3-1=2 and `put` returns the previous value which was 3.
   
   The change was introduced by this commit: https://github.com/apache/couchdb/commit/083239353e919e897b97e8a96ee07cb42ca4eccd

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services