[zeromq-dev] Compilation fails when NDEBUG is enabled.

Arthur O'Dwyer arthur at push.am
Thu Aug 23 23:15:22 CEST 2012


Hi Chernyshev,

  Actually I have already posted a pull request for the test_monitor
issue, and it has already been pulled by ianbarber!

  Thanks to ianbarber for those pulls --- although I'm slightly
disturbed by the fact that they happened like 30 seconds after I
posted the requests. That doesn't seem like enough time for even Ian
to verify that the patches worked as advertised. :P

-Arthur,
"trust but verify"

On Thu, Aug 23, 2012 at 2:06 PM, Chernyshev Vyacheslav <astellar at ro.ru> wrote:
> Thank you. What do you think about other problems in test_monitor? I
> will partially repeat my message posted in thread "Reporting make check
> error". Do not want to create a pull request without discussing this
> issue with others, even if it seems that issue is really present.
>
> First, memcmp returns zero if two byte strings are equal. We assert that
> it is non-zero in all cases of test_monitor. So test passes only if two
> byte strings are different everywhere. Is it really an intended
> behaviour? Second, memcmp compares 22 bytes of memory, while addr char
> array "tcp://127.0.0.1:5560" has only 20 bytes (not counting trailing
> zero terminator) and it means that data_-><something>.addr can not have
> more than 20 bytes too. memcmp does not stop like strcmp when it finds a
> '\0' character, it simply compares passed amount of bytes. So we
> definitely read memory that does not belong to us.
>
> As we do not know length of data_-><something>.addr in advance, probably
> strcmp (or strncmp with upper limit of addr length) should be used in
> this test case and at least some asserts must check whether strncmp(...)
> == 0.
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev



More information about the zeromq-dev mailing list