Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bsddb DB_RUNRECOVERY crash on write access #58249

Closed
totycro mannequin opened this issue Feb 17, 2012 · 2 comments
Closed

bsddb DB_RUNRECOVERY crash on write access #58249

totycro mannequin opened this issue Feb 17, 2012 · 2 comments

Comments

@totycro
Copy link
Mannequin

totycro mannequin commented Feb 17, 2012

BPO 14041
Nosy @jcea
Files
  • data.db: db file required to reproduce the crash
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2012-02-17.16:09:44.235>
    created_at = <Date 2012-02-17.15:31:23.662>
    labels = ['invalid']
    title = 'bsddb DB_RUNRECOVERY crash on write access'
    updated_at = <Date 2012-02-17.16:09:44.212>
    user = 'https://bugs.python.org/totycro'

    bugs.python.org fields:

    activity = <Date 2012-02-17.16:09:44.212>
    actor = 'jcea'
    assignee = 'none'
    closed = True
    closed_date = <Date 2012-02-17.16:09:44.235>
    closer = 'jcea'
    components = []
    creation = <Date 2012-02-17.15:31:23.662>
    creator = 'totycro'
    dependencies = []
    files = ['24545']
    hgrepos = []
    issue_num = 14041
    keywords = []
    message_count = 2.0
    messages = ['153551', '153559']
    nosy_count = 2.0
    nosy_names = ['jcea', 'totycro']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue14041'
    versions = ['Python 2.7']

    @totycro
    Copy link
    Mannequin Author

    totycro mannequin commented Feb 17, 2012

    The attached file data.db should be a valid bsddb file, still i get this crash on write:

    File "/usr/lib64/python2.7/bsddb/init.py", line 280, in wrapF
    self.db[key] = value
    DBRunRecoveryError: (-30974, 'DB_RUNRECOVERY: Fatal error, run database recovery -- PANIC: Invalid argument')

    Full traceback: http://pastebin.com/A1VSPV9Q

    I can reproduce the crash with python 2.7.2 with just these lines (it doesn't crash on empty db files):

    import shelve
    a = shelve.open("data.db")
    
    b="crashin.."*20000

    a['content/scenarios/tutorial_da.yaml'] = b
    a['content/scenarios/tutorial_cs.yaml'] = b

    @jcea
    Copy link
    Member

    jcea commented Feb 17, 2012

    The file is corrupted:

    """
    jcea@ubuntu:/tmp/z$ /usr/local/BerkeleyDB.5.3/bin/db_verify data.db
    db_verify: BDB0551 Page 0: nonsensical free list pgno 55
    db_verify: BDB1107 Page 2: offpage item 19 has bad pgno 70
    db_verify: BDB1107 Page 20: offpage item 5 has bad pgno 59
    db_verify: BDB1107 Page 36: offpage item 9 has bad pgno 94
    db_verify: BDB1107 Page 37: offpage item 9 has bad pgno 57
    db_verify: data.db: BDB0090 DB_VERIFY_BAD: Database verification failed
    BDB5105 Verification of data.db failed.
    """

    For "real world" usage, you must use Berkeley DB transactional storage mode. If you use a concurrent datastore or anything like that (anything more "simple" that the transactional mode), you can corrupt your database if the application or the computer crash in a bad moment. Or if you try to backup the database while writes are in progress, for instance. Briefly: use the transactional mode and read the Oracle documentation carefully!.

    Closing the report as invalid, since the database is actually corrupt.

    @jcea jcea closed this as completed Feb 17, 2012
    @jcea jcea added the invalid label Feb 17, 2012
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant