[zeromq-dev] Regression in czmq (latest)

Felipe Cruz felipecruz at loogica.net
Wed Sep 26 04:11:49 CEST 2012


Hello!

zlist_last changes self->cursor to tail. this behaviour triggers this code:


    zlist_append (list, cheese);
    zlist_append (list, bread);
    assert (zlist_last (list) == bread);   ---- cursor at this moment,
points to bread..
    zlist_remove (list, bread);

------ inside zlist_remove -----
    if (self->cursor && self->cursor->item == item)  ----- True
        node = self->cursor;                                      ------
prev still == NULL
....
        if (prev)
            prev->next = node->next;
        else
            self->head = node->next; ---- this line is executed since prev
== NULL

        if (node->next == NULL)
            self->tail = prev;               ---- set tail to NULL
----- end inside-------

    assert (zlist_last (list) == cheese); -----

---- inside zlist_last ------

    self->cursor = self->tail;
    if (self->cursor)                               -- False
        return self->cursor->item;
    else
        return NULL;                               -- ERROR


PR sent.

regards,
Felipe Cruz




2012/9/25 Stephen Hemminger <shemminger at vyatta.com>

> Noticed build failures after merge, because build script does check test.
>
> Bisected it down to:
> $ make -j1 check
> Making check in src
> make[1]: Entering directory `/usr/src/zeromq/czmq/src'
> make  check-TESTS
> make[2]: Entering directory `/usr/src/zeromq/czmq/src'
> Running czmq self tests...
>  * zclock: OK
>  * zctx: OK
>  * zfile: OK
>  * zframe: OK
>  * zhash: OK
> lt-czmq_selftest: zlist.c:405: zlist_test: Assertion `zlist_last (list) ==
> cheese' failed.
>  * zlist: /bin/bash: line 5: 19608 Aborted                 ${dir}$tst
> FAIL: czmq_selftest
> ============================================
> 1 of 1 test failed
> Please report to zeromq-dev at lists.zeromq.org
> ============================================
> make[2]: *** [check-TESTS] Error 1
> make[2]: Leaving directory `/usr/src/zeromq/czmq/src'
> make[1]: *** [check-am] Error 2
> make[1]: Leaving directory `/usr/src/zeromq/czmq/src'
> make: *** [check-recursive] Error 1
>
> $ git bisect bad
> f5b8dad1a26d0405d6c30960b82d94aa2500b2cc is the first bad commit
> commit f5b8dad1a26d0405d6c30960b82d94aa2500b2cc
> Author: Pieter Hintjens <ph at imatix.com>
> Date:   Sat Sep 22 10:54:11 2012 +0200
>
>     Optimization for zlist_remove last seen item
>
> :040000 040000 525da044b721454a494c0f6b80c6c0cef7d18adc
> fd0c04f0926481cce77f3a6fa195f54326239c1c M      src
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120925/e9accded/attachment.htm>


More information about the zeromq-dev mailing list