MonetDB: Jan2014 - make sure we don't call BATappend(a,b) where ...

Sjoerd Mullender sjoerd at monetdb.org
Wed Feb 5 21:59:26 CET 2014


What happens to i after this?  It still has a heap base pointer that is
pointing into freed memory.

On 2014-02-05 20:51, Niels Nes wrote:
> Changeset: 262ad3ce2b2e for MonetDB
> URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=262ad3ce2b2e
> Modified Files:
> 	sql/storage/bat/bat_storage.c
> 	sql/test/BugTracker-2014/Tests/sample-crash.Bug-3429.stable.err
> Branch: Jan2014
> Log Message:
> 
> make sure we don't call BATappend(a,b) where b is a VIEW on a.
> 
> 
> diffs (29 lines):
> 
> diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
> --- a/sql/storage/bat/bat_storage.c
> +++ b/sql/storage/bat/bat_storage.c
> @@ -448,7 +448,12 @@ delta_append_bat( sql_delta *bat, BAT *i
>  			bat_destroy(b);
>  			b = temp_descriptor(bat->ibid);
>  		}
> -		BATappend(b, i, TRUE);
> +		if (isVIEW(i) && b->batCacheid == ABS(VIEWtparent(i))) {
> +			BAT *ic = BATcopy(i, TYPE_void, i->ttype, TRUE);
> +			BATappend(b, ic, TRUE);
> +			bat_destroy(ic);
> +		} else 
> +			BATappend(b, i, TRUE);
>  		assert(BUNlast(b) > b->batInserted);
>  		bat_destroy(b);
>  	}
> diff --git a/sql/test/BugTracker-2014/Tests/sample-crash.Bug-3429.stable.err b/sql/test/BugTracker-2014/Tests/sample-crash.Bug-3429.stable.err
> --- a/sql/test/BugTracker-2014/Tests/sample-crash.Bug-3429.stable.err
> +++ b/sql/test/BugTracker-2014/Tests/sample-crash.Bug-3429.stable.err
> @@ -28,8 +28,6 @@ stderr of test 'sample-crash.Bug-3429` i
>  # 20:54:49 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-31548" "--port=33290"
>  # 20:54:49 >  
>  
> -MAPI  = (monetdb) /var/tmp/mtest-31984/.s.monetdb.34383
> -QUERY = rollback;
>  
>  
>  
> _______________________________________________
> checkin-list mailing list
> checkin-list at monetdb.org
> https://www.monetdb.org/mailman/listinfo/checkin-list
> 

-- 
Sjoerd Mullender

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 356 bytes
Desc: OpenPGP digital signature
URL: <http://www.monetdb.org/pipermail/developers-list/attachments/20140205/0cd51533/attachment.sig>


More information about the developers-list mailing list