[database] [Database] Toward better databases

Larry Garfield larry at garfieldtech.com
Tue Jul 8 15:20:08 UTC 2008


On Tue, 8 Jul 2008 11:12:19 -0400, Barry Jaspan <barry.jaspan at acquia.com> wrote:
> This sounds like a problem with the way bindParam() is being used on
> blob params.  I noticed during initial development that if you use
> bindParam() incorrectly, it causes Apache to crash (presumably because
> bindParam() is dealing directly with internal pointers and is somehow
> trashing memory).
> 
> The specific issue I recall is that bindParam() accepts a reference to
> its argument (i.e.: a pointer) and if the referenced PHP variable goes
> out of scope before the query is executed, bang!  The problems were
> all fixed at one point but the API has changed and it is entirely
> possible they have crept back.  I never really even finished the code
> so I would not be at all surprised at this.
> 
> The fact that a seemingly unrelated query is now causing a crash is
> unsurprising.  Memory corruption bugs are like that.
> 
> So, I'd say you should ignore this until I or someone else makes a
> full pass at updating the pgsql driver.
> 
> Thanks,
> 
> Barry

Well, it is hard to take a full pass at updating the driver until we're able to actually install it. :-)  And as I said before, time is short so I'm trying to see what I can do myself in the meantime.

Also, a follow-up from last night.  chx and I are running the exact same version of PHP, 5.2.4 with the suoshin add-on and XDebug, as installed by Kubuntu 8.04 Hardy Herron.  I'm on Postgres 8.3 and he's on 8.1, and we get the exact same symptoms.  Moonshine in IRC tried on his PHP 5.2.6 system and got an entirely different fatal error, as somewhere in the process it was trying to load the block module and calling the system table to do so, before any tables were created.  We were confused by this.  He said he'd keep looking into it, but I'm still trying to work out why we're segfaulting.

A bindParam() bug sounds possible, but all of the queries up to that point (which DO run) have no arguments.  Perhaps that's the actual problem?  Calling execute() with an empty array?

--Larry Garfield



More information about the Database mailing list