[MB-7764] Reduce functions calling emit() lead to a crash Created: 17/Feb/13  Updated: 05/Apr/13  Resolved: 26/Feb/13

Status: Closed
Project: Couchbase Server
Component/s: view-engine
Affects Version/s: 2.0, 2.0.1
Fix Version/s: 2.1.0
Security Level: Public

Type: Bug Priority: Critical
Reporter: Filipe Manana Assignee: Iryna Mironava
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by MB-7787 Bad custom reduce function kills the ... Closed

 Description   
From http://www.couchbase.com/forums/thread/couchbase-2-0-systematic-crash-specific-reduce-function-beam-smp-general-protection-error0-li

Reduce functions calling emit internally cause a dangling pointer being derreferenced, which in turn leads to a crash.

 Comments   
Comment by Filipe Manana [ 17/Feb/13 ]
http://review.couchbase.org/#/c/24648/
Comment by Thuan Nguyen [ 26/Feb/13 ]
Integrated in github-couchdb-preview #566 (See [http://qa.hq.northscale.net/job/github-couchdb-preview/566/])
    MB-7764 Don't crash if reduce function calls emit() (Revision c3c0cfb9fec7e8125a5d5895fd3d5d683e3b3f78)
MB-7764 Add test for reduce functions that don't return (Revision fd661bf5daad9c02d407df44d9f818ba582cd10a)

     Result = SUCCESS
Filipe David Borba Manana :
Files :
* src/mapreduce/test/02-reduce.t
* src/mapreduce/mapreduce.cc

Filipe David Borba Manana :
Files :
* src/mapreduce/test/02-reduce.t
Comment by Filipe Manana [ 26/Feb/13 ]
Applied to 2.0.2 and master
Comment by Maria McDuff [ 05/Apr/13 ]
iryna, pls verify/close against current 2.02. build. thanks.
Comment by Iryna Mironava [ 05/Apr/13 ]
verified build 2.0.2-755-rel
Generated at Wed Apr 16 16:03:33 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.