[database] [Database] Toward better databases

Barry Jaspan barry.jaspan at acquia.com
Tue Jul 8 15:12:19 UTC 2008


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

-------
Barry Jaspan
Code Jester, Acquia Inc.
barry.jaspan at acquia.com




On Jul 7, 2008, at 11:28 PM, Larry Garfield wrote:

> On Monday 07 July 2008 9:53:32 pm Joshua D. Drake wrote:
>
>>> Josh, do you have any idea why the above query could be failing?
>>
>> Well what does the database say?
>>
>> log_min_messages = debug2
>> log_min_error_statement = error
>>
>> reload, produce error, produce log, post :)
>>
>> Joshua D. Drake
>
> The Postgres log says:
>
> 2008-07-07 22:19:36 CDT LOG:  could not receive data from client:  
> Connection
> reset by peer
> 2008-07-07 22:19:36 CDT LOG:  unexpected EOF on client connection
> 2008-07-07 22:19:36 CDT DEBUG:  server process (PID 6543) exited  
> with exit
> code 0
>
> Apache/PHP's error log says:
>
> [Mon Jul 07 22:19:37 2008] [notice] child pid 6187 exit signal  
> Segmentation
> fault (11)
>
> So something is highly screwed up somewhere.  Can someone try this  
> on another
> computer?  (I don't have another available to me at the moment.  My  
> desktop
> is dead. <g>)  I am wondering if it's an issue with the specific PHP  
> I have
> installed.
>
> -- 
> Larry Garfield
> larry at garfieldtech.com
> _______________________________________________
> Database mailing list
> Database at drupal.org
> http://mail.drupal.org/mailman/listinfo/database



More information about the Database mailing list