Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
62a21121
Kaydet (Commit)
62a21121
authored
Ock 25, 2006
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix bug #1413192, fix seg fault in bsddb if a txn was deleted before the env.
Will backport.
üst
2a4712dc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
3 deletions
+37
-3
test_1413192.py
Lib/bsddb/test/test_1413192.py
+16
-0
test_all.py
Lib/bsddb/test/test_all.py
+6
-0
test_bsddb3.py
Lib/test/test_bsddb3.py
+6
-0
NEWS
Misc/NEWS
+3
-0
_bsddb.c
Modules/_bsddb.c
+6
-3
No files found.
Lib/bsddb/test/test_1413192.py
0 → 100644
Dosyayı görüntüle @
62a21121
# http://python.org/sf/1413192
#
# This test relies on the variable names, see the bug report for details.
# The problem was that the env was deallocated prior to the txn.
from
bsddb
import
db
env_name
=
'.'
env
=
db
.
DBEnv
()
env
.
open
(
env_name
,
db
.
DB_CREATE
|
db
.
DB_INIT_TXN
)
the_txn
=
env
.
txn_begin
()
map
=
db
.
DB
(
env
)
map
.
open
(
'xxx.db'
,
"p"
,
db
.
DB_HASH
,
db
.
DB_CREATE
,
0666
,
txn
=
the_txn
)
Lib/bsddb/test/test_all.py
Dosyayı görüntüle @
62a21121
...
@@ -46,6 +46,12 @@ test_all.verbose = verbose
...
@@ -46,6 +46,12 @@ test_all.verbose = verbose
def
suite
():
def
suite
():
try
:
# this is special, it used to segfault the interpreter
import
test_1413192
except
:
pass
test_modules
=
[
test_modules
=
[
'test_associate'
,
'test_associate'
,
'test_basics'
,
'test_basics'
,
...
...
Lib/test/test_bsddb3.py
Dosyayı görüntüle @
62a21121
...
@@ -22,6 +22,12 @@ if 'silent' in sys.argv: # take care of old flag, just in case
...
@@ -22,6 +22,12 @@ if 'silent' in sys.argv: # take care of old flag, just in case
def
suite
():
def
suite
():
try
:
# this is special, it used to segfault the interpreter
import
bsddb.test.test_1413192
except
:
pass
test_modules
=
[
test_modules
=
[
'test_associate'
,
'test_associate'
,
'test_basics'
,
'test_basics'
,
...
...
Misc/NEWS
Dosyayı görüntüle @
62a21121
...
@@ -216,6 +216,9 @@ Core and builtins
...
@@ -216,6 +216,9 @@ Core and builtins
Extension
Modules
Extension
Modules
-----------------
-----------------
-
Bug
#
1413192
,
fix
seg
fault
in
bsddb
if
a
transaction
was
deleted
before
the
env
.
-
Patch
#
1103116
:
Basic
AF_NETLINK
support
.
-
Patch
#
1103116
:
Basic
AF_NETLINK
support
.
-
Bug
#
1402308
,
(
possible
)
segfault
when
using
mmap
.
mmap
(-
1
,
...)
-
Bug
#
1402308
,
(
possible
)
segfault
when
using
mmap
.
mmap
(-
1
,
...)
...
...
Modules/_bsddb.c
Dosyayı görüntüle @
62a21121
...
@@ -266,6 +266,7 @@ typedef struct {
...
@@ -266,6 +266,7 @@ typedef struct {
typedef
struct
{
typedef
struct
{
PyObject_HEAD
PyObject_HEAD
DB_TXN
*
txn
;
DB_TXN
*
txn
;
PyObject
*
env
;
#ifdef HAVE_WEAKREF
#ifdef HAVE_WEAKREF
PyObject
*
in_weakreflist
;
/* List of weak references */
PyObject
*
in_weakreflist
;
/* List of weak references */
#endif
#endif
...
@@ -928,6 +929,8 @@ newDBTxnObject(DBEnvObject* myenv, DB_TXN *parent, int flags)
...
@@ -928,6 +929,8 @@ newDBTxnObject(DBEnvObject* myenv, DB_TXN *parent, int flags)
DBTxnObject
*
self
=
PyObject_New
(
DBTxnObject
,
&
DBTxn_Type
);
DBTxnObject
*
self
=
PyObject_New
(
DBTxnObject
,
&
DBTxn_Type
);
if
(
self
==
NULL
)
if
(
self
==
NULL
)
return
NULL
;
return
NULL
;
Py_INCREF
(
myenv
);
self
->
env
=
(
PyObject
*
)
myenv
;
#ifdef HAVE_WEAKREF
#ifdef HAVE_WEAKREF
self
->
in_weakreflist
=
NULL
;
self
->
in_weakreflist
=
NULL
;
#endif
#endif
...
@@ -938,11 +941,10 @@ newDBTxnObject(DBEnvObject* myenv, DB_TXN *parent, int flags)
...
@@ -938,11 +941,10 @@ newDBTxnObject(DBEnvObject* myenv, DB_TXN *parent, int flags)
#else
#else
err
=
txn_begin
(
myenv
->
db_env
,
parent
,
&
(
self
->
txn
),
flags
);
err
=
txn_begin
(
myenv
->
db_env
,
parent
,
&
(
self
->
txn
),
flags
);
#endif
#endif
/* TODO add a weakref(self) to the self->myenvobj->open_child_weakrefs
* list so that a DBEnv can refuse to close without aborting any open
* open DBTxns and closing any open DBs first. */
MYDB_END_ALLOW_THREADS
;
MYDB_END_ALLOW_THREADS
;
if
(
makeDBError
(
err
))
{
if
(
makeDBError
(
err
))
{
Py_DECREF
(
self
->
env
);
PyObject_Del
(
self
);
self
=
NULL
;
self
=
NULL
;
}
}
return
self
;
return
self
;
...
@@ -973,6 +975,7 @@ DBTxn_dealloc(DBTxnObject* self)
...
@@ -973,6 +975,7 @@ DBTxn_dealloc(DBTxnObject* self)
}
}
#endif
#endif
Py_DECREF
(
self
->
env
);
PyObject_Del
(
self
);
PyObject_Del
(
self
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment