<div dir="ltr"><div dir="ltr"><div>Hi,</div><div>I figure it out. The issue was in my compositor.</div><div>For reference, I was using the same wl_listener for multiple clients (wl_client_add_destroy_listener). This was the root cause of my issue.</div><div><br></div><div>Best</div><div>Matteo<br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 29, 2018 at 4:46 PM Matteo Valdina <<a href="mailto:matteo.valdina@gmail.com">matteo.valdina@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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="m_8891093160045360657gmail-blob-code-inner m_8891093160045360657gmail-blob-code-marker-addition"><span class="m_8891093160045360657gmail-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" target="_blank">https://github.com/wayland-project/wayland/blame/bb1a8ca91e7d99f54b43ece01674ccbd720ec4bd/src/wayland-server.c#L2057</a>)<br></div><div><br></div><div><div class="m_8891093160045360657gmail-d-flex m_8891093160045360657gmail-flex-justify-start m_8891093160045360657gmail-flex-items-start"><div class="m_8891093160045360657gmail-blob-code m_8891093160045360657gmail-blob-code-inner m_8891093160045360657gmail-js-file-line m_8891093160045360657gmail-highlighted" id="m_8891093160045360657gmail-LC2057"> <span class="m_8891093160045360657gmail-pl-k">while</span> (!<span class="m_8891093160045360657gmail-pl-c1">wl_list_empty</span>(&<span class="m_8891093160045360657gmail-pl-c1">signal</span>-><span class="m_8891093160045360657gmail-pl-smi">listener_list</span>)) {<br></div>
                </div>
                <div class="m_8891093160045360657gmail-d-flex m_8891093160045360657gmail-flex-justify-start m_8891093160045360657gmail-flex-items-start">
                  </div><div class="m_8891093160045360657gmail-d-flex m_8891093160045360657gmail-flex-justify-start m_8891093160045360657gmail-flex-items-start"><div class="m_8891093160045360657gmail-blob-code m_8891093160045360657gmail-blob-code-inner m_8891093160045360657gmail-js-file-line" id="m_8891093160045360657gmail-LC2058">  pos = <span class="m_8891093160045360657gmail-pl-c1">signal</span>-><span class="m_8891093160045360657gmail-pl-smi">listener_list</span>.<span class="m_8891093160045360657gmail-pl-smi">next</span>;</div>
                </div>
                <div class="m_8891093160045360657gmail-d-flex m_8891093160045360657gmail-flex-justify-start m_8891093160045360657gmail-flex-items-start">
                  </div><div class="m_8891093160045360657gmail-d-flex m_8891093160045360657gmail-flex-justify-start m_8891093160045360657gmail-flex-items-start"><div class="m_8891093160045360657gmail-blob-code m_8891093160045360657gmail-blob-code-inner m_8891093160045360657gmail-js-file-line" id="m_8891093160045360657gmail-LC2059">                 l = <span class="m_8891093160045360657gmail-pl-c1">wl_container_of</span>(pos, l, <span class="m_8891093160045360657gmail-pl-c1">link</span>);</div>
                </div>
                <div class="m_8891093160045360657gmail-d-flex m_8891093160045360657gmail-flex-justify-start m_8891093160045360657gmail-flex-items-start">
                  </div><div class="m_8891093160045360657gmail-d-flex m_8891093160045360657gmail-flex-justify-start m_8891093160045360657gmail-flex-items-start"><div class="m_8891093160045360657gmail-blob-code m_8891093160045360657gmail-blob-code-inner m_8891093160045360657gmail-js-file-line" id="m_8891093160045360657gmail-LC2060">
</div>
                </div>
                <div class="m_8891093160045360657gmail-d-flex m_8891093160045360657gmail-flex-justify-start m_8891093160045360657gmail-flex-items-start">
                  </div><div class="m_8891093160045360657gmail-d-flex m_8891093160045360657gmail-flex-justify-start m_8891093160045360657gmail-flex-items-start"><div class="m_8891093160045360657gmail-blob-code m_8891093160045360657gmail-blob-code-inner m_8891093160045360657gmail-js-file-line" id="m_8891093160045360657gmail-LC2061">                 <span class="m_8891093160045360657gmail-pl-c1">wl_list_remove</span>(pos);</div>
                </div>
                <div class="m_8891093160045360657gmail-d-flex m_8891093160045360657gmail-flex-justify-start m_8891093160045360657gmail-flex-items-start">
                  </div><div class="m_8891093160045360657gmail-d-flex m_8891093160045360657gmail-flex-justify-start m_8891093160045360657gmail-flex-items-start"><div class="m_8891093160045360657gmail-blob-code m_8891093160045360657gmail-blob-code-inner m_8891093160045360657gmail-js-file-line" id="m_8891093160045360657gmail-LC2062">                 <span class="m_8891093160045360657gmail-pl-c1">wl_list_init</span>(pos);</div>
                </div>
                <div class="m_8891093160045360657gmail-d-flex m_8891093160045360657gmail-flex-justify-start m_8891093160045360657gmail-flex-items-start">
                  </div><div class="m_8891093160045360657gmail-d-flex m_8891093160045360657gmail-flex-justify-start m_8891093160045360657gmail-flex-items-start"><div class="m_8891093160045360657gmail-blob-code m_8891093160045360657gmail-blob-code-inner m_8891093160045360657gmail-js-file-line" id="m_8891093160045360657gmail-LC2063">
</div>
                </div>
                <div class="m_8891093160045360657gmail-d-flex m_8891093160045360657gmail-flex-justify-start m_8891093160045360657gmail-flex-items-start">
                  </div><div class="m_8891093160045360657gmail-d-flex m_8891093160045360657gmail-flex-justify-start m_8891093160045360657gmail-flex-items-start"><div class="m_8891093160045360657gmail-blob-code m_8891093160045360657gmail-blob-code-inner m_8891093160045360657gmail-js-file-line" id="m_8891093160045360657gmail-LC2064">  l-><span class="m_8891093160045360657gmail-pl-c1">notify</span>(l, data);</div>
                </div>
                <div class="m_8891093160045360657gmail-d-flex m_8891093160045360657gmail-flex-justify-start m_8891093160045360657gmail-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="m_8891093160045360657gmail-pl-c1">wl_list_remove is done in <span class="m_8891093160045360657gmail-blob-code-inner m_8891093160045360657gmail-blob-code-marker-addition"><span class="m_8891093160045360657gmail-pl-en">wl_priv_signal_final_emit</span></span>?</span></div><div><span class="m_8891093160045360657gmail-pl-c1"><br></span></div><div><span class="m_8891093160045360657gmail-pl-c1">Best</span></div><div><span class="m_8891093160045360657gmail-pl-c1">Matteo Valdina<br clear="all"><br>-- <br><div dir="ltr" class="m_8891093160045360657gmail_signature" data-smartmail="gmail_signature"><div class="m_8891093160045360657gmail_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>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" 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>