4 Replies Latest reply on Sep 30, 2010 9:53 AM by TSGal

    FM Pro 11 crashes during ODBC import

    JulianDevlin

      Summary

      FM Pro 11 crashes during ODBC import

      Product

      FileMaker Pro

      Version

      11

      Operating system version

      Mac 10.5.8

      Description of the issue

      I am a developer and we have our own ODBC driver.
      When I attempt to import data into Filemaker, Filemaker crashes.
      I have debugged in our driver and it appears that when Filemaker calls SQLBindCol, it passes a value in cbValueMax which is 4 times larger than the rgbValue buffer. So when our driver trusts the cbValueMax, it ends up overwriting some data, which then causes random crashes in Filemaker.

      Steps to reproduce the problem

      Import data through ODBC.

      Expected result

      Success

      Actual result

      Crash

      Configuration information

      It is possible that Filemaker is using the field length from the external table to determine the buffer size - so if most drivers will only give the amount of data that they show as the column length, that might avoid triggering this bug. Our driver reports a column length, but if asked for more data than that, is willing to give it.

      Workaround

      In gdb, If I change the value of cbValueMax each time that SQLBindCol is called, I can avoid the crash.

        • 1. Re: FM Pro 11 crashes during ODBC import
          TSGal

          Julian Devlin:

          Thank you for your post.

          I would first read the Technology Brief "Introduction to External SQL Sources" located at:

          http://help.filemaker.com/ci/fattach/get/6696/1184016438

          Also, please see Knowledge Base Article #6420 "Which ODBC drivers are supported with External SQL Data Sources?" at:

          http://help.filemaker.com/app/answers/detail/a_id/6420

          To answer you question, yes, FileMaker Pro uses the field length from the External Table to determine the buffer size.

          TSGal
          FileMaker, Inc.

          • 2. Re: FM Pro 11 crashes during ODBC import
            JulianDevlin

            TSGal - thank you for the links.

            I'm  familiar with how ODBC works - and in general, Filemaker works with our driver.

            However, I still believe there is a bug in Filemaker.

            When Filemaker calls SQLBindCol,  I look at the contents of the rgbValue buffer in gdb. I see cbValueMax/4 bytes of zeros, followed by non-zeroes. If I modify the cbValueMax to be 1/4 of what it is passed in as, I can avoid crashing - but if I don't change it, trust that the rgbValue buffer is in fact large enough to hold cbValueMax bytes, and put data in the buffer accordingly, it crashes. So it seems that Filemaker passes a value in cbValueMax which is 4 times larger than the rgbValue buffer. 

            Granted, it may be a surprise for our driver to describe a column as having a certain width - and then be willing to give more data than that if asked. However, the parameters to SQLBindCol have a well defined meaning, independent of any values that may be returned by any other functions - and it seems that Filemaker is asking for more data than it can accept in the buffer...

             

            To give even more detail (and I'm going slightly by memory here) it seemed that the buffer length was MAX(column width as returned by driver, 48) and that cbValueMax was 4*MAX(column width as returned by driver, 48)

            • 3. Re: FM Pro 11 crashes during ODBC import
              TSGal

              Julian Devliin:

              Thank you for the clarification and specifics.

              I have sent this entire thread to our Development and Software Quality Assurance (Testing) departments because they are more familiar with the internals.  When I receive a reply back from them, I will let you know.

              TSGal
              FileMaker, Inc.

              • 4. Re: FM Pro 11 crashes during ODBC import
                TSGal

                Julian Devlin:

                Our Development and Testing thanks you for the information and will consider it for a future release as long as it doesn't affect or interfere with the already supported ODBC drivers (Oracle, MySQL, Microsoft SQL Server, and Actual Technologies).

                TSGal
                FileMaker, Inc.