clearerr called on NULL FILE* ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chad Austin

    #1

    clearerr called on NULL FILE* ?

    Hi all,

    My first post to the list. :) I'm debugging one of our application
    crashes, and I thought maybe one of you has seen something similar
    before. Our application is mostly Python, with some work being done in
    a native C++ module. Anyway, I'm getting a memory access violation at
    the following stack:


    CRASHING THREAD
    EXCEPTION POINTERS: 0x0012e424
    ExceptionRecord : 0x0012e518
    ExceptionCode: 0xc0000005 EXCEPTION_ACCES S_VIOLATION
    ExceptionFlags: 0x00000000
    ExceptionAddres s: 0x7c901010
    NumberParameter s: 2
    ExceptionInform ation[0]: 0x00000000
    ExceptionInform ation[1]: 0x00000034
    ExceptionRecord : 0x00000000

    THREAD ID: 10b0 frame count: 4
    PYTHON23!0x000b aa00 - PyFile_Type
    PYTHON23!0x0003 ac27 - PyFile_SetEncod ing
    MSVCRT!0x00030a 06 - clearerr
    ntdll!0x0000101 0 - RtlEnterCritica lSection


    Here's my understanding: something is getting called on a PyFileObject
    where f_fp is NULL, and clearerr in the multithreaded runtime tries to
    enter an invalid critical section. It looks like PyFile_SetEncod ing in
    the stack, but I can't figure out how in the Python source how
    SetEncoding calls clearerr.

    Based on the timing of the crashes, I also think it might have something
    to do with log rollovers in RotatingFileHan dler.

    Has anyone run into something similar? I don't expect anyone to spend a
    lot of time on this, but if there are any quick tips, they would be
    greatly appreciated...

    We're using Python 2.3.5 and Visual C++ 6.

    --
    Chad Austin


Working...