List Info

Thread: Possible Memory Leak




Possible Memory Leak
user name
2006-07-30 13:19:35
Linux Godfather wrote:
> Dear list,
> 
> there is a possible 12 bytes memory leak inside
ZOOM_resultset_records
> 
> attached is c program that reproduce the leak.
> also i attached valgrind output.
> 
We are unable to reproduce this. Version of YAZ?

If the server could be made available so that we can use the
test 
program exactly as it is,.. it'd be nice.

/ Adam

> Regards,
> 
> 
> 
> 
> 
> 
> 
>
------------------------------------------------------------
------------
> 
> #include <yaz/zoom.h>
> #include <stdio.h>
> 
> int main()
> {
> 	ZOOM_options o = ZOOM_options_create ();
> 	ZOOM_options_set (o, "databaseName",
"testdb");
> 	ZOOM_options_set (o, "start",
"0");
> 	ZOOM_options_set (o, "count",
"10");
> 	ZOOM_options_set (o,
"preferredRecordSyntax", "XML");
> 
> 	ZOOM_connection z = ZOOM_connection_create (o);
> 	ZOOM_connection_connect(z,
"test_server.bigcluster10.com", 9005);
> 	ZOOM_resultset r = ZOOM_connection_search_pqf (z,
"attr 2=102 test" );
> 	
> 	int error;
> 	const char *errmsg, *addinfo;
> 	if ( (error = ZOOM_connection_error(z, &errmsg,
&addinfo)) )
> 		fprintf (stderr, "error: %s (%d) %s\n", 
errmsg, error, addinfo);
> 	else
> 	{
> 		int hits = ZOOM_resultset_size(r);
> 		int pos;
> 		int len;
> 		printf ("%d hits\n", hits);
> 		ZOOM_record recs[10];
> 		ZOOM_resultset_records (r, recs, 0, 10);
> 		
> 		for (pos = 0; pos < 10 && pos < hits;
pos++)
> 		{
> 			const char *render = ZOOM_record_get (recs[pos],
"render", &len);
> 			// handle the hit
> 		}
> 		
> 		
> 	}
> 	
> 	ZOOM_resultset_destroy(r);
> 	ZOOM_options_destroy(o);
> 	ZOOM_connection_destroy(z);
> 	
> 	return 0;
> }
> 
> 
>
------------------------------------------------------------
------------
> 
> _______________________________________________
> Yazlist mailing list
> Yazlistlists.indexdata.dk
> http://lists.indexdata.dk/cgi-bin/mailman/listinfo/yaz
list


_______________________________________________
Yazlist mailing list
Yazlistlists.indexdata.dk
http://lists.indexdata.dk/cgi-bin/mailman/listinfo/yaz
list
Possible Memory Leak
user name
2006-08-22 08:34:00

sorry it was an old release (2.1.8), i was counting one some one else to install latest version, but it seems he installed an old release.

after updating to latest Yaz version 2.1.26 (No Memory Leak).

Thanks.

On 7/30/06, Adam Dickmeiss <indexdata.dk">adamindexdata.dk> wrote:
Linux Godfather wrote:
>; Dear list,
>
> there is a possible 12 bytes memory leak inside ZOOM_resultset_records
>
> attached is c program that reproduce the leak.
> also i attached valgrind output.
&gt;
We are unable to reproduce this. Version of YAZ?

If the server could be made available so that we can use the test
program exactly as it is,.. it'd be nice.

/ Adam

> Regards,
&gt;
>
&gt;
>
&gt;
>
>;
> ------------------------------------------------------------------------
>;
> #include <yaz/zoom.h>
&gt; #include <stdio.h>
>
> int main()
&gt; {
>&nbsp; &nbsp; &nbsp;  ZOOM_options o = ZOOM_options_create ();
>&nbsp; &nbsp;   ; ZOOM_options_set (o, "databaseName&quot;, "testdb");
> &nbsp;   ;  ZOOM_options_set (o, "start", "0&quot;);
>  ; &nbsp; &nbsp; ZOOM_options_set (o, "count", "10&quot;);
>  ; &nbsp; &nbsp; ZOOM_options_set (o, "preferredRecordSyntax";, "XML&quot;);
>;
; &nbsp; &nbsp;  ZOOM_connection z = ZOOM_connection_create (o);
>  ; &nbsp; &nbsp; ZOOM_connection_connect(z, "test_server.bigcluster10.com", 9005);
>; &nbsp; &nbsp; &nbsp; ZOOM_resultset r = ZOOM_connection_search_pqf (z, "attr 2=102 test" );
>
&gt; &nbsp; &nbsp; &nbsp; int error;
&gt; &nbsp; &nbsp; &nbsp; const char *errmsg, *addinfo;
> &nbsp;   ;  if ( (error = ZOOM_connection_error(z, &errmsg, &addinfo)) )
>&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; fprintf (stderr, "error: %s (%d) %s\n", &nbsp;errmsg, error, addinfo);
  ; &nbsp;  else
>&nbsp;   ; &nbsp; {
>&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; int hits = ZOOM_resultset_size(r);
>&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; int pos;
>&nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   int len;
>&nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   printf ("%d hits\n&quot;, hits);
>; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp;  ZOOM_record recs[10];
  ; &nbsp; &nbsp; &nbsp; &nbsp;   ; ZOOM_resultset_records (r, recs, 0, 10);
>
> &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  for (pos = 0; pos < 10 && pos < hits; pos++)
>; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp;  {
>&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ;  const char *render = ZOOM_record_get (recs[pos], "render", &len);
; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   // handle the hit
>&nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp; }
>
>;
; &nbsp; &nbsp;  }
>
>; &nbsp; &nbsp; &nbsp; ZOOM_resultset_destroy(r);
>&nbsp;   ; &nbsp; ZOOM_options_destroy(o);
>&nbsp; &nbsp; &nbsp;  ZOOM_connection_destroy(z);
>;
; &nbsp; &nbsp;  return 0;
> }
>
>;
> ------------------------------------------------------------------------
>;
> _______________________________________________
> Yazlist mailing list
> lists.indexdata.dk">Yazlistlists.indexdata.dk
&gt; http://lists.indexdata.dk/cgi-bin/mailman/listinfo/yazlist


_______________________________________________
Yazlist mailing list
lists.indexdata.dk">Yazlistlists.indexdata.dk
http://lists.indexdata.dk/cgi-bin/mailman/listinfo/yazlist

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )