[unixODBC-support] Rif: Re: Segmentation Fault on Centos 7 when Connection Pooling Enable

Nick Gorham nick at lurcher.org
Mon Jan 9 14:45:13 GMT 2017

On 09/01/17 14:25, Davide Pagnin wrote:
> Hi,
> I've recompiled the unixodbc from source taken from ftp as 2.3.5-pre
> I doesn't dump anymore but it is not pooling the connections anymore.
> I'm not a programmer, so I don't know if the fix you have introduced 
> is right or not,
> but if the fix you introduced is correct (stripping connections of 
> released environment),
> what programmers should do to enjoy connection pooling advantages?
> They have not to release the environment?
> What I'm sure, at the moment, is that on windows environment, our 
> application
> do benefit from connection pooling, on linux it used to crash the 
> httpd daemon
> and with your fix it does not benefit from pooling. I expected linux 
> behavior to copy windows,
> but may be there is a flaw also on windows side that is not visible or 
> a memory leak
> (which is what I probably introduced with my "quick" fix)
> May be you could try to explain me, what you think is the "correct" 
> behaviour?
> Thanks in advance
> Regards
> Davide


I expected this. My first aim was to remove the seg fault, at least by 
doing this we have identified that the problem I found is the same as 
the one that was causing you a problem.

Not sure what the "correct" behaviour is (other than a seg fault is 
rarely correct :-)). It is possible that the orphaned pooled connections 
(those left when the application releases the environment) could be 
allocated to the new environment when its allocated and used, but this 
worries me a little as it allows a leakage of information (or at least 
the connection state) between what the application would reasonably 
expect to be isolated connections. The simple solution would be to not 
release the environment.

Attempting to copy the windows behaviour exactly is problematic because 
of the different way DLL's on windows and shared objects on *nix operate.

It would be a simple task to null the pooled connection environment on 
release of the environment instead of completely removing them, and on 
reuse of the pooled connection reconnecting to the new environment, but 
for the above reasons I feel it would be unwise. I will leave the 
question open to see if any others have views on the preferred solution.

Is it not possible to alter the calling application to maintain 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20170109/6f940df6/attachment.html>

More information about the unixODBC-support mailing list