Re: [gnome-db] Newbie question: do why I get this memory leak?
silvioprog <[email protected]> Thu, 26 Jan 2017 23:55:40 -0300
| Newsgroups | gmane.comp.gnome.db |
|---|---|
| Message-ID | <CAKq_V2+-bRFBQO-f9PcwcqoxOjbXx3PBpD49_pqu8qetqWe7Kg@mail.gmail.com> |
--===============8179014961490117066==
Content-Type: multipart/alternative; boundary=001a113e2dc045b65605470a9cdc
--001a113e2dc045b65605470a9cdc
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Same problem in full example:
https://developer.gnome.org/libgda/stable/main_example.html . :-/
ref | name | price
------+-------+---------
p1 | chair | 2.000000
p2 | table | 5.000000
p3 | glass | 1.100000
p1000 | ??? | NULL
p1001 | ??? | NULL
(5 rows)
ref | name | price
------+---------+---------
p1 | chair | 2.000000
p2 | table | 5.000000
p3 | glass | 1.100000
p1000 | flowers | 1.990000
p1001 | ??? | NULL
(5 rows)
ref | name | price
------+---------+---------
p1 | chair | 2.000000
p3 | glass | 1.100000
p1000 | flowers | 1.990000
(3 rows)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D9425=3D=3DERROR: LeakSanitizer: detected memory leaks
Direct leak of 72 byte(s) in 3 object(s) allocated from:
#0 0x7f61eb99acdd in __interceptor_calloc
(/usr/lib/x86_64-linux-gnu/liblsan.so.0+0xccdd)
#1 0x7f61eb6cc780 in g_malloc0
(/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x4f780)
Direct leak of 15 byte(s) in 3 object(s) allocated from:
#0 0x7f61eb99a795 in __interceptor_malloc
(/usr/lib/x86_64-linux-gnu/liblsan.so.0+0xc795)
#1 0x7f61e9cf5521 in xmlStrdup
(/usr/lib/x86_64-linux-gnu/libxml2.so.2+0xd4521)
Indirect leak of 10 byte(s) in 1 object(s) allocated from:
#0 0x7f61eb99a795 in __interceptor_malloc
(/usr/lib/x86_64-linux-gnu/liblsan.so.0+0xc795)
#1 0x7f61eb6cc728 in g_malloc
(/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x4f728)
SUMMARY: LeakSanitizer: 97 byte(s) leaked in 7 allocation(s).
Process finished with exit code 23
On Thu, Jan 26, 2017 at 11:16 PM, silvioprog <[email protected]> wrote:
> Hello masters, I'm newbie here.
>
> Well, I need to develop a DB application, so libgda will help me a lot in
> that task. However, doing some two basic tests, I found memory in both:
>
> #include <libgda.h>
>
> int main() {
> GdaConnection *connection;
> g_print("CONNECTING\n");
> connection =3D gda_connection_open_from_dsn("calvaris", NULL, GDA_CON=
NECTION_OPTIONS_READ_ONLY, NULL);
> if (!connection) {
> g_print("CONNECTION FAILED\n");
> return EXIT_FAILURE;
> }
> g_print("CONNECTED\n");
> g_object_unref(G_OBJECT (connection));
> return EXIT_SUCCESS;
> }
>
> result:
>
> CONNECTING
> CONNECTION FAILED
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> =3D=3D6364=3D=3DERROR: LeakSanitizer: detected memory leaks
>
> Direct leak of 72 byte(s) in 3 object(s) allocated from:
> #0 0x7fa242cd0cdd in __interceptor_calloc
> (/usr/lib/x86_64-linux-gnu/liblsan.so.0+0xccdd)
> #1 0x7fa242a02780 in g_malloc0 (/lib/x86_64-linux-gnu/libglib
> -2.0.so.0+0x4f780)
>
> Indirect leak of 10 byte(s) in 1 object(s) allocated from:
> #0 0x7fa242cd0795 in __interceptor_malloc
> (/usr/lib/x86_64-linux-gnu/liblsan.so.0+0xc795)
> #1 0x7fa242a02728 in g_malloc (/lib/x86_64-linux-gnu/libglib
> -2.0.so.0+0x4f728)
>
> SUMMARY: LeakSanitizer: 82 byte(s) leaked in 4 allocation(s).
>
> Process finished with exit code 23
>
> Same leak using a valid connection:
>
> #include <libgda.h>
>
> int main() {
> GdaConnection *connection;
> g_print("CONNECTING\n");
> connection =3D gda_connection_open_from_string("SQLite", "DB_DIR=3D.;=
DB_NAME=3Dtest.sqlite3", NULL, GDA_CONNECTION_OPTIONS_NONE, NULL);
> if (!connection) {
> g_print("CONNECTION FAILED\n");
> return EXIT_FAILURE;
> }
> g_print("CONNECTED\n");
> g_object_unref(G_OBJECT (connection));
> return EXIT_SUCCESS;
> }
>
> result:
>
> CONNECTING
> CONNECTED
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> =3D=3D6734=3D=3DERROR: LeakSanitizer: detected memory leaks
>
> Direct leak of 72 byte(s) in 3 object(s) allocated from:
> #0 0x7f4f60ea3cdd in __interceptor_calloc
> (/usr/lib/x86_64-linux-gnu/liblsan.so.0+0xccdd)
> #1 0x7f4f60bd5780 in g_malloc0 (/lib/x86_64-linux-gnu/libglib
> -2.0.so.0+0x4f780)
>
> Indirect leak of 10 byte(s) in 1 object(s) allocated from:
> #0 0x7f4f60ea3795 in __interceptor_malloc
> (/usr/lib/x86_64-linux-gnu/liblsan.so.0+0xc795)
> #1 0x7f4f60bd5728 in g_malloc (/lib/x86_64-linux-gnu/libglib
> -2.0.so.0+0x4f728)
>
> SUMMARY: LeakSanitizer: 82 byte(s) leaked in 4 allocation(s).
>
> Process finished with exit code 23
>
> Why?! :-/
>
> My CMake file:
>
> cmake_minimum_required(VERSION 3.6)
> project(testes)
>
> set(CMAKE_C_STANDARD 99)
>
> set(CMAKE_C_FLAGS "-g -fsanitize=3Dleak")
>
> add_definitions(-I/usr/local/include/libgda-5.0)
> add_definitions(-I/usr/local/include/libgda-5.0/libgda)
> add_definitions(-I/usr/include/glib-2.0)
> add_definitions(-I/usr/lib/x86_64-linux-gnu/glib-2.0/include)
> add_definitions(-I/usr/include/libxml2)
>
> set(SOURCE_FILES main.c)
> add_executable(testes ${SOURCE_FILES})
> target_link_libraries(testes pthread glib-2.0 gobject-2.0 gda-5.0)
>
> My environment:
>
> OS Xubuntu 16.04 64 bits
> gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
> $ pkg-config glib-2.0 libgda-5.0 --modversion
> 2.48.1
> 5.2.4
>
> Thank you!
>
> --
> Silvio Cl=C3=A9cio
>
--=20
Silvio Cl=C3=A9cio
--001a113e2dc045b65605470a9cdc
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Same problem in full example:=C2=A0<a href=3D"https://deve=
loper.gnome.org/libgda/stable/main_example.html">https://developer.gnome.or=
g/libgda/stable/main_example.html</a> . :-/<br><div class=3D"gmail_extra"><=
br></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><font face=
=3D"monospace, monospace" size=3D"1">ref =C2=A0 | name =C2=A0| price =C2=A0=
=C2=A0</font></div><div class=3D"gmail_extra"><font face=3D"monospace, mono=
space" size=3D"1">------+-------+---------</font></div><div class=3D"gmail_=
extra"><font face=3D"monospace, monospace" size=3D"1">p1 =C2=A0 =C2=A0| cha=
ir | 2.000000</font></div><div class=3D"gmail_extra"><font face=3D"monospac=
e, monospace" size=3D"1">p2 =C2=A0 =C2=A0| table | 5.000000</font></div><di=
v class=3D"gmail_extra"><font face=3D"monospace, monospace" size=3D"1">p3 =
=C2=A0 =C2=A0| glass | 1.100000</font></div><div class=3D"gmail_extra"><fon=
t face=3D"monospace, monospace" size=3D"1">p1000 | ??? =C2=A0 | =C2=A0 =C2=
=A0 NULL</font></div><div class=3D"gmail_extra"><font face=3D"monospace, mo=
nospace" size=3D"1">p1001 | ??? =C2=A0 | =C2=A0 =C2=A0 NULL</font></div><di=
v class=3D"gmail_extra"><font face=3D"monospace, monospace" size=3D"1">(5 r=
ows)</font></div><div class=3D"gmail_extra"><font face=3D"monospace, monosp=
ace" size=3D"1">ref =C2=A0 | name =C2=A0 =C2=A0| price =C2=A0=C2=A0</font><=
/div><div class=3D"gmail_extra"><font face=3D"monospace, monospace" size=3D=
"1">------+---------+---------</font></div><div class=3D"gmail_extra"><font=
face=3D"monospace, monospace" size=3D"1">p1 =C2=A0 =C2=A0| chair =C2=A0 | =
2.000000</font></div><div class=3D"gmail_extra"><font face=3D"monospace, mo=
nospace" size=3D"1">p2 =C2=A0 =C2=A0| table =C2=A0 | 5.000000</font></div><=
div class=3D"gmail_extra"><font face=3D"monospace, monospace" size=3D"1">p3=
=C2=A0 =C2=A0| glass =C2=A0 | 1.100000</font></div><div class=3D"gmail_ext=
ra"><font face=3D"monospace, monospace" size=3D"1">p1000 | flowers | 1.9900=
00</font></div><div class=3D"gmail_extra"><font face=3D"monospace, monospac=
e" size=3D"1">p1001 | ??? =C2=A0 =C2=A0 | =C2=A0 =C2=A0 NULL</font></div><d=
iv class=3D"gmail_extra"><font face=3D"monospace, monospace" size=3D"1">(5 =
rows)</font></div><div class=3D"gmail_extra"><font face=3D"monospace, monos=
pace" size=3D"1">ref =C2=A0 | name =C2=A0 =C2=A0| price =C2=A0=C2=A0</font>=
</div><div class=3D"gmail_extra"><font face=3D"monospace, monospace" size=
=3D"1">------+---------+---------</font></div><div class=3D"gmail_extra"><f=
ont face=3D"monospace, monospace" size=3D"1">p1 =C2=A0 =C2=A0| chair =C2=A0=
| 2.000000</font></div><div class=3D"gmail_extra"><font face=3D"monospace,=
monospace" size=3D"1">p3 =C2=A0 =C2=A0| glass =C2=A0 | 1.100000</font></di=
v><div class=3D"gmail_extra"><font face=3D"monospace, monospace" size=3D"1"=
>p1000 | flowers | 1.990000</font></div><div class=3D"gmail_extra"><font fa=
ce=3D"monospace, monospace" size=3D"1">(3 rows)</font></div><div class=3D"g=
mail_extra"><font face=3D"monospace, monospace" size=3D"1"><br></font></div=
><div class=3D"gmail_extra"><font face=3D"monospace, monospace" size=3D"1">=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</font></div><div class=3D"gma=
il_extra"><font face=3D"monospace, monospace" size=3D"1">=3D=3D9425=3D=3DER=
ROR: LeakSanitizer: detected memory leaks</font></div><div class=3D"gmail_e=
xtra"><font face=3D"monospace, monospace" size=3D"1"><br></font></div><div =
class=3D"gmail_extra"><font face=3D"monospace, monospace" size=3D"1">Direct=
leak of 72 byte(s) in 3 object(s) allocated from:</font></div><div class=
=3D"gmail_extra"><font face=3D"monospace, monospace" size=3D"1">=C2=A0 =C2=
=A0 #0 0x7f61eb99acdd in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/li=
blsan.so.0+0xccdd)</font></div><div class=3D"gmail_extra"><font face=3D"mon=
ospace, monospace" size=3D"1">=C2=A0 =C2=A0 #1 0x7f61eb6cc780 in g_malloc0 =
(/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x4f780)</font></div><div class=3D"=
gmail_extra"><font face=3D"monospace, monospace" size=3D"1"><br></font></di=
v><div class=3D"gmail_extra"><font face=3D"monospace, monospace" size=3D"1"=
>Direct leak of 15 byte(s) in 3 object(s) allocated from:</font></div><div =
class=3D"gmail_extra"><font face=3D"monospace, monospace" size=3D"1">=C2=A0=
=C2=A0 #0 0x7f61eb99a795 in __interceptor_malloc (/usr/lib/x86_64-linux-gn=
u/liblsan.so.0+0xc795)</font></div><div class=3D"gmail_extra"><font face=3D=
"monospace, monospace" size=3D"1">=C2=A0 =C2=A0 #1 0x7f61e9cf5521 in xmlStr=
dup (/usr/lib/x86_64-linux-gnu/libxml2.so.2+0xd4521)</font></div><div class=
=3D"gmail_extra"><font face=3D"monospace, monospace" size=3D"1"><br></font>=
</div><div class=3D"gmail_extra"><font face=3D"monospace, monospace" size=
=3D"1">Indirect leak of 10 byte(s) in 1 object(s) allocated from:</font></d=
iv><div class=3D"gmail_extra"><font face=3D"monospace, monospace" size=3D"1=
">=C2=A0 =C2=A0 #0 0x7f61eb99a795 in __interceptor_malloc (/usr/lib/x86_64-=
linux-gnu/liblsan.so.0+0xc795)</font></div><div class=3D"gmail_extra"><font=
face=3D"monospace, monospace" size=3D"1">=C2=A0 =C2=A0 #1 0x7f61eb6cc728 i=
n g_malloc (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x4f728)</font></div><di=
v class=3D"gmail_extra"><font face=3D"monospace, monospace" size=3D"1"><br>=
</font></div><div class=3D"gmail_extra"><font face=3D"monospace, monospace"=
size=3D"1">SUMMARY: LeakSanitizer: 97 byte(s) leaked in 7 allocation(s).</=
font></div><div class=3D"gmail_extra"><font face=3D"monospace, monospace" s=
ize=3D"1"><br></font></div><div class=3D"gmail_extra"><font face=3D"monospa=
ce, monospace" size=3D"1">Process finished with exit code 23</font></div><d=
iv class=3D"gmail_extra"><br></div><div class=3D"gmail_quote">On Thu, Jan 2=
6, 2017 at 11:16 PM, silvioprog <span dir=3D"ltr"><<a href=3D"mailto:sil=
[email protected]" target=3D"_blank">[email protected]</a>></span> wr=
ote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex=
;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">=
<span style=3D"font-size:12.8px">Hello masters, I'm newbie here.</span>=
<div style=3D"font-size:12.8px"><div><br></div><div>Well, I need to develop=
a DB application, so libgda will help me a lot in that task. However, doin=
g some two basic tests, I found memory in both:</div><div><pre style=3D"whi=
te-space:pre-wrap;color:rgb(0,0,0);font-family:"dejavu sans mono"=
"><font size=3D"1"><span style=3D"color:rgb(128,128,0)">#include</span><spa=
n style=3D"color:rgb(0,128,0);font-weight:bold"> <libgda.h><br></span=
><span style=3D"color:rgb(0,128,0);font-weight:bold"><br></span><span style=
=3D"color:rgb(0,0,128);font-weight:bold">int </span>main() {<br> <span s=
tyle=3D"color:rgb(55,31,128)">GdaConnection </span>*connection;<br> g_pr=
int(<span style=3D"color:rgb(0,128,0);font-weight:bold">"CONNECTING</s=
pan><span style=3D"color:rgb(0,0,128);font-weight:bold">\n</span><span styl=
e=3D"color:rgb(0,128,0);font-weight:bold">"</span>);<br> connection=
=3D gda_connection_open_from_dsn(<span style=3D"color:rgb(0,128,0);font-we=
ight:bold">"<wbr>calvaris"</span>, <span style=3D"color:rgb(31,84=
,46);font-weight:bold">NULL</span>, <span style=3D"color:rgb(102,14,122);fo=
nt-weight:bold;font-style:italic">GDA_CONNECTION_OPTIONS_READ_ON<wbr>LY</sp=
an>, <span style=3D"color:rgb(31,84,46);font-weight:bold">NULL</span>);<br>=
<span style=3D"color:rgb(0,0,128);font-weight:bold">if </span>(!connect=
ion) {<br> g_print(<span style=3D"color:rgb(0,128,0);font-weight:bol=
d">"CONNECTION FAILED</span><span style=3D"color:rgb(0,0,128);font-wei=
ght:bold">\n</span><span style=3D"color:rgb(0,128,0);font-weight:bold">&quo=
t;</span>);<br> <span style=3D"color:rgb(0,0,128);font-weight:bold">=
return </span><span style=3D"color:rgb(31,84,46);font-weight:bold">EXIT_FAI=
LURE</span>;<br> }<br> g_print(<span style=3D"color:rgb(0,128,0);font=
-weight:bold">"CONNECTED</span><span style=3D"color:rgb(0,0,128);font-=
weight:bold">\n</span><span style=3D"color:rgb(0,128,0);font-weight:bold">&=
quot;</span>);<br> g_object_unref(<span style=3D"color:rgb(31,84,46);fon=
t-weight:bold">G_OBJECT </span>(connection));<br> <span style=3D"color:r=
gb(0,0,128);font-weight:bold">return </span><span style=3D"color:rgb(31,84,=
46);font-weight:bold">EXIT_SUCCESS</span>;<br>}</font></pre></div><div>resu=
lt:</div><div><br></div><div><div><font face=3D"monospace, monospace" size=
=3D"1">CONNECTING</font></div><div><font face=3D"monospace, monospace" size=
=3D"1">CONNECTION FAILED</font></div><div><font face=3D"monospace, monospac=
e" size=3D"1"><br></font></div><div><font face=3D"monospace, monospace" siz=
e=3D"1">=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D<wbr>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<wbr>=3D=3D=3D=3D=3D</font></d=
iv><div><font face=3D"monospace, monospace" size=3D"1">=3D=3D6364=3D=3DERRO=
R: LeakSanitizer: detected memory leaks</font></div><div><font face=3D"mono=
space, monospace" size=3D"1"><br></font></div><div><font face=3D"monospace,=
monospace" size=3D"1">Direct leak of 72 byte(s) in 3 object(s) allocated f=
rom:</font></div><div><font face=3D"monospace, monospace" size=3D"1">=C2=A0=
=C2=A0 #0 0x7fa242cd0cdd in __interceptor_calloc (/usr/lib/x86_64-linux-gn=
u/lib<wbr>lsan.so.0+0xccdd)</font></div><div><font face=3D"monospace, monos=
pace" size=3D"1">=C2=A0 =C2=A0 #1 0x7fa242a02780 in g_malloc0 (/lib/x86_64-=
linux-gnu/libglib<wbr>-2.0.so.0+0x4f780)</font></div><div><font face=3D"mon=
ospace, monospace" size=3D"1"><br></font></div><div><font face=3D"monospace=
, monospace" size=3D"1">Indirect leak of 10 byte(s) in 1 object(s) allocate=
d from:</font></div><div><font face=3D"monospace, monospace" size=3D"1">=C2=
=A0 =C2=A0 #0 0x7fa242cd0795 in __interceptor_malloc (/usr/lib/x86_64-linux=
-gnu/lib<wbr>lsan.so.0+0xc795)</font></div><div><font face=3D"monospace, mo=
nospace" size=3D"1">=C2=A0 =C2=A0 #1 0x7fa242a02728 in g_malloc (/lib/x86_6=
4-linux-gnu/libglib<wbr>-2.0.so.0+0x4f728)</font></div><div><font face=3D"m=
onospace, monospace" size=3D"1"><br></font></div><div><font face=3D"monospa=
ce, monospace" size=3D"1">SUMMARY: LeakSanitizer: 82 byte(s) leaked in 4 al=
location(s).</font></div><div><font face=3D"monospace, monospace" size=3D"1=
"><br></font></div><div><font face=3D"monospace, monospace" size=3D"1">Proc=
ess finished with exit code 23</font></div></div><div><br></div><div>Same l=
eak using a valid connection:</div><div><pre style=3D"white-space:pre-wrap;=
color:rgb(0,0,0);font-family:"dejavu sans mono""><font size=3D"1"=
><span style=3D"color:rgb(128,128,0)">#include</span><span style=3D"color:r=
gb(0,128,0);font-weight:bold"> <libgda.h><br></span><span style=3D"co=
lor:rgb(0,128,0);font-weight:bold"><br></span><span style=3D"color:rgb(0,0,=
128);font-weight:bold">int </span>main() {<br> <span style=3D"color:rgb(=
55,31,128)">GdaConnection </span>*connection;<br> g_print(<span style=3D=
"color:rgb(0,128,0);font-weight:bold">"CONNECTING</span><span style=3D=
"color:rgb(0,0,128);font-weight:bold">\n</span><span style=3D"color:rgb(0,1=
28,0);font-weight:bold">"</span>);<br> connection =3D gda_connectio=
n_open_from_strin<wbr>g(<span style=3D"color:rgb(0,128,0);font-weight:bold"=
>"SQLite"</span>, <span style=3D"color:rgb(0,128,0);font-weight:b=
old">"DB_DIR=3D.;DB_NAME=3Dtest.sqlite3<wbr>"</span>, <span style=
=3D"color:rgb(31,84,46);font-weight:bold">NULL</span>, <span style=3D"color=
:rgb(102,14,122);font-weight:bold;font-style:italic">GDA_CONNECTION_OPTIONS=
_NONE</span>, <span style=3D"color:rgb(31,84,46);font-weight:bold">NULL</sp=
an>);<br> <span style=3D"color:rgb(0,0,128);font-weight:bold">if </span>=
(!connection) {<br> g_print(<span style=3D"color:rgb(0,128,0);font-w=
eight:bold">"CONNECTION FAILED</span><span style=3D"color:rgb(0,0,128)=
;font-weight:bold">\n</span><span style=3D"color:rgb(0,128,0);font-weight:b=
old">"</span>);<br> <span style=3D"color:rgb(0,0,128);font-weig=
ht:bold">return </span><span style=3D"color:rgb(31,84,46);font-weight:bold"=
>EXIT_FAILURE</span>;<br> }<br> g_print(<span style=3D"color:rgb(0,12=
8,0);font-weight:bold">"CONNECTED</span><span style=3D"color:rgb(0,0,1=
28);font-weight:bold">\n</span><span style=3D"color:rgb(0,128,0);font-weigh=
t:bold">"</span>);<br> g_object_unref(<span style=3D"color:rgb(31,8=
4,46);font-weight:bold">G_OBJECT </span>(connection));<br> <span style=
=3D"color:rgb(0,0,128);font-weight:bold">return </span><span style=3D"color=
:rgb(31,84,46);font-weight:bold">EXIT_SUCCESS</span>;<br>}</font></pre></di=
v><div>result:</div><div><br></div><div><div><font size=3D"1" face=3D"monos=
pace, monospace">CONNECTING</font></div><div><font size=3D"1" face=3D"monos=
pace, monospace">CONNECTED</font></div><div><font size=3D"1" face=3D"monosp=
ace, monospace"><br></font></div><div><font size=3D"1" face=3D"monospace, m=
onospace">=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D<wbr>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<wbr>=3D=3D=3D=3D=3D</font>=
</div><div><font size=3D"1" face=3D"monospace, monospace">=3D=3D6734=3D=3DE=
RROR: LeakSanitizer: detected memory leaks</font></div><div><font size=3D"1=
" face=3D"monospace, monospace"><br></font></div><div><font size=3D"1" face=
=3D"monospace, monospace">Direct leak of 72 byte(s) in 3 object(s) allocate=
d from:</font></div><div><font size=3D"1" face=3D"monospace, monospace">=C2=
=A0 =C2=A0 #0 0x7f4f60ea3cdd in __interceptor_calloc (/usr/lib/x86_64-linux=
-gnu/lib<wbr>lsan.so.0+0xccdd)</font></div><div><font size=3D"1" face=3D"mo=
nospace, monospace">=C2=A0 =C2=A0 #1 0x7f4f60bd5780 in g_malloc0 (/lib/x86_=
64-linux-gnu/libglib<wbr>-2.0.so.0+0x4f780)</font></div><div><font size=3D"=
1" face=3D"monospace, monospace"><br></font></div><div><font size=3D"1" fac=
e=3D"monospace, monospace">Indirect leak of 10 byte(s) in 1 object(s) alloc=
ated from:</font></div><div><font size=3D"1" face=3D"monospace, monospace">=
=C2=A0 =C2=A0 #0 0x7f4f60ea3795 in __interceptor_malloc (/usr/lib/x86_64-li=
nux-gnu/lib<wbr>lsan.so.0+0xc795)</font></div><div><font size=3D"1" face=3D=
"monospace, monospace">=C2=A0 =C2=A0 #1 0x7f4f60bd5728 in g_malloc (/lib/x8=
6_64-linux-gnu/libglib<wbr>-2.0.so.0+0x4f728)</font></div><div><font size=
=3D"1" face=3D"monospace, monospace"><br></font></div><div><font size=3D"1"=
face=3D"monospace, monospace">SUMMARY: LeakSanitizer: 82 byte(s) leaked in=
4 allocation(s).</font></div><div><font size=3D"1" face=3D"monospace, mono=
space"><br></font></div><div><font size=3D"1" face=3D"monospace, monospace"=
>Process finished with exit code 23</font></div></div><div><br></div><div>W=
hy?! :-/</div><div><br></div><div>My CMake file:</div><div><pre style=3D"wh=
ite-space:pre-wrap;color:rgb(0,0,0);font-family:"dejavu sans mono"=
;"><pre style=3D"white-space:pre-wrap;font-family:"dejavu sans mono&qu=
ot;"><font size=3D"1">cmake_minimum_required(<span style=3D"color:rgb(0,128=
,0);font-weight:bold">VERSION 3.6</span>)<br>project(<span style=3D"color:r=
gb(0,128,0);font-weight:bold">testes</span>)<br><br>set(<span style=3D"colo=
r:rgb(0,128,0);font-weight:bold">CMAKE_C_STANDARD 99</span>)<br><br>set(<sp=
an style=3D"color:rgb(0,128,0);font-weight:bold">CMAKE_C_FLAGS </span>"=
;<span style=3D"color:rgb(0,128,0);font-weight:bold">-g -fsanitize=3Dleak</=
span>")<br><br>add_definitions(<span style=3D"color:rgb(0,128,0);font-=
weight:bold">-I/usr/local/i<wbr>nclude/libgda-5.0</span>)<br>add_definition=
s(<span style=3D"color:rgb(0,128,0);font-weight:bold">-I/usr/local/i<wbr>nc=
lude/libgda-5.0/libgda</span>)<br>add_definitions(<span style=3D"color:rgb(=
0,128,0);font-weight:bold">-I/usr/include<wbr>/glib-2.0</span>)<br>add_defi=
nitions(<span style=3D"color:rgb(0,128,0);font-weight:bold">-I/usr/lib/x86<=
wbr>_64-linux-gnu/glib-2.0/include</span><wbr>)<br>add_definitions(<span st=
yle=3D"color:rgb(0,128,0);font-weight:bold">-I/usr/include<wbr>/libxml2</sp=
an>)<br><br>set(<span style=3D"color:rgb(0,128,0);font-weight:bold">SOURCE_=
FILES main.c</span>)<br>add_executable(<span style=3D"color:rgb(0,128,0);fo=
nt-weight:bold">testes ${SOURCE_FILES}</span>)<br>target_link_libraries(<sp=
an style=3D"color:rgb(0,128,0);font-weight:bold">testes pthread glib-2.0 go=
bject-2.0 gda-5.0</span>)</font></pre></pre></div><div>My environment:</div=
><div><br></div><div><font size=3D"1" face=3D"monospace, monospace">OS Xubu=
ntu 16.04 64 bits<br></font></div><div><font size=3D"1" face=3D"monospace, =
monospace">gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)<br></=
font></div><div><div><font size=3D"1" face=3D"monospace, monospace">$ pkg-c=
onfig glib-2.0 libgda-5.0 --modversion=C2=A0</font></div><div><font size=3D=
"1" face=3D"monospace, monospace">2.48.1</font></div><div><font size=3D"1" =
face=3D"monospace, monospace">5.2.4</font></div></div><div><br></div><div>T=
hank you!</div></div><span class=3D"gmail-HOEnZb"><font color=3D"#888888"><=
div><br></div>-- <br><div class=3D"gmail-m_2962400152326086368gmail_signatu=
re"><div dir=3D"ltr"><div>Silvio Cl=C3=A9cio</div></div></div>
</font></span></div>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div class=
=3D"gmail_signature"><div dir=3D"ltr"><div>Silvio Cl=C3=A9cio</div></div></=
div>
</div></div>
--001a113e2dc045b65605470a9cdc--
--===============8179014961490117066==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
gnome-db-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gnome-db-list
--===============8179014961490117066==--