Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
a serving of gourmet, artisan prepared insect appetizers #2151
Here is a batch of minor bug fixes peeled off of various in-progress PR's I've been working on, covering:
Problem: when run level 2 terminates due to a signal, 128 is added to the signal number before it is passed to strsignal() for decoding. Decode the signal before adding 128 to it to make the exit code.
Problem: aux_destroy() is not safe against destructors calling aux_set() or aux_get(), because destructor is called with the item being destroyed still linked into the list. Specifically, aux_set() could result in the new item being lost, and aux_get() could allow access to the item that is being destroyed. Modify aux_destroy() to safely unlink an item before calling its destructor. Add unit tests to cover these situations.
Problem: old def of flux_msg_t is there, commented out, in the header. In the code, definition is within the begin/end manual codec comments. Drop the commented out definition in the header, and relocate the definition in the code.
Problem: flux_respond*() segfaults if flux_t handle or response arguments are NULL. Add code to check for NULL and fail with EINVAL. Add unit test coverage for these cases.
Problem: There is duplicate code for accessing u32 values in PROTO block, and the assignment of fields depending on message type is confusing. Combine rolemask, userid, bigint and bigint2 into a "u32 array", with common accessors. Add convenience macros mapping field names to positions in the array. This will make changing PROTO easier in the future.
Problem: build of python bindings emits warnings like this: _core.c:2328:3: warning: missing initializer for field ‘reserved1’ of ‘struct _cffi_externpy_s’ [-Wmissing-field-initializers] This is generated code, so suppress the warning by changing -Wno-error=missing-field-initializers to -Wno-missing-field-initializers Fixes #2147
LGTM! My only comment is that the docs for
The other benefit do declaring
diff --git a/configure.ac b/configure.ac index 7644a1b0d..78abd1ff5 100644 --- a/configure.ac +++ b/configure.ac @@ -108,6 +108,7 @@ else fi # N.B. /usr/bin/rsh is a symlink to preferred remote shell on some systems +AC_ARG_VAR(SSH, [The path to preferred remote shell]) AC_PATH_PROGS(SSH, [rsh ssh], [/usr/bin/rsh]) AC_DEFINE_UNQUOTED([PATH_SSH], "$SSH", [Define remote shell program to be used by the ssh:// connector])
@@ Coverage Diff @@ ## master #2151 +/- ## ========================================== + Coverage 80.38% 80.43% +0.04% ========================================== Files 200 200 Lines 31769 31757 -12 ========================================== + Hits 25539 25544 +5 + Misses 6230 6213 -17
Problem: default remote shell is hardwired in the ssh connector source to "/usr/bin/rsh". On systems that don't install "mrsh" (TOSS) and don't use debian alternatives, /usr/bin/rsh is not a symlink to the preferred remote shell. Have autoconf perform the search for a suitable remote shell program, and put the results in PATH_SSH, then use that in the ssh connector source. Configure searches in the current path for "rsh", then "ssh", then falls back to /usr/bin/rsh as before if none found.