On 2016-08-04 at 14:54 Dan Cross <[email protected]> wrote: > > > On lines 13-15 of user/parlib/include/parlib/dtls.h, __GNUC__ is sadly > > > defined by several compilers (GCC, clang, and the Intel C compiler). Is > > it > > > really that we care about GCC, or is it just that we care about being > > > GCC-compatible? (I assume the latter.) > > > > You'd have to ask Kevin. This code originally came from Linux Parlib. > > > I guess a larger question is if we'd ever try to compile this with a > compiler for which this wouldn't work. Perhaps we should remove the > '#error' and ifdef's, since they don't actually test for exactly GCC.
I imagine we'll run into a lot of things similar to that throughout the code base. > > On line 20 of user/utest/dtls.c I think it would be slightly more > > > informative to say, "Expected NULL ..." instead of "expected 0" to > > > accentuate that it's looking at a pointer, not an int. > > > > I don't see a change on github; did you push it up? Nope. I also don't plan to. Sorry if 'Noted' wasn't clear in that regard. > > On lines 77-85, it's unclear to me what the expected behavior of setting > > > from a dtor is; could you add an assert to probe that? > > > > It is expected to not loop infinitely or to lose storage. > > > > Calling pthread_setspecific() from a thread-specific data > > destructor routine may result either in lost storage (after at > > least PTHREAD_DESTRUCTOR_ITERATIONS attempts at destruction) or > > in an infinite loop. > > > > Kevin designed it to not fail in that manner. We can notice the > > infinite loop, but not the storage loss. > > > Ah. It is worth adding a comment to the test case to explain that. Not sure this is worth doing. The test is called "set from dtor". We test if we can do that. There's lots of other ways the test could fail. Should we enumerate those? This test originally failed due to a page fault, and only because I gave it a weird value (15) for the set_val and was doing a wild memory access. Anyway, I added a comment on that test. Barret The following changes since commit a0b47ac35e264df5f5e1a8bef4ecf57b1ff416e2: Fix inb when linux tests for the PIC (2016-08-04 11:06:46 -0700) are available in the git repository at: [email protected]:brho/akaros.git dtls for you to fetch changes up to 9475e8e9bf6e27ae44f1ab36790f5d524fdd8f32: Fix multiple setting in DTLS (2016-08-04 14:09:53 -0700) ---------------------------------------------------------------- View this online at: https://github.com/brho/akaros/compare/a0b47ac35e26...9475e8e9bf6e ---------------------------------------------------------------- Barret Rhoden (4): Fix the license on certain Parlib files Add a couple features to .clang_format Reformat DTLS Fix multiple setting in DTLS .clang-format | 3 +- user/parlib/dtls.c | 309 +++++++++++++++++----------------- user/parlib/include/parlib/dtls.h | 33 ++-- user/parlib/include/parlib/spinlock.h | 15 +- user/parlib/spinlock.c | 17 +- user/utest/dtls.c | 109 ++++++++++++ 6 files changed, 278 insertions(+), 208 deletions(-) create mode 100644 user/utest/dtls.c -- You received this message because you are subscribed to the Google Groups "Akaros" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
