| Anonymous | Login | Signup for a new account | 11-10-2008 10:57 PST |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0000716 | [uClibc] Other | minor | always | 02-10-06 10:49 | 03-21-06 16:31 | ||||
| Reporter | rholzmann | View Status | public | ||||||
| Assigned To | uClibc | ||||||||
| Priority | normal | Resolution | fixed | ||||||
| Status | closed | Product Version | 0.9.28 | ||||||
| Summary | 0000716: libc/misc/utmp/utent.c deadlocks when used with libpthread | ||||||||
| Description |
utent.c has a few problems with mutex locking when used in a binary that was linked with pthreads. The are a few deadlock conditions where functions may be called which lock the utmplock but never release it and where a function that hold the lock calls other functions which try to relock the same lock. Here is one example in the function __getutent: static struct utmp *__getutent(int utmp_fd) { if (utmp_fd == -1) { setutent(); } if (utmp_fd == -1) { return NULL; } LOCK; if (read(utmp_fd, (char *) &static_utmp, sizeof(struct utmp)) != sizeof(struct utmp)) { return NULL; } UNLOCK; return &static_utmp; } Notice the error condition does not unlock the semaphore. The problem is not visible when pthreads isn't used since the lock/unlock functions are NOOP functions. I have attached a patch file that tries to correct these problems. I think the patch fixes all of the possible deadlock conditions. Let me know what you think. |
||||||||
| Additional Information | |||||||||
| Attached Files |
|
||||||||
|
|
|||||||||
| Copyright © 2000 - 2006 Mantis Group |