3 Replies Latest reply on Dec 30, 2011 3:58 PM by HOnzaKoudelka

    FileMaker Server 11 crashed when evaluating ExecuteSQL in a server-side script



      FileMaker Server 11 crashed when evaluating ExecuteSQL in a server-side script


      FileMaker Server


      Operating system version

      Mac OS X Server 10.6.7 build 10J869

      Description of the issue

      fmserverd crashed inside FQLSQLSemanticAnalyzerFree while trying to execute SQL update via plug-in API

      Steps to reproduce the problem

      Unfortunately I have no way to find out what was the SQL query that caused the crash.

      Expected result

      It should never crash even with an invalid SQL query.

      Actual result

      It actually crashed, leaving the database being modified corrupt.

      Exact text of any error message(s) that appear

      Excerpt from the crash log:

      Thread 48 Crashed:
      0   ...ilemaker.dbengine.framework     0x007a679e antlr3VectorFree + 29
      1   ...ilemaker.dbengine.framework     0x007a0da2 freeBR + 146
      2   ...ilemaker.dbengine.framework     0x007b4ef3 freeParser + 116
      3   ...ilemaker.dbengine.framework     0x0073505b FQLSQLSemanticAnalyzerFree(FQLSQLSemanticAnalyzer_Ctx_struct*) + 27
      4   ...ilemaker.dbengine.framework     0x00693b71 FQL::FQLParserDriver::ParseQuery(bool) + 801
      5   ...ilemaker.dbengine.framework     0x005fe010 FQL::ParseExecuteSQL(FQL::FQLParserDriver&, FQL::Query*&, std::vector, std::allocator > >&) + 48
      6   ...ilemaker.dbengine.framework     0x005ff07a FQL::ExecuteSQL(Draco::DBExpressionEnv const*, Draco::Text const&, Draco::DBData&, unsigned short, unsigned short) + 282
      7   ...lemaker.fmwrapper.framework     0x01f9e895 FM_ExprEnv_ExecuteSQL + 69
      8   com.24u.toolbox                    0x1560adc7 Toolbox_ExecuteSQL(short, fmx::ExprEnv const&, fmx::DataVect const&, fmx::Data&) + 615
      9   ...ilemaker.dbengine.framework     0x0047134f Draco::DBCalcSolver::SolvePlugins(Draco::DBError&) + 1247
      10  ...ilemaker.dbengine.framework     0x00479f70 Draco::DBCalcSolver::SolvePolish(Draco::DBDataArg&, unsigned short) + 1424
      11  ...ilemaker.dbengine.framework     0x0043108f Draco::DBCalcFormula::Solve(Draco::DBData&, Draco::DBCursor const*, Draco::DBCursor const*, Draco::DBData const*, Draco::DBFieldSpec const*, Draco::DBField const*, unsigned short) const + 751
      12  ...ilemaker.fmengine.framework     0x00e966d6 Draco::FMWindowModel::SolveCalculation(Draco::DBData&, Draco::DBCalcFormula*, short, bool, Draco::DBCursor const*) + 198
      13  ...ilemaker.fmengine.framework     0x00ea13f3 Draco::ScriptRuntimeBase::SolveCalculation(Draco::DBData&, short, short, bool, Draco::DBCursor const*, Draco::FMWindowModel*) + 147
      14  ...ilemaker.fmengine.framework     0x00ea9b0f Draco::ScriptRuntimeBase::DoSetVariable() + 415
      15  ...ilemaker.fmengine.framework     0x00eafd45 Draco::ScriptRuntimeBase::Execute() + 1845
      16  ...ilemaker.fmengine.framework     0x00eb01cb Draco::ScriptRuntimeBase::DoNextStep() + 379
      17  ...ilemaker.fmengine.framework     0x00eb032e Draco::ScriptRuntimeBase::OnIdle() + 238
      18  ...ilemaker.fmengine.framework     0x00e91cdc Draco::FMSession::OnIdle(bool) + 252
      19  ...lemaker.EngineMgr.framework     0x0009dd81 FMS::SMSession::Idle() + 97
      20  ...lemaker.EngineMgr.framework     0x0009d758 FMS::SMScriptRuntime::CompleteScript() + 88
      21  ...lemaker.EngineMgr.framework     0x0009d80d FMS::SMSession::CompleteScript() + 77
      22  ...lemaker.EngineMgr.framework     0x0009f650 ScriptMakerThread::RunScript(FMSTypes::ScriptMakerOperation const*, Draco::DBAuthenticationInfo&) + 960
      23  ...lemaker.EngineMgr.framework     0x0009ffb7 ScriptMakerThread::Main() + 647
      24  ...filemaker.support.framework     0x01663ece Draco::Thread::RunThread() + 46
      25  ...filemaker.support.framework     0x01665198 Draco::Thread::ThreadUnixProc(void*) + 72
      26  libSystem.B.dylib                  0x968cf7fd _pthread_start + 345
      27  libSystem.B.dylib                  0x968cf682 thread_start + 34

      Thread 48 crashed with X86 Thread State (32-bit):
        eax: 0x00000007  ebx: 0x00693886  ecx: 0x00715da0  edx: 0x00000007
        edi: 0xb0719d84  esi: 0x54d91720  ebp: 0xb07198a8  esp: 0xb0719880
         ss: 0x00000023  efl: 0x00010246  eip: 0x007a679e   cs: 0x0000001b
         ds: 0x00000023   es: 0x00000023   fs: 0x00000023   gs: 0x0000000f
        cr2: 0x0000000b

        • 1. Re: FileMaker Server 11 crashed when evaluating ExecuteSQL in a server-side script

          Crashed again today. I have a backup of the databases before the crash happened, and also after the crash.

          One database (the one to which we were adding new records using ExecuteSQL) is corrupt and FMPA reports that access privileges are corrupt. I was hoping to be able to find out what might be the SWL query that failed but I am not able to recover the db. The database file has 4.92 GB.

          • 2. Re: FileMaker Server 11 crashed when evaluating ExecuteSQL in a server-side script

            HOnza Koudelka:

            Thank you for your post, and I apologize for the late reply.

            Although you didn't mention it, I'm assuming the ExecuteSQL script step works correctly under FileMaker Pro.  Correct?

            Are you able to break out the SQL statements into separate ExecuteSQL script steps?  If so, update another table with the SQL statement just prior to executing the script step, as this may provide a clue to what SQL statement is causing the issue.

            I know three months have passed, so if you have discovered anything else about the script and/or found a resolution, please post.

            FileMaker, Inc.

            • 3. Re: FileMaker Server 11 crashed when evaluating ExecuteSQL in a server-side script

              Unfortunately, I am not able to isolate the specific statement that causes the crash.

              But we do not use anything elst than INSERT with always the same structure, inserting just one record in every single ExecuteSQL call.

              One thing I have found out is that we are still using the old version of ExecuteSQL to keep our plug-in compatible with previous versions of FileMaker, and it is known to be less stable than the new version of the API.

              So hopefully this issue can be worked around by using the new API (although it still would be good to have even the old API stable as long as it is still supported).