Hi, Gaurav,

The issue you are encountering is likely caused by a double-deletion
-- once from the explicit delete call and once from inside FastBit
code.  You can simply remove the delete statement, your code you
should function properly and resources will be freed by the FastBit code.

Good luck.

John



On 7/3/12 7:25 AM, Gaurav Agarwal wrote:
> Hi John,
> 
> I have another beginner's question: I am trying to write a small code
> snippet to perform basic operations on table class - create a table*,
> build index, delete pointer. However, the delete step is throwing an
> error: If I remove the buildIndex step, deletion happens normally
> without any error. Any clues?
> 
> Gauravs-MacBook-Pro:src gaurav$ ./a.out
> /Users/gaurav/Downloads/ecpm
> Got pointer 0x7fcef3400940
> index built
> a.out(50365) malloc: *** error for object 0x7fcef3401d00: pointer
> being freed was not allocated
> *** set a breakpoint in malloc_error_break to debug
> Abort trap: 6
> 
> Here is the code snippet:
> 
> int main() {
>   string s("/Users/gaurav/Downloads/ecpm");
>   cout << s << endl;
>   ibis::table * table = ibis::table::create(s.c_str());
>   cout<<"Got pointer " << table << endl;
>   table->buildIndex("pub", "<binning none/><encoding equality/>");
>   cout <<"index built" <<endl;
>   delete table;
> }
> 
> -cheers,
> gaurav
> _______________________________________________
> FastBit-users mailing list
> [email protected]
> https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users
> 

_______________________________________________
FastBit-users mailing list
[email protected]
https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users

Reply via email to