Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id BED611335B36 for ; Fri, 19 Nov 2010 22:01:06 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 43391-10 for ; Sat, 20 Nov 2010 02:01:01 +0000 (UTC) Received: from pgfoundry.org (pgfoundry.org [200.46.204.130]) by mail.postgresql.org (Postfix) with ESMTP id 5DEE71337B77 for ; Fri, 19 Nov 2010 22:00:59 -0400 (AST) Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by pgfoundry.org (Postfix) with ESMTP id 3BC5C10710D6 for ; Sat, 20 Nov 2010 02:00:59 +0000 (UTC) Received: from pgfoundry.org ([200.46.204.130]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 97450-02; Sat, 20 Nov 2010 02:00:51 +0000 (UTC) Received: by pgfoundry.org (Postfix, from userid 80) id 84A041071031; Sat, 20 Nov 2010 02:00:51 +0000 (UTC) To: noreply@pgfoundry.org From: Subject: [ psqlodbc-Bugs-1010945 ] uninitialised value in QR_Constructor Content-type: text/plain; charset=UTF-8 Message-Id: <20101120020051.84A041071031@pgfoundry.org> Date: Sat, 20 Nov 2010 02:00:51 +0000 (UTC) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/29 X-Sequence-Number: 10514 Bugs item #1010945, was opened at 2010-11-19 13:40 You can respond by visiting: http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1010945&group_id=1000125 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Arno Moore (arno) Assigned to: Nobody (None) Summary: uninitialised value in QR_Constructor Initial Comment: psqlODBC version: 09.00.0200 The driver is compiled from source under Linux with Kernel 2.6.22 (glibc 2.6.1, gcc 4.2.1). While examining our program with valgrind, i'm getting the following error: ==8454== Conditional jump or move depends on uninitialised value(s) ==8454== at 0x59072DD: QR_set_rowstart_in_cache (qresult.c:113) ==8454== by 0x590810C: QR_Constructor (qresult.c:165) ==8454== by 0x58ECEC9: CC_send_query_append (connection.c:2742) ==8454== by 0x58F1323: CC_commit (connection.c:512) [..] ==8454== Uninitialised value was created by a heap allocation ==8454== at 0x4022C13: malloc (vg_replace_malloc.c:195) ==8454== by 0x590807C: QR_Constructor (qresult.c:138) ==8454== by 0x58ECEC9: CC_send_query_append (connection.c:2742) ==8454== by 0x58F1323: CC_commit (connection.c:512) This belongs to the function "QResultClass *QR_Constructor()" in qresult.c. QR_set_rowstart_in_cache(rv, -1) is called before rv->flags = 0 is set and so QR_set_rowstart_in_cache evaluates the value of rv->flags in QR_synchronize_keys while it isn't initialised yet. Setting rv->flags = 0 before calling QR_set_rowstart_in_cache fixed the problem for me. Thanks Arno Moore ---------------------------------------------------------------------- >Comment By: Hiroshi Inoue (hinoue) Date: 2010-11-20 02:00 Message: Thanks for the report. I would commit the fix to cvs. ---------------------------------------------------------------------- You can respond by visiting: http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1010945&group_id=1000125