[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: concurrent access deadlock

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2001-12-06 10:13:29 CET

Philip Martin <pmartin@uklinux.net> writes:
> The deadlock I reported in
>
> http://subversion.tigris.org/servlets/ReadMsg?msgId=42676&listName=dev
>
> where two separate working copies commit to the same repository, seems
> to be easy to reproduce at present. I am building against db-4.0.14 as
> an experiment, and the script in the mail above now provokes deadlock
> fairly often. I don't think 4.0.14 is itself the cause of the deadlock
> as I could sometimes provoke it when using 3.3.11 (but I may be wrong
> here :-)

Hmmm. Philip, is what you are seeing related to

   http://subversion.tigris.org/issues/show_bug.cgi?id=557

and

   http://subversion.tigris.org/issues/show_bug.cgi?id=558

?

-Karl
 
> The script loops round making modifications in the working copy,
> updating and commiting. I run two copies and I see deadlocks between
> two commits and between a commit and an update, the common feature is
>
> subversion/libsvn_fs/txn-table.c:225
>
> in one process and
>
> subversion/libsvn_fs/txn-table.c:119
>
> in the other.
>
> I don't know much about the db library, hence this mail. I tried
> running db_deadlock when deadlock occurs but that has no visible
> effect. If I interrupt the deadlocked processes, then db_stat
> typically shows
>
> $ db_stat -c -h repostress/db
> 390 Last allocated locker ID.
> 9 Number of lock modes.
> 1000 Maximum number of locks possible.
> 1000 Maximum number of lockers possible.
> 1000 Maximum number of objects possible.
> 16773 Current locks.
> 16776 Maximum number of locks so far.
> 25 Current number of lockers.
> 31 Maximum number lockers so far.
> 3 Current number lock objects.
> 8 Maximum number of lock objects so far.
> 21475 Number of lock requests.
> 21456 Number of lock releases.
> 0 Number of lock requests that would have waited.
> 59 Number of lock conflicts.
> 8 Number of deadlocks.
> 0 Number of transaction timeouts.
> 0 Number of lock timeouts.
> 352KB Lock region size (360448 bytes).
> 9 The number of region locks granted after waiting.
> 27845 The number of region locks granted without waiting.
>
> which appears to indicate that that there are still locks even though
> there are no processes accessing the database.
>
> I tried running 'db_recover -h repostress/db' but that appears to
> destroy the database, as a subsequent 'db_stat' produces
> db_stat: DB_ENV->open: repostress/db: No such file or directory
>
> I may not be able to track this down, so here are the stack traces
> from two deadlocked processes. Any suggestions?
>
> 26795 pts/0 S 0:00 svn ci wcstress.26704 -m Wed Dec 5 19:26:31 2001
> 26796 pts/1 S 0:00 svn ci wcstress.26687 -m Wed Dec 5 19:26:32 2001
>
> #0 0x402d3bde in select () from /lib/libc.so.6
> #1 0x4017db54 in __DTOR_END__ () from /usr/local/subversion/lib/libdb-4.0.so
> #2 0x401585e2 in __os_yield (dbenv=0x0, usecs=1000000)
> at /home/pm/sw/subversion/svn/db/dist/../os/os_spin.c:109
> #3 0x400d6348 in __db_tas_mutex_lock (dbenv=0x806a270, mutexp=0x403c1908)
> at /home/pm/sw/subversion/svn/db/dist/../mutex/mut_tas.c:151
> #4 0x4013eeba in __lock_get_internal (lt=0x806a488, locker=2147484871,
> flags=0, obj=0x806bb1c, lock_mode=DB_LOCK_READ, timeout=0, lock=0xbffff2e0)
> at /home/pm/sw/subversion/svn/db/dist/../lock/lock.c:827
> #5 0x4013e094 in __lock_get (dbenv=0x806a270, locker=2147484871, flags=0,
> obj=0x806bb1c, lock_mode=DB_LOCK_READ, lock=0xbffff2e0)
> at /home/pm/sw/subversion/svn/db/dist/../lock/lock.c:514
> #6 0x4010ebec in __db_lget (dbc=0x806bab0, action=0, pgno=1,
> mode=DB_LOCK_READ, lkflags=0, lockp=0xbffff2e0)
> at /home/pm/sw/subversion/svn/db/dist/../db/db_meta.c:367
> #7 0x400e76e4 in __bam_search (dbc=0x806bab0, root_pgno=0, key=0xbffff544,
> flags=1409, stop=1, recnop=0x0, exactp=0xbffff404)
> at /home/pm/sw/subversion/svn/db/dist/../btree/bt_search.c:118
> #8 0x400dce78 in __bam_c_search (dbc=0x806bab0, root_pgno=0, key=0xbffff544,
> flags=32, exactp=0xbffff404)
> at /home/pm/sw/subversion/svn/db/dist/../btree/bt_cursor.c:2509
> #9 0x400d9646 in __bam_c_get (dbc=0x806bab0, key=0xbffff544, data=0xbffff52c,
> flags=32, pgnop=0xbffff47c)
> at /home/pm/sw/subversion/svn/db/dist/../btree/bt_cursor.c:967
> #10 0x40104c5b in __db_c_get (dbc_arg=0x806bab0, key=0xbffff544,
> data=0xbffff52c, flags=32)
> at /home/pm/sw/subversion/svn/db/dist/../db/db_cam.c:704
> #11 0x400fd60d in __db_get (dbp=0x806b798, txn=0x808b460, key=0xbffff544,
> data=0xbffff52c, flags=32)
> at /home/pm/sw/subversion/svn/db/dist/../db/db_am.c:481
> #12 0x400b8b44 in svn_fs__get_txn (txn_skel=0xbffff588, fs=0x806636c,
> svn_txn=0x8074fcc "30", trail=0x80895d4)
> at ../svn/subversion/libsvn_fs/txn-table.c:225
> #13 0x400b8d45 in svn_fs__get_txn_ids (root_id_p=0xbffff5d4,
> base_root_id_p=0xbffff5d0, fs=0x806636c, svn_txn=0x8074fcc "30",
> trail=0x80895d4) at ../svn/subversion/libsvn_fs/txn-table.c:292
> #14 0x400bf34e in txn_body_txn_root (baton=0xbffff660, trail=0x80895d4)
> at ../svn/subversion/libsvn_fs/tree.c:2720
> #15 0x400b9f54 in svn_fs__retry_txn (fs=0x806636c,
> txn_body=0x400bf2e0 <txn_body_txn_root>, baton=0xbffff660, pool=0x8088fcc)
> at ../svn/subversion/libsvn_fs/trail.c:127
> #16 0x400bf3df in svn_fs_txn_root (root_p=0xbffff6ac, txn=0x8076ebc,
> pool=0x8088fcc) at ../svn/subversion/libsvn_fs/tree.c:2740
> #17 0x400bd87a in txn_body_merge (baton=0xbffff758, trail=0x8076f3c)
> at ../svn/subversion/libsvn_fs/tree.c:1596
> #18 0x400b9f54 in svn_fs__retry_txn (fs=0x806636c,
> txn_body=0x400bd6dc <txn_body_merge>, baton=0xbffff758, pool=0x8076dac)
> at ../svn/subversion/libsvn_fs/trail.c:127
> #19 0x400bdd29 in svn_fs_commit_txn (conflict_p=0xbffff7ec,
> new_rev=0xbffff7f4, txn=0x8076ebc)
> at ../svn/subversion/libsvn_fs/tree.c:1788
> #20 0x400a90f8 in svn_repos_fs_commit_txn (conflict_p=0xbffff7ec,
> new_rev=0xbffff7f4, txn=0x8076ebc)
> at ../svn/subversion/libsvn_repos/hooks.c:194
> #21 0x400822f8 in close_edit (edit_baton=0x806837c)
> at ../svn/subversion/libsvn_ra_local/commit_editor.c:529
> #22 0x40089fda in close_edit (edit_baton=0x8062f9c)
> at ../svn/subversion/libsvn_delta/compose_editors.c:224
> #23 0x40089fda in close_edit (edit_baton=0x8062fec)
> at ../svn/subversion/libsvn_delta/compose_editors.c:224
> #24 0x4002fe88 in crawl_local_mods (parent_dir=0x8054a84,
> condensed_targets=0x8054a94, editor=0x8063004, edit_baton=0x8062fec,
> revnum_fn=0x40084310, rev_baton=0x8062cc4, locked_dirs=0x806309c,
> affected_targets=0x806303c, pool=0x80538b4)
> at ../svn/subversion/libsvn_wc/adm_crawler.c:1789
> #25 0x40030cb9 in svn_wc_crawl_local_mods (parent_dir=0x8054a84,
> condensed_targets=0x8054a94, editor=0x8063004, edit_baton=0x8062fec,
> revnum_fn=0x40084310, rev_baton=0x8062cc4, pool=0x80538b4)
> at ../svn/subversion/libsvn_wc/adm_crawler.c:2319
> #26 0x4001b327 in send_to_repos (before_editor=0x0, before_edit_baton=0x0,
> after_editor=0x80549dc, after_edit_baton=0x80549d4, base_dir=0x8054a84,
> condensed_targets=0x8054a94, url=0x806229c, new_entry=0x0,
> auth_baton=0x8053b14, log_msg=0x8053a94, xml_dst=0x0, revision=-1,
> pool=0x80538b4) at ../svn/subversion/libsvn_client/commit.c:584
> #27 0x4001b580 in svn_client_commit (before_editor=0x0, before_edit_baton=0x0,
> after_editor=0x80549dc, after_edit_baton=0x80549d4, auth_baton=0x8053b14,
> targets=0x8053aa4, log_msg=0x8053a94, xml_dst=0x0, revision=-1,
> pool=0x80538b4) at ../svn/subversion/libsvn_client/commit.c:699
> #28 0x804e52f in svn_cl__commit (os=0x8053a2c, opt_state=0xbffffae0,
> pool=0x80538b4) at ../svn/subversion/clients/cmdline/commit-cmd.c:107
> #29 0x804ba6a in main (argc=5, argv=0xbffffbc4)
> at ../svn/subversion/clients/cmdline/main.c:583
>
>
>
> #0 0x402d3bde in select () from /lib/libc.so.6
> #1 0x4017db54 in __DTOR_END__ () from /usr/local/subversion/lib/libdb-4.0.so
> #2 0x401585e2 in __os_yield (dbenv=0x0, usecs=1000000)
> at /home/pm/sw/subversion/svn/db/dist/../os/os_spin.c:109
> #3 0x400d6348 in __db_tas_mutex_lock (dbenv=0x806a270, mutexp=0x403c1560)
> at /home/pm/sw/subversion/svn/db/dist/../mutex/mut_tas.c:151
> #4 0x4013eeba in __lock_get_internal (lt=0x806a488, locker=2147484870,
> flags=0, obj=0x806bb1c, lock_mode=DB_LOCK_WRITE, timeout=0,
> lock=0xbffff17c) at /home/pm/sw/subversion/svn/db/dist/../lock/lock.c:827
> #5 0x4013e094 in __lock_get (dbenv=0x806a270, locker=2147484870, flags=0,
> obj=0x806bb1c, lock_mode=DB_LOCK_WRITE, lock=0xbffff17c)
> at /home/pm/sw/subversion/svn/db/dist/../lock/lock.c:514
> #6 0x4010ebec in __db_lget (dbc=0x806bab0, action=0, pgno=1,
> mode=DB_LOCK_WRITE, lkflags=0, lockp=0xbffff17c)
> at /home/pm/sw/subversion/svn/db/dist/../db/db_meta.c:367
> #7 0x400e7807 in __bam_search (dbc=0x806bab0, root_pgno=1, key=0xbffff4d4,
> flags=12802, stop=1, recnop=0x0, exactp=0xbffff2a4)
> at /home/pm/sw/subversion/svn/db/dist/../btree/bt_search.c:140
> #8 0x400dce78 in __bam_c_search (dbc=0x806bab0, root_pgno=1, key=0xbffff4d4,
> flags=19, exactp=0xbffff2a4)
> at /home/pm/sw/subversion/svn/db/dist/../btree/bt_cursor.c:2509
> #9 0x400db16f in __bam_c_put (dbc=0x806bab0, key=0xbffff4d4, data=0xbffff4bc,
> flags=19, pgnop=0xbffff34c)
> at /home/pm/sw/subversion/svn/db/dist/../btree/bt_cursor.c:1866
> #10 0x40105f81 in __db_c_put (dbc_arg=0x806bab0, key=0xbffff4d4,
> data=0xbffff4bc, flags=19)
> at /home/pm/sw/subversion/svn/db/dist/../db/db_cam.c:1395
> #11 0x400fd99e in __db_put (dbp=0x806b798, txn=0x806e798, key=0xbffff4d4,
> data=0xbffff4bc, flags=0)
> at /home/pm/sw/subversion/svn/db/dist/../db/db_am.c:609
> #12 0x400b878b in put_txn (fs=0x806636c, svn_txn=0x806848c "31",
> root_id=0x8076f74, base_root_id=0x8076f84, proplist=0x8076f44,
> trail=0x8068494) at ../svn/subversion/libsvn_fs/txn-table.c:119
> #13 0x400b95f9 in txn_body_change_txn_prop (baton=0xbffff5bc, trail=0x8068494)
> at ../svn/subversion/libsvn_fs/txn-table.c:535
> #14 0x400b9f54 in svn_fs__retry_txn (fs=0x806636c,
> txn_body=0x400b94f8 <txn_body_change_txn_prop>, baton=0xbffff5bc,
> pool=0x806826c) at ../svn/subversion/libsvn_fs/trail.c:127
> #15 0x400b96ba in svn_fs_change_txn_prop (txn=0x8072e9c,
> name=0x400a96ed "svn:author", value=0xbffff5f0, pool=0x806826c)
> at ../svn/subversion/libsvn_fs/txn-table.c:557
> #16 0x400a91fc in svn_repos_fs_begin_txn_for_commit (txn_p=0x80683a0,
> fs=0x806636c, rev=8, author=0x80683ac "pm", log_msg=0x8068388,
> pool=0x806826c) at ../svn/subversion/libsvn_repos/hooks.c:227
> #17 0x400817b0 in open_root (edit_baton=0x806837c, base_revision=8,
> root_baton=0x8063364)
> at ../svn/subversion/libsvn_ra_local/commit_editor.c:149
> #18 0x40089c12 in open_root (edit_baton=0x8062f9c, base_revision=8,
> root_baton=0x8063354)
> at ../svn/subversion/libsvn_delta/compose_editors.c:83
> #19 0x40089c12 in open_root (edit_baton=0x8062fec, base_revision=8,
> root_baton=0xbffff704)
> at ../svn/subversion/libsvn_delta/compose_editors.c:83
> #20 0x4002ded0 in do_dir_replaces (newest_baton=0xbffff818, stack=0x806ee7c,
> editor=0x8063004, edit_baton=0x8062fec, locks=0x806309c,
> top_pool=0x80538b4) at ../svn/subversion/libsvn_wc/adm_crawler.c:377
> #21 0x4002f332 in report_single_mod (name=0x806cae4 "foo1", entry=0x806cbcc,
> stack=0xbffff8a0, affected_targets=0x806303c, locks=0x806309c,
> editor=0x8063004, edit_baton=0x8062fec, revnum_fn=0x40084310,
> rev_baton=0x8062cc4, youngest_rev=0xbffff89c, dir_baton=0xbffff818,
> adds_only=0, copy_mode=0, top_pool=0x80538b4)
> at ../svn/subversion/libsvn_wc/adm_crawler.c:1266
> #22 0x4002f884 in crawl_dir (path=0x8054a84, dir_baton=0x0, editor=0x8063004,
> edit_baton=0x8062fec, revnum_fn=0x40084310, rev_baton=0x8062cc4,
> youngest_rev=0xbffff89c, adds_only=0, copy_mode=0, stack=0xbffff8a0,
> affected_targets=0x806303c, locks=0x806309c, top_pool=0x80538b4)
> at ../svn/subversion/libsvn_wc/adm_crawler.c:1496
> #23 0x4002f9a0 in crawl_local_mods (parent_dir=0x8054a84,
> condensed_targets=0x8054a94, editor=0x8063004, edit_baton=0x8062fec,
> revnum_fn=0x40084310, rev_baton=0x8062cc4, locked_dirs=0x806309c,
> affected_targets=0x806303c, pool=0x80538b4)
> at ../svn/subversion/libsvn_wc/adm_crawler.c:1577
> #24 0x40030cb9 in svn_wc_crawl_local_mods (parent_dir=0x8054a84,
> condensed_targets=0x8054a94, editor=0x8063004, edit_baton=0x8062fec,
> revnum_fn=0x40084310, rev_baton=0x8062cc4, pool=0x80538b4)
> at ../svn/subversion/libsvn_wc/adm_crawler.c:2319
> #25 0x4001b327 in send_to_repos (before_editor=0x0, before_edit_baton=0x0,
> after_editor=0x80549dc, after_edit_baton=0x80549d4, base_dir=0x8054a84,
> condensed_targets=0x8054a94, url=0x806229c, new_entry=0x0,
> auth_baton=0x8053b14, log_msg=0x8053a94, xml_dst=0x0, revision=-1,
> pool=0x80538b4) at ../svn/subversion/libsvn_client/commit.c:584
> #26 0x4001b580 in svn_client_commit (before_editor=0x0, before_edit_baton=0x0,
> after_editor=0x80549dc, after_edit_baton=0x80549d4, auth_baton=0x8053b14,
> targets=0x8053aa4, log_msg=0x8053a94, xml_dst=0x0, revision=-1,
> pool=0x80538b4) at ../svn/subversion/libsvn_client/commit.c:699
> #27 0x804e52f in svn_cl__commit (os=0x8053a2c, opt_state=0xbffffac0,
> pool=0x80538b4) at ../svn/subversion/clients/cmdline/commit-cmd.c:107
> #28 0x804ba6a in main (argc=5, argv=0xbffffba4)
> at ../svn/subversion/clients/cmdline/main.c:583
>
> Philip
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:51 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.