Hey Toby,
I wrote the shared_ptr some years ago (inspired by some code found on the
internet), so it's not impossible that a couple of bugs sneaked in. The
first thing to do is to use C++11 and to replace the whole content of
viennacl/tools/shared_ptr.hpp by:
template<class T> using shared_ptr = std::shared_ptr<T>;
and see if the problem is still here ^^
Philippe
2013/12/21 Toby St Clere Smithe <m...@tsmithe.net>
> So having split up my sources, I'm having trouble with shared
> pointers. It seems that because of the way the sources have been split
> into a number of functions, some pointer goes out of scope and gets
> dereferenced twice.. I'm not sure the problem is in ViennaCL, but
> something tricky is happening here at the interface between Python,
> Boost and ViennaCL..
>
> (gdb) bt
> #0 0x00007ffff7829f59 in __GI_raise (sig=sig@entry=6) at
> ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> #1 0x00007ffff782d368 in __GI_abort () at abort.c:89
> #2 0x00007ffff7866b74 in __libc_message (do_abort=do_abort@entry=2,
> fmt=fmt@entry=0x7ffff7977d50 "*** Error in `%s': %s: 0x%s ***\n")
> at ../sysdeps/posix/libc_fatal.c:175
> #3 0x00007ffff787363a in malloc_printerr (ptr=<optimised out>,
> str=0x7ffff7977f10 "double free or corruption (!prev)", action=3) at
> malloc.c:4924
> #4 _int_free (av=<optimised out>, p=<optimised out>, have_lock=0) at
> malloc.c:3780
> #5 0x00007ffff396fa45 in viennacl::tools::shared_ptr<char>::dec
> (this=<optimised out>) at
> /home/toby/src/viennacl/pyviennacl-dev/viennacl/tools/shared_ptr.hpp:146
> #6 0x00007ffff3972df1 in ~shared_ptr (this=<optimised out>,
> __in_chrg=<optimised out>) at
> /home/toby/src/viennacl/pyviennacl-dev/viennacl/tools/shared_ptr.hpp:102
> #7 ~mem_handle (this=<optimised out>, __in_chrg=<optimised out>) at
> /home/toby/src/viennacl/pyviennacl-dev/viennacl/backend/mem_handle.hpp:62
> #8 ~vector_base (this=<optimised out>, __in_chrg=<optimised out>) at
> /home/toby/src/viennacl/pyviennacl-dev/viennacl/vector.hpp:359
> #9 ~vector (this=<optimised out>, __in_chrg=<optimised out>) at
> /home/toby/src/viennacl/pyviennacl-dev/viennacl/vector.hpp:996
> ....
>
> Basically, until I've sorted this out, you won't have much luck with
> testing the Ubuntu packages, if you're intending to give them a go!
>
> Ciao,
>
> Toby
>
>
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> ViennaCL-devel mailing list
> ViennaCL-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/viennacl-devel
>
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
ViennaCL-devel mailing list
ViennaCL-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viennacl-devel