| 1 |
Issues to be addressed for src/util/et: -*- text -*- |
| 2 |
|
| 3 |
|
| 4 |
Non-thread-safe aspects: |
| 5 |
|
| 6 |
error_message uses a static buffer for "unknown error code" messages; |
| 7 |
a per-thread buffer may be better, but that depends on dynamic |
| 8 |
allocation working. A caller-provided buffer would be best, but |
| 9 |
that's a API change. |
| 10 |
|
| 11 |
initialize_foo_error_table uses a global linked list hung off an |
| 12 |
unprotected variable in the library. {add,remove}_error_table do |
| 13 |
likewise, but can be changed without externally visible effect. |
| 14 |
|
| 15 |
Workaround: Use a global lock for all calls to error_message and |
| 16 |
com_err, and when adding or removing error tables. |
| 17 |
|
| 18 |
|
| 19 |
API divergence: |
| 20 |
|
| 21 |
Transarc and Heimdal both have APIs that are different from this |
| 22 |
version. (Specifics?) |
| 23 |
|
| 24 |
Karl Ramm has offered to try to combine them. |
| 25 |
|
| 26 |
Workaround: |
| 27 |
|
| 28 |
|
| 29 |
Reference counting: |
| 30 |
|
| 31 |
If libraries are dynamically loaded and unloaded, and the init/fini |
| 32 |
functions add and remove error tables for *other* libraries they |
| 33 |
depend on (e.g., if a dynamically loadable Zephyr library's fini |
| 34 |
function removes the krb4 library error table and then dlcloses the |
| 35 |
krb4 library, while another dlopen reference keeps the krb4 library |
| 36 |
around), the error table is kept; a table must be removed the same |
| 37 |
number of times it was added before the library itself can be |
| 38 |
discarded. |
| 39 |
|
| 40 |
It's not implemented as a reference count, but the effect is the same. |
| 41 |
|
| 42 |
Fix needed: Update documentation. |
| 43 |
|
| 44 |
|
| 45 |
64-bit support: |
| 46 |
|
| 47 |
Values are currently computed as 32-bit values, sign-extended to |
| 48 |
"long", and output with "L" suffixes. Type errcode_t is "long". |
| 49 |
Kerberos uses a separately chosen signed type of at least 32 bits for |
| 50 |
error codes. The com_err library only look at the low 32 bits, so |
| 51 |
this is mostly just an issue for application code -- if anything |
| 52 |
truncates to 32 bits, and then widens without sign-extending, the |
| 53 |
value may not compare equal to the macro defined in the .h file. This |
| 54 |
isn't anything unusual for signed constants, of course, just something |
| 55 |
to keep in mind.... |
| 56 |
|
| 57 |
Workaround: Always use signed types of at least 32 bits for error |
| 58 |
codes. |
| 59 |
|
| 60 |
|
| 61 |
man page: |
| 62 |
|
| 63 |
No documentation on add_error_table/remove_error_table interfaces, |
| 64 |
even though they're the new, preferred interface. |