> Hi Julien, hi Florian, > > thanks for reporting this problem and for providing patches. However, > I believe both patches cure a symptom rather than the cause of the > problem. If I understand the OP's problem correctly, the crash occurs > after using the library incorrectly. We should try to make this kind > of "abuse" impossible, rather than fixing each single problem that > might result from improper use in each single driver. In this case, we > should make it impossible to run queries and do other things on a Conn > structure without having a proper connection in the first > place. E.g. dbi_conn_query() has the following check in place: > > if (!conn) return 0; > > This just checks wether a connection structure was passed at all, not > whether it represents an open connection. I'd suggest to add another > check to dbi_conn_query() and all similar functions: > > if (!conn || !(conn->connection)) return 0; > > Only then we should inspect each driver for possible crashes if an > opened connection is no longer available (e.g. server went down). > > What do you think? > > regards, > Markus > > > -- > Markus Hoenicka > http://www.mhoenicka.de > AQ score 38 >
It seems a good thing to check first at the top level (direct entry point in libdbi) arguments given to the function before going down into the driver. But it shouldn't prevent developers to make argument checking into the drivers. ------------------------------------------------------------------------------ Centralized Desktop Delivery: Dell and VMware Reference Architecture Simplifying enterprise desktop deployment and management using Dell EqualLogic storage and VMware View: A highly scalable, end-to-end client virtualization framework. Read more! http://p.sf.net/sfu/dell-eql-dev2dev _______________________________________________ Libdbi-drivers-devel mailing list Libdbi-drivers-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libdbi-drivers-devel