csomh / source-git / rpm

Forked from source-git/rpm 4 years ago
Clone

8908f6 Fix ancient python GIL locking bug on callback (RhBug:1632488)

1 file Authored by Panu Matilainen 4 years ago, Committed by Hunor Csomortáni 4 years ago,
    Fix ancient python GIL locking bug on callback (RhBug:1632488)
    
    Introduced in commit c7881d801745b4c156a8aa2afc17b95f97481e34 back in 2002,
    synthesizing a python object for the callback occurs before retaking
    the GIL lock, which is not allowed. Somehow this has managed to stay
    latent all these years, and even now requires fairly specific conditions:
    when the callback gets called without an associated key, such as erasures
    or file trigger script start/stop events (in the case of RhBug:1632488),
    when Python 3 is running in PYTHONMALLOC=debug mode,
    it crashes with "Python memory allocator called without holding the GIL".
    
    Simply retake the lock before any Python operations take place to fix.
    
        
file modified
+2 -2