Summary: | ASTERISK-10793: [patch] trunk: rwlock tracking support (tracking and untracking static rwlock) | ||
Reporter: | Yuri (ys) | Labels: | |
Date Opened: | 2007-11-17 06:49:02.000-0600 | Date Closed: | 2008-06-03 13:20:52 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Core/NewFeature |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) trunk_lock_utils_threadstorage.diff ( 1) trunk_lock_utils_threadstorage.v2.diff ( 2) trunk_lock_utils_threadstorage.v3.diff ( 3) trunk_lock_utils_threadstorage.v4.diff ( 4) trunk_lock_utils.v5.diff ( 5) trunk_lock_utils.v6.diff ( 6) trunk_lock_utils.v7.diff ( 7) trunk_lock_utils.v8.diff | |
Description: | This patch based on mutex DEBUG_THREAD code. Can be used to detect rwlock error and deadlock. Second: make threadstorage rwlock untracked. ASTERISK-1114207 ****** ADDITIONAL INFORMATION ****** This recent to ASTERISK-1114207 | ||
Comments: | By: Badalian Vyacheslav (slavon) 2007-11-17 07:28:21.000-0600 strange... you define type typedef struct ast_mutex_lock_info ast_mutex_t; then not use it - ast_mutex_t *lock; + struct ast_mutex_lock_info *lock; By: Yuri (ys) 2007-11-17 07:38:07.000-0600 strange? 1. I extend ast_mutex_info: union { + pthread_mutex_t mutex; + pthread_rwlock_t rwlock; + }; and rename to ast_mutex_lock_info. 2. ast_mutex_lock_info used in typedef for ast_mutex_t: +typedef struct ast_mutex_lock_info ast_mutex_t; and ast_rwlock_t: +typedef struct ast_mutex_lock_info ast_rwlock_t; if DEBUG_THREAD is enabled. If You talk about handle_show_locks() from main/utils.c This changes is only for clarity sake. By: Yuri (ys) 2007-11-23 12:44:21.000-0600 ping(); By: Russell Bryant (russell) 2008-03-14 11:45:06 I'm sorry it has taken me so long to work on this. :( I just tried to apply it and almost all of it fails to apply now. Would you be interested in getting an up to date version of it so I can apply it? By: Yuri (ys) 2008-03-15 08:29:07 I upload new patch, which coordinated with revision 108893 By: Yuri (ys) 2008-03-15 08:54:39 Oops. wrong patch, please delete "trunk_lock_utils_threadstorage.v2.diff" and test "trunk_lock_utils_threadstorage.v3.diff" By: Yuri (ys) 2008-03-15 11:32:10 in trunk_lock_utils_threadstorage.v4.diff, i merge dimas issue [11537] into rwlock code By: Russell Bryant (russell) 2008-03-18 17:20:42 This code does not compile for me under Linux with DEBUG_THREADS enabled ... By: Yuri (ys) 2008-05-20 07:30:36 I upload new patch: trunk_lock_utils.v5.diff It tested under FreeBSD 6.*, 7.* and Linux. Him contain tiny changes in main/utils.c and main/channel.c files. By: Yuri (ys) 2008-05-26 07:17:53 patch: trunk_lock_utils.v6.diff Sync with changes, created in revision 118173 by mmichelson. By: Russell Bryant (russell) 2008-05-30 08:55:24 The latest patch applies, but does not compile on my Linux system. By: Yuri (ys) 2008-06-01 05:19:32 Fixed in trunk_lock_utils.v7.diff (my wrong) Also need changes in utils/aelparse.c. Empty function ast_bt_get_addresses() need to be declared to avoid linkage error. But this file copied from ./res/ael/ael_lex.c ... By: Yuri (ys) 2008-06-01 08:51:57 utils linkage error fixed in trunk_lock_utils.v8.diff By: Digium Subversion (svnbot) 2008-06-03 13:20:14 Repository: asterisk Revision: 120064 U trunk/include/asterisk/lock.h U trunk/main/channel.c U trunk/main/utils.c U trunk/utils/ael_main.c U trunk/utils/conf2ael.c ------------------------------------------------------------------------ r120064 | russell | 2008-06-03 13:20:13 -0500 (Tue, 03 Jun 2008) | 10 lines Add lock tracking for rwlocks. Previously, lock.h only had the ability to hold tracking information for mutexes. Now, the "core show locks" output will output information about who is holding a rwlock when a thread is waiting on it. (closes issue ASTERISK-10793) Reported by: ys Patches: trunk_lock_utils.v8.diff uploaded by ys (license 281) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=120064 By: Digium Subversion (svnbot) 2008-06-03 13:20:52 Repository: asterisk Revision: 120065 _U branches/1.6.0/ ------------------------------------------------------------------------ r120065 | russell | 2008-06-03 13:20:51 -0500 (Tue, 03 Jun 2008) | 17 lines Blocked revisions 120064 via svnmerge ........ r120064 | russell | 2008-06-03 13:26:51 -0500 (Tue, 03 Jun 2008) | 10 lines Add lock tracking for rwlocks. Previously, lock.h only had the ability to hold tracking information for mutexes. Now, the "core show locks" output will output information about who is holding a rwlock when a thread is waiting on it. (closes issue ASTERISK-10793) Reported by: ys Patches: trunk_lock_utils.v8.diff uploaded by ys (license 281) ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=120065 |