[issue39672] Segmentation fault on shutdown with shelve & c pickle

2020-06-29 Thread zd nex


zd nex  added the comment:

Hello, 
ok but it seems to me that this segfault happens always (it is not random)? So 
I guess that there should be way how fix C pickle, no? Or something else should 
be done with __del__ method of shelve. Because in Python2 this was normally 
working. It seems to me that when user just reads data of shelve and then exit 
happens this can happen.

Why Python2 normally worked?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39672] Segmentation fault on shutdown with shelve & c pickle

2020-06-29 Thread Andrei Daraschenka


Andrei Daraschenka  added the comment:

Hello zd nex

After a little research, it became clear that this drop is due to vague garbage 
collection behavior. As you know, method `__del__` is called by the garbage 
collector and when this happens there is no guarantee that the rest of the 
objects are not yet cleaned.

def __del__(self):
if not hasattr(self, 'writeback'):
return
self.close()

But in the `close` method, synchronization with the disk occurred and objects 
were created for modules that were no longer in memory and, as a result, method 
`dump` fell with an error, because when trying to get module `pickle` it was 
already gone (due to the garbage collector).

Modules/_pickle.c

4353 PickleState *st = _Pickle_GetGlobalState();


But `_Pickle_GetGlobalState` can't return right result because pickle module 
was gone from memory by garbage collector.

In this case, you encountered a problem when the C code tried to use a module 
that was no longer in memory since this module deleted the garbage collector.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39672] Segmentation fault on shutdown with shelve & c pickle

2020-03-24 Thread zd nex


Change by zd nex :


--
title: SIGSEGV crash on shutdown with shelve & c pickle -> Segmentation fault 
on shutdown with shelve & c pickle

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com