Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DBD-Oracle CPAN distribution.

Report information
The Basics
Id: 30910
Status: resolved
Priority: 0/
Queue: DBD-Oracle

People
Owner: champoux [...] pythian.com
Requestors: bbobcik [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.22



Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 094CF4D806F for <bug-DBD-Oracle [...] rt.cpan.org>; Thu, 22 Nov 2007 02:26:00 -0500 (EST)
Received: (qmail 8351 invoked by alias); 22 Nov 2007 07:26:00 -0000
Received: from wa-out-1112.google.com (HELO wa-out-1112.google.com) (209.85.146.177) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Wed, 21 Nov 2007 23:25:57 -0800
Received: by wa-out-1112.google.com with SMTP id m28so3345468wag for <bug-DBD-Oracle [...] rt.cpan.org>; Wed, 21 Nov 2007 23:25:53 -0800 (PST)
Received: by 10.114.78.1 with SMTP id a1mr1865470wab.1195716352939; Wed, 21 Nov 2007 23:25:52 -0800 (PST)
Received: by 10.114.67.20 with HTTP; Wed, 21 Nov 2007 23:25:52 -0800 (PST)
Delivered-To: cpan-bug+dbd-oracle [...] diesel.bestpractical.com
MIME-Version: 1.0
Subject: DBD-Oracle crashes when trying to read empty LOB
Domainkey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=S8mwAgWHUKB3tWKIVuL3mX6VKfLWwVrNUubd63+NDzqHGbbrto1LF0UHyKmeZ5VTSUShEoWV6XvfDu9UybgF6WgiiAB/Qfhl+17lUrxBaPYYxni5yPOtyxv5nBUK6zsGcL8OeNrqAYaEydWCEaTHPKmDCYeX1/Y1SjqsEm06Yb4=
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VERIFIED,DK_SIGNED,SPF_PASS
Return-Path: <bbobcik [...] gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=9C7advqp7v9lRneDyENZC9ghALNtlHS8gR8okTbKYME=; b=OOGjmoQpZ8M3CPCeEWuWdOdzKsAF26w7KtjuDzd+gAwJyOC7/ExkVTDYzx2MCm4UHmvhZD6NMvdI5RAg6lD9AACYnTEHTB17sC86vI1ne1YPcLbRyh+hsox9RcWp+Gmwg2U5rlkm4KLxVBYuyebClHwZBBhUF/LUI/AqOEohVfM=
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: bug-DBD-Oracle [...] rt.cpan.org
Content-Disposition: inline
Date: Thu, 22 Nov 2007 08:25:52 +0100
Message-Id: <13de9430711212325t267f889av8924def9724c615f [...] mail.gmail.com>
content-type: text/plain; charset="utf-8"
To: bug-DBD-Oracle [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: "Boleslav Bobcik" <bbobcik [...] gmail.com>
X-RT-Original-Encoding: ISO-8859-1
Content-Length: 1018
Download (untitled) / with headers
text/plain 1018b
Module: DBD::Oracle (version 1.19 and lower) OS: WinXP Interpreter: ActiveState Perl 5.8.8 Symptoms: When trying to retrieve LOB data, where length of LOB is 0, ora_lob_read() crashes the interpreter with invalid memory access. Cause: Looking at the debugged code, I think that the problem is at the line 312 of Oracle.xs: dest_sv = sv_2mortal(newSV(length*4)); /*LAB: crude hack that works... tim did it else where XXX */ Apparently, when length==0, the resulting dest_sv is NULL and subseqent access to it is invalid. I haven't an access to different platform than Windows, therefore I am unable to verify this behaviour in other environments. It is possible to use the following workaround, but in my opinion it's just a case of "ugly hacks escalation": $lob_size = $dbh->ora_lob_length($lob_locator); $lob = $dbh->ora_lob_read($lob_locator, 1, $lob_size+1); However I believe that the problem should be quite easy to fix (e.g. early return when length is zero). --Boleslav Bobcik bbobcik@gmail.com
MIME-Version: 1.0
In-Reply-To: <13de9430711212325t267f889av8924def9724c615f [...] mail.gmail.com>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Charset: utf8
References: <13de9430711212325t267f889av8924def9724c615f [...] mail.gmail.com>
Message-Id: <rt-3.6.HEAD-2083-1200671415-1649.30910-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 107
Download (untitled) / with headers
text/plain 107b
Ok I am going to have a look at it and see if I can recreate your problem and if you suggested patch works
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-2083-1200671415-1649.30910-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Charset: utf8
References: <13de9430711212325t267f889av8924def9724c615f [...] mail.gmail.com> <rt-3.6.HEAD-2083-1200671415-1649.30910-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.6.HEAD-2081-1200681148-1752.30910-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 146
Download (untitled) / with headers
text/plain 146b
I have recreated the error with this result DBD::Oracle::db::ora_lob_read: locator is not of type OCILobLocatorPtr at lob_empty2.pl line 29.
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-2081-1200681148-1752.30910-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Charset: utf8
References: <13de9430711212325t267f889av8924def9724c615f [...] mail.gmail.com> <rt-3.6.HEAD-2083-1200671415-1649.30910-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-2081-1200681148-1752.30910-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.6.HEAD-25281-1203107071-920.30910-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
From: pause [...] pythian.com
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 240
Download (untitled) / with headers
text/plain 240b
A little more complicated than that I can solve the problem for 1 case but then it breask for all the others (typical OCI) I will work on it some more later next week. Do you have any code SQL PERL that recreates this bug exactly Cheers
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-25281-1203107071-920.30910-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Charset: utf8
References: <13de9430711212325t267f889av8924def9724c615f [...] mail.gmail.com> <rt-3.6.HEAD-2083-1200671415-1649.30910-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-2081-1200681148-1752.30910-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-25281-1203107071-920.30910-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.6.HEAD-4645-1203447450-977.30910-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
From: pause [...] pythian.com
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 1519
Download (untitled) / with headers
text/plain 1.4k
Well after stumbling about in the dark for the past few days I stumblemd on it if you read part II Chapter 4 of the Database Application Developer's Guide - Large Objects 10g Release 1 (10.1) http://www.acs.ilstu.edu/docs/oracle/appdev.101/b10796/adlob_ta.htm if you read under the heading Setting a Persistent LOB to NULL " You may want to set a persistent LOB value to NULL upon inserting the row in cases where you do not have the LOB data at the time of the INSERT or if you want to use a SELECT statement, such as the following, to determine whether the LOB holds a NULL value: SELECT COUNT (*) FROM print_media WHERE ad_graphic IS NOT NULL; SELECT COUNT (*) FROM print_media WHERE ad_graphic IS NULL; Note that you cannot call OCI or DBMS_LOB functions on a NULL LOB, so you must then use an SQL UPDATE statement to reset the LOB column to a non-NULL (or empty) value. The point is that you cannot make a function call from the supported programmatic environments on a LOB that is NULL. These functions only work with a locator, and if the LOB column is NULL, then there is no locator in the row." So basiclly thier is nothing that OCI (DBD) can do in this case. If I return empty (or early) I would imply that the field's value would be non-NULL (or empty) not NULL LOB and that would be in error. At present DBD::Oracle will error out with the error that the field value is not OCILobLocatorPtr. I will update the POD to reflect this Therefore there is not change that needs to
MIME-Version: 1.0
In-Reply-To: <13de9430711212325t267f889av8924def9724c615f [...] mail.gmail.com>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Charset: utf8
References: <13de9430711212325t267f889av8924def9724c615f [...] mail.gmail.com>
Message-Id: <rt-3.6.HEAD-4609-1203447591-1804.30910-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 55
Normal operaion of OCI will update POD to reflect this.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.