Menu

mysqldb crashes python if mysql goes away

2007-01-02
2012-09-19
  • Jared DeMott

    Jared DeMott - 2007-01-02

    If mysqldb is in the middle of an execute and mysql disappears, bad things (null ptr) happen. I will post the details shortly, just wondering if anyone else had noticed that.

     
    • Jared DeMott

      Jared DeMott - 2007-01-08

      After a compile of mysqldb with symbols, I get this when starting up my python app:

      jared = PyRun_String("version_info", Py_eval_input, dict, dict);
      023940A8 push esi
      023940A9 push esi
      023940AA push 102h
      023940AF push offset _mysqldoc__+210h (2417968h)
      023940B4 call dword ptr [impPyRun_String (2401304h)]
      if (PyDict_SetItemString(dict, "version_info", jared ))
      023940BA mov ebx,dword ptr [impPyDict_SetItemString (24012DCh)] <----THIS IS BAD
      023940C0 push eax
      023940C1 push offset _mysql
      doc__+220h (2417978h)
      023940C6 push esi
      023940C7 call ebx <--dies here
      023940C9 add esp,1Ch <--stops here
      023940CC test eax,eax
      023940CE jne init_mysql+2AEh (23942CEh)
      goto error;

      REGS:
      EAX = 00000000 EBX = 00000000 ECX = 00000000 EDX = 00000000 ESI = 00000000
      EDI = 00000000 EIP = 023940C9 ESP = 0021EE50 EBP = 00000000 EFL = 00000000

       
    • Andy Dustman

      Andy Dustman - 2007-01-03

      Post a backtrace if you can.

       
    • Jared DeMott

      Jared DeMott - 2007-01-03

      Faulting application pythonw.exe, version 0.0.0.0, faulting module _mysql.pyd, version 0.0.0.0, fault address 0x000099fd.

      registers:
      EAX = 00000000 EBX = FFFFFFFF ECX = 00000000 EDX = 00060001 ESI = 11F03628
      EDI = 123748D4 EIP = 023999FD ESP = 0306F4B4 EBP = 00000000 EFL = 00000246

      00000003 = ??

      dissass:
      023999D8 push eax
      023999D9 call dword ptr [eax+5Ch]
      023999DC add esp,0Ch
      023999DF test eax,eax
      023999E1 jle 02399A84
      023999E7 sub ebp,eax
      023999E9 add edi,eax
      023999EB test ebp,ebp
      023999ED ja 023999D4
      023999EF mov eax,dword ptr [esp+0Ch]
      023999F3 test eax,eax
      023999F5 jne 02399A67
      023999F7 mov eax,dword ptr [esi+4]
      023999FA mov ecx,dword ptr [esi+48h]
      023999FD mov dl,byte ptr [ecx+eax+3] <-----------------
      02399A01 add ecx,eax
      02399A03 cmp dl,byte ptr [esi+20h]
      02399A06 jne 02399A94
      02399A0C mov edx,dword ptr [esi+20h]
      02399A0F inc edx
      02399A10 mov eax,edx
      02399A12 mov dword ptr [esi+24h],eax
      02399A15 mov al,byte ptr [esi+38h]
      02399A18 test al,al
      02399A1A mov dword ptr [esi+20h],edx
      02399A1D je 02399A2D
      02399A1F mov eax,dword ptr [ecx+4]
      02399A22 mov ecx,dword ptr [esp+14h]
      02399A26 and eax,0FFFFFFh
      02399A2B mov dword ptr [ecx],eax

      stack trace:
      > _mysql.pyd!023999fd()
      [Frames below may be incorrect and/or missing, no symbols loaded for _mysql.pyd]
      _mysql.pyd!02399acb()
      _mysql.pyd!02395a76()
      _mysql.pyd!02396e12()
      _mysql.pyd!0239553b()
      _mysql.pyd!023934c2()
      python24.dll!1e079bb7()
      python24.dll!1e02722f()
      python24.dll!1e028ca8()
      python24.dll!1e028ff4()
      python24.dll!1e02608b()
      python24.dll!1e0272a6()
      python24.dll!1e028ff4()
      python24.dll!1e02608b()
      python24.dll!1e0272a6()
      python24.dll!1e028ff4()
      python24.dll!1e0299a9()
      python24.dll!1e02a01c()
      python24.dll!1e0260e6()
      python24.dll!1e0272a6()
      python24.dll!1e028ff4()
      python24.dll!1e05e079()
      python24.dll!1e02608b()
      python24.dll!1e0272a6()
      python24.dll!1e028ff4()
      python24.dll!1e02608b()
      python24.dll!1e0272a6()
      python24.dll!1e028ff4()
      python24.dll!1e05e079()
      python24.dll!1e02608b()
      python24.dll!1e0272a6()
      python24.dll!1e028ff4()
      python24.dll!1e02608b()
      python24.dll!1e0272a6()
      python24.dll!1e028ff4()
      python24.dll!1e05e079()
      python24.dll!1e02608b()
      python24.dll!1e0272a6()
      python24.dll!1e028ff4()
      python24.dll!1e05e079()
      python24.dll!1e02608b()
      python24.dll!1e0272a6()
      python24.dll!1e028ff4()
      python24.dll!1e0299a9()
      python24.dll!1e02a01c()
      python24.dll!1e05f35f()
      python24.dll!1e018f3c()
      python24.dll!1e02cf24()
      ntdll.dll!7c90d625()
      ntdll.dll!7c90eacf()
      python24.dll!1e0296e0()
      ntdll.dll!7c9105c8()
      ntdll.dll!7c910551()
      ntdll.dll!7c91056d()
      kernel32.dll!7c80261a()
      kernel32.dll!7c8025f0()
      kernel32.dll!7c8025f0()
      kernel32.dll!7c802532()
      python24.dll!1e018f3c()
      python24.dll!1e025eda()
      python24.dll!1e0a65e7()
      python24.dll!1e0a5f59()
      msvcr71.dll!7c34940f()
      kernel32.dll!7c80b683()

       
      • Andy Dustman

        Andy Dustman - 2007-01-03

        Not so useful without symbols...

         
    • Jared DeMott

      Jared DeMott - 2007-01-03

      Do you happen to have a windows binary compiled with symbols? If not, will:

      extra_compile_args:/Zi

      in the site.cfg work?

      This bug is repeatable and happens each time I run my code. I'd love to help track this fella down! :)

       
      • Andy Dustman

        Andy Dustman - 2007-01-03

        As I have explained at length in another thread, I do not have Windows, period.

         
    • Jared DeMott

      Jared DeMott - 2007-01-05

      Ok, so I figured out how to build a version of mysqldb for windows that includes debugging info. But now each time I start my code we crash on this bit:

      if (PyDict_SetItemString(dict, "version_info",
      PyRun_String(QUOTE(version_info), Py_eval_input,
      dict, dict)))
      goto error;

      Can you explain this piece to me? Could we restate it somehow. In particular, I think the return from QUOTE(version_info) may be bad. What are we trying to do with that?

       

Log in to post a comment.