<div dir="ltr"><div>Hi,</div><div>I'm moving my compositor to latest libweston 5.0 /wayland 1.16 library and I noticed a regression when I terminate my compositor.</div><div><br></div><div>The compositor will never exit because is stuck in a busy loop.</div><div>The busy loop is in the "<span class="gmail-blob-code-inner gmail-blob-code-marker-addition"><span class="gmail-pl-en">wl_priv_signal_final_emit</span></span>" that was added in the latest wayland. <br></div><div><br></div><div>And precisely is looping to notify that the same client is disconnected. With this code (from here: <a href="https://github.com/wayland-project/wayland/blame/bb1a8ca91e7d99f54b43ece01674ccbd720ec4bd/src/wayland-server.c#L2057">https://github.com/wayland-project/wayland/blame/bb1a8ca91e7d99f54b43ece01674ccbd720ec4bd/src/wayland-server.c#L2057</a>)<br></div><div><br></div><div><div class="gmail-d-flex gmail-flex-justify-start gmail-flex-items-start"><div class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line gmail-highlighted" id="gmail-LC2057">        <span class="gmail-pl-k">while</span> (!<span class="gmail-pl-c1">wl_list_empty</span>(&<span class="gmail-pl-c1">signal</span>-><span class="gmail-pl-smi">listener_list</span>)) {<br></div>
                </div>
                <div class="gmail-d-flex gmail-flex-justify-start gmail-flex-items-start">
                  </div><div class="gmail-d-flex gmail-flex-justify-start gmail-flex-items-start"><div class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" id="gmail-LC2058">  pos = <span class="gmail-pl-c1">signal</span>-><span class="gmail-pl-smi">listener_list</span>.<span class="gmail-pl-smi">next</span>;</div>
                </div>
                <div class="gmail-d-flex gmail-flex-justify-start gmail-flex-items-start">
                  </div><div class="gmail-d-flex gmail-flex-justify-start gmail-flex-items-start"><div class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" id="gmail-LC2059">            l = <span class="gmail-pl-c1">wl_container_of</span>(pos, l, <span class="gmail-pl-c1">link</span>);</div>
                </div>
                <div class="gmail-d-flex gmail-flex-justify-start gmail-flex-items-start">
                  </div><div class="gmail-d-flex gmail-flex-justify-start gmail-flex-items-start"><div class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" id="gmail-LC2060">
</div>
                </div>
                <div class="gmail-d-flex gmail-flex-justify-start gmail-flex-items-start">
                  </div><div class="gmail-d-flex gmail-flex-justify-start gmail-flex-items-start"><div class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" id="gmail-LC2061">            <span class="gmail-pl-c1">wl_list_remove</span>(pos);</div>
                </div>
                <div class="gmail-d-flex gmail-flex-justify-start gmail-flex-items-start">
                  </div><div class="gmail-d-flex gmail-flex-justify-start gmail-flex-items-start"><div class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" id="gmail-LC2062">            <span class="gmail-pl-c1">wl_list_init</span>(pos);</div>
                </div>
                <div class="gmail-d-flex gmail-flex-justify-start gmail-flex-items-start">
                  </div><div class="gmail-d-flex gmail-flex-justify-start gmail-flex-items-start"><div class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" id="gmail-LC2063">
</div>
                </div>
                <div class="gmail-d-flex gmail-flex-justify-start gmail-flex-items-start">
                  </div><div class="gmail-d-flex gmail-flex-justify-start gmail-flex-items-start"><div class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" id="gmail-LC2064">  l-><span class="gmail-pl-c1">notify</span>(l, data);</div>
                </div>
                <div class="gmail-d-flex gmail-flex-justify-start gmail-flex-items-start">
                  </div>  }</div><div><br></div><div>The listener_list is pointing to itself</div><div><br></div><div>$3 = {listener_list = {prev = 0x24f7eb0, next = 0x24f7eb0}, emit_list = {prev = 0x298f888, next = 0x298f888}}<br></div><div>But to be empty next should point to &listener_list that it is</div><div>p &$3->listener_list</div><div>$11 = (struct wl_list *) 0x298f878</div><div><br></div><div><br></div><div>A more expert eye on this codebase can confirm that there is no issue on how the    <span class="gmail-pl-c1">wl_list_remove is done in <span class="gmail-blob-code-inner gmail-blob-code-marker-addition"><span class="gmail-pl-en">wl_priv_signal_final_emit</span></span>?</span></div><div><span class="gmail-pl-c1"><br></span></div><div><span class="gmail-pl-c1">Best</span></div><div><span class="gmail-pl-c1">Matteo Valdina<br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div class="gmail_signature" data-smartmail="gmail_signature">“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”<br>- Tony Hoare</div></div></span></div></div>