[cairo] Re : multithreaded bug in cairo on call to cairo stroke?
Philippe Leroux
lerouxp at yahoo.ca
Wed Dec 15 01:31:06 PST 2010
Hi cairo-community,
i didnt get any answers yet
i tried with the golang community (www.golang.org)
and i have made sure that my functions drawing to their own surface/context are
executed on different OS threads
and not multiplexed on one thread
i still get the corruption, double free error
so i guess this is a multithread issue inside cairo
can anyone help me out debug that one?
many thanks
----- Message initial ----
De : Philippe Leroux <lerouxp at yahoo.ca>
À : cairo at cairographics.org
Envoyé le : Ven 3 décembre 2010, 15h 25min 02s
Objet : [cairo] multithreaded bug in cairo on call to cairo stroke?
Dear hackers,
maybe it is just my fault somewhere, or i didn't read well the documentation
somewhere
if so, my apologies, please just point to me where i can understand my error
i am working with golang on a simulator using multiple "co-routine"
i've wrapped cairo to output graphics of the simulation
to do so, i have a number of co-routines in go which creates their own data
creates their own cairo surface, and context
and draws to them
it seems when two coroutines call to cairo_stoke at the same time
i get double free or corruption somewhere in cairo lib
*** glibc detected *** ./simu: corrupted double-linked list: 0x00007f1cbc005610
***
======= Backtrace: =========
/lib/libc.so.6(+0x72d36)[0x7f1cc83ced36]
/lib/libc.so.6(+0x74747)[0x7f1cc83d0747]
/lib/libc.so.6(cfree+0x6c)[0x7f1cc83d3acc]
/usr/lib/libpixman-1.so.0(pixman_image_unref+0x95)[0x7f1cc7da8545]
/usr/lib/libcairo.so.2(+0x643d2)[0x7f1cc80663d2]
/usr/lib/libcairo.so.2(+0x64a64)[0x7f1cc8066a64]
/usr/lib/libcairo.so.2(+0x68688)[0x7f1cc806a688]
/usr/lib/libcairo.so.2(+0xa449d)[0x7f1cc80a649d]
/usr/lib/libcairo.so.2(+0x5cbb5)[0x7f1cc805ebb5]
/usr/lib/libcairo.so.2(cairo_stroke+0x2d)[0x7f1cc804cbad]
./simu[0x402906]
======= Memory map: ========
00400000-00514000 r-xp 00000000 09:03 56074456
/home/lerouxp/go/SynStation/simu
00514000-00517000 rw-p 00114000 09:03 56074456
/home/lerouxp/go/SynStation/simu
00517000-0075d000 rw-p 00000000 00:00 0 [heap]
7f1cac000000-7f1cac04a000 rw-p 00000000 00:00 0
7f1cac04a000-7f1cb0000000 ---p 00000000 00:00 0
7f1cb4000000-7f1cb4049000 rw-p 00000000 00:00 0
7f1cb4049000-7f1cb8000000 ---p 00000000 00:00 0
7f1cb8e46000-7f1cb8e5b000 r-xp 00000000 09:02 1737013
/usr/local/lib64/libgcc_s.so.1
7f1cb8e5b000-7f1cb905a000 ---p 00015000 09:02 1737013
/usr/local/lib64/libgcc_s.so.1
7f1cb905a000-7f1cb905b000 rw-p 00014000 09:02 1737013
/usr/local/lib64/libgcc_s.so.1
7f1cb905b000-7f1cb905c000 ---p 00000000 00:00 0
7f1cb905c000-7f1cb995c000 rwxp 00000000 00:00 0
7f1cb995c000-7f1cb995d000 ---p 00000000 00:00 0
7f1cb995d000-7f1cba15d000 rwxp 00000000 00:00 0
7f1cba15d000-7f1cba57d000 rw-p 00000000 00:00 0
7f1cba57d000-7f1cba57e000 ---p 00000000 00:00 0
7f1cba57e000-7f1cbad7e000 rwxp 00000000 00:00 0
7f1cbad7e000-7f1cbad7f000 ---p 00000000 00:00 0
7f1cbad7f000-7f1cbb7ff000 rwxp 00000000 00:00 0
7f1cbb7ff000-7f1cbb800000 ---p 00000000 00:00 0
7f1cbb800000-7f1cbc000000 rwxp 00000000 00:00 0
7f1cbc000000-7f1cbc04b000 rw-p 00000000 00:00 0
7f1cbc04b000-7f1cc0000000 ---p 00000000 00:00 0
7f1cc0037000-7f1cc0337000 rwxp 00000000 00:00 0
7f1cc0337000-7f1cc0497000 rw-p 00000000 00:00 0
7f1cc0497000-7f1cc1162000 rwxp 00000000 00:00 0
7f1cc1162000-7f1cc1163000 ---p 00000000 00:00 0
7f1cc1163000-7f1cc1963000 rwxp 00000000 00:00 0
7f1cc1963000-7f1cc1964000 ---p 00000000 00:00 0
7f1cc1964000-7f1cc2164000 rwxp 00000000 00:00 0
7f1cc2164000-7f1cc2165000 ---p 00000000 00:00 0
7f1cc2165000-7f1cc2965000 rwxp 00000000 00:00 0
7f1cc2965000-7f1cc2966000 ---p 00000000 00:00 0
7f1cc2966000-7f1cc3166000 rwxp 00000000 00:00 0
7f1cc3166000-7f1cc3167000 ---p 00000000 00:00 0
7f1cc3167000-7f1cc3967000 rwxp 00000000 00:00 0
7f1cc3967000-7f1cc3968000 ---p 00000000 00:00 0
7f1cc3968000-7f1cc4168000 rwxp 00000000 00:00 0
7f1cc4168000-7f1cc4169000 ---p 00000000 00:00 0
7f1cc4169000-7f1cc4fc9000 rwxp 00000000 00:00 0
7f1cc4fc9000-7f1cc4fd1000 r-xp 00000000 09:02 1469646
/lib64/librt-2.12.1.so
7f1cc4fd1000-7f1cc51d0000 ---p 00008000 09:02 1469646
/lib64/librt-2.12.1.so
7f1cc51d0000-7f1cc51d1000 r--p 00007000 09:02 1469646
/lib64/librt-2.12.1.so
7f1cc51d1000-7f1cc51d2000 rw-p 00008000 09:02 1469646
/lib64/librt-2.12.1.so
7f1cc51d2000-7f1cc51de000 r-xp 00000000 09:02 573329
/usr/lib64/libdrm.so.2.4.0
7f1cc51de000-7f1cc53dd000 ---p 0000c000 09:02 573329
/usr/lib64/libdrm.so.2.4.0
7f1cc53dd000-7f1cc53de000 r--p 0000b000 09:02 573329
/usr/lib64/libdrm.so.2.4.0
7f1cc53de000-7f1cc53df000 rw-p 0000c000 09:02 573329
/usr/lib64/libdrm.so.2.4.0
7f1cc53df000-7f1cc53f3000 r-xp 00000000 09:02 435219
/usr/lib64/libxcb-glx.so.0.0.0
7f1cc53f3000-7f1cc55f3000 ---p 00014000 09:02 435219
/usr/lib64/libxcb-glx.so.0.0.0
7f1cc55f3000-7f1cc55f5000 r--p 00014000 09:02 435219
/usr/lib64/libxcb-glx.so.0.0.0
7f1cc55f5000-7f1cc55f6000 rw-p 00016000 09:02 435219
/usr/lib64/libxcb-glx.so.0.0.0
7f1cc55f6000-7f1cc55f7000 r-xp 00000000 09:02 1610994
/usr/lib64/libX11-xcb.so.1.0.0
7f1cc55f7000-7f1cc57f6000 ---p 00001000 09:02 1610994
/usr/lib64/libX11-xcb.so.1.0.0
7f1cc57f6000-7f1cc57f7000 r--p 00000000 09:02 1610994
/usr/lib64/libX11-xcb.so.1.0.0
7f1cc57f7000-7f1cc57f8000 rw-p 00001000 09:02 1610994
/usr/lib64/libX11-xcb.so.1.0.0
7f1cc57f8000-7f1cc57fd000 r-xp 00000000 09:02 995351
/usr/lib64/libXxf86vm.so.1.0.0
7f1cc57fd000-7f1cc59fc000 ---p 00005000 09:02 995351
/usr/lib64/libXxf86vm.so.1.0.0
7f1cc59fc000-7f1cc59fd000 r--p 00004000 09:02 995351
/usr/lib64/libXxf86vm.so.1.0.0
7f1cc59fd000-7f1cc59fe000 rw-p 00005000 09:02 995351
/usr/lib64/libXxf86vm.so.1.0.0
7f1cc59fe000-7f1cc5a03000 r-xp 00000000 09:02 1050610
/usr/lib64/libXfixes.so.3.1.0
7f1cc5a03000-7f1cc5c02000 ---p 00005000 09:02 1050610
/usr/lib64/libXfixes.so.3.1.0
7f1cc5c02000-7f1cc5c03000 r--p 00004000 09:02 1050610
/usr/lib64/libXfixes.so.3.1.0
7f1cc5c03000-7f1cc5c04000 rw-p 00005000 09:02 1050610
/usr/lib64/libXfixes.so.3.1.0
7f1cc5c04000-7f1cc5c06000 r-xp 00000000 09:02 977945
/usr/lib64/libXdamage.so.1.1.0
7f1cc5c06000-7f1cc5e05000 ---p 00002000 09:02 977945
/usr/lib64/libXdamage.so.1.1.0
7f1cc5e05000-7f1cc5e06000 r--p 00001000 09:02 977945
/usr/lib64/libXdamage.so.1.1.0
7f1cc5e06000-7f1cc5e07000 rw-p 00002000 09:02 977945
/usr/lib64/libXdamage.so.1.1.0
7f1cc5e07000-7f1cc5e1c000 r-xp 00000000 09:02 1088652
/usr/lib64/libXext.so.6.4.0
7f1cc5e1c000-7f1cc601b000 ---p 00015000 09:02 1088652
/usr/lib64/libXext.so.6.4.0
7f1cc601b000-7f1cc601c000 r--p 00014000 09:02 1088652
/usr/lib64/libXext.so.6.4.0
7f1cc601c000-7f1cc601d000 rw-p 00015000 09:02 1088652
/usr/lib64/libXext.so.6.4.0
7f1cc601d000-7f1cc601f000 r-xp 00000000 09:02 1469649
/lib64/libdl-2.12.1.so
7f1cc601f000-7f1cc621f000 ---p 00002000 09:02 1469649
/lib64/libdl-2.12.1.so
7f1cc621f000-7f1cc6220000 r--p 00002000 09:02 1469649
/lib64/libdl-2.12.1.so
7f1cc6220000-7f1cc6221000 rw-p 00003000 09:02 1469649
/lib64/libdl-2.12.1.so
7f1cc6221000-7f1cc6227000 r-xp 00000000 09:02 966322
/usr/lib64/libXdmcp.so.6.0.0SIGABRT: abort7 41 31 38 40
if i remove the calls to cairo_stroke it runs without any problems (and i don't
perfectly white pictures of course... :/)
if i set one thread to draw the output, no problem i get my pictures, but i'm
only using a fraction of my multicore cpu :(
if someone has a clue, i could post more debug info if you tell me howto
i could also provide my go code and cairo wrapping
i'm using cairo-1.10.0-r3 on gentoo
Sincerely
Philippe
--
cairo mailing list
cairo at cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo
More information about the cairo
mailing list