You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by Palaash Jain <pa...@gmail.com> on 2026/03/06 10:46:31 UTC
Potential Infinite Looping
Hi,
I have built libguac on Windows using a MinGW pull request and a custom
guacd that does this,
a broker accepts socket connections,
creates a child worker (1 for each connection),
duplicates the socket and passes it via a pipe to the worker and then it
loads libguac and starts handling the connection.
(all of this on Windows)
I am facing scenarios where the socket connection between the Guacamole
Client and guacd (worker.exe) is closed but the worker.exe was kept running
in the background,
at the function *PFW_LFR_guac_display_plan_create*
https://github.com/apache/guacamole-server/blob/772a65a3334f7ded6d43cbe5e2ed347040a1fb52/src/libguac/display-plan.c#L157
(NOTE: This build is a clone of guacamole server repo dated 22nd May, 2025
this file hasn't been updated since then, could be missing something else)
Can there be a case where the buffers of the layers of display might
already have been set to NULL and it enters this function because of which,
it will keep on looping after checking this if condition,
if (current->pending_frame.buffer == NULL) {
GUAC_ASSERT(current->pending_frame.buffer_is_external);
continue;
}
I am not able to reproduce this consistently so any inputs on this will be
very helpful.
- Palaash
Re: Potential Infinite Looping
Posted by Michael Jumper <mj...@apache.org>.
On March 12, 2026 10:15:05 AM PDT, Nick Couchman <vn...@apache.org> wrote:
>On Thu, Mar 12, 2026 at 9:18 AM Palaash Jain
><pa...@gmail.com> wrote:
>>
>> Can I open a PR for this?
>
>Yes, you can - you will also need a Jira issue created for it.
>
I created:
https://issues.apache.org/jira/browse/GUACAMOLE-2241
for this.
- Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org
Re: Potential Infinite Looping
Posted by Nick Couchman <vn...@apache.org>.
On Thu, Mar 12, 2026 at 9:18 AM Palaash Jain
<pa...@gmail.com> wrote:
>
> Can I open a PR for this?
Yes, you can - you will also need a Jira issue created for it.
-Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org
Re: Potential Infinite Looping
Posted by Palaash Jain <pa...@gmail.com>.
Can I open a PR for this?
- Palaash
On Thu, 12 Mar 2026 at 14:53, Palaash Jain <pa...@gmail.com>
wrote:
> Hello Mike,
> We have been testing again, and have not faced this issue again so far...
> with the above line of code
>
> - Palaash
>
> On Sat, 7 Mar 2026 at 18:20, Palaash Jain <pa...@gmail.com>
> wrote:
>
>> Hi Mike,
>> Thanks for your response, I will test with that fix and get back to you.
>> Since we had noticed this during load testing, will update asap once we
>> perform it again
>>
>> - Palaash
>>
>> On Sat, 7 Mar 2026 at 11:43, Michael Jumper <mj...@apache.org> wrote:
>>
>>> On Friday, March 6, 2026 2:46:31 AM Pacific Standard Time Palaash Jain
>>> wrote:
>>> > Hi,
>>> > I have built libguac on Windows using a MinGW pull request and a custom
>>> > guacd that does this,
>>> >
>>> > a broker accepts socket connections,
>>> > creates a child worker (1 for each connection),
>>> > duplicates the socket and passes it via a pipe to the worker and then
>>> it
>>> > loads libguac and starts handling the connection.
>>> > (all of this on Windows)
>>> >
>>> > I am facing scenarios where the socket connection between the Guacamole
>>> > Client and guacd (worker.exe) is closed but the worker.exe was kept
>>> running
>>> > in the background,
>>> >
>>> > at the function *PFW_LFR_guac_display_plan_create*
>>> >
>>> https://github.com/apache/guacamole-server/blob/772a65a3334f7ded6d43cbe5e2ed
>>> > 347040a1fb52/src/libguac/display-plan.c#L157 (NOTE: This build is a
>>> clone of
>>> > guacamole server repo dated 22nd May, 2025 this file hasn't been
>>> updated
>>> > since then, could be missing something else)
>>> >
>>> > Can there be a case where the buffers of the layers of display might
>>> > already have been set to NULL and it enters this function because of
>>> which,
>>> > it will keep on looping after checking this if condition,
>>> >
>>> > if (current->pending_frame.buffer == NULL) {
>>> > GUAC_ASSERT(current->pending_frame.buffer_is_external);
>>> > continue;
>>> > }
>>> >
>>> > I am not able to reproduce this consistently so any inputs on this
>>> will be
>>> > very helpful.
>>> >
>>>
>>> That's definitely a bug - the current pointer needs to be advanced
>>> before
>>> continuing. If you change the quoted block to:
>>>
>>> if (current->pending_frame.buffer == NULL) {
>>> GUAC_ASSERT(current->pending_frame.buffer_is_external);
>>> current = current->pending_frame.next; /* <-- Add this line */
>>> continue;
>>> }
>>>
>>> does the issue go away?
>>>
>>> - Mike
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
>>> For additional commands, e-mail: user-help@guacamole.apache.org
>>>
>>>
Re: Potential Infinite Looping
Posted by Palaash Jain <pa...@gmail.com>.
Hello Mike,
We have been testing again, and have not faced this issue again so far...
with the above line of code
- Palaash
On Sat, 7 Mar 2026 at 18:20, Palaash Jain <pa...@gmail.com>
wrote:
> Hi Mike,
> Thanks for your response, I will test with that fix and get back to you.
> Since we had noticed this during load testing, will update asap once we
> perform it again
>
> - Palaash
>
> On Sat, 7 Mar 2026 at 11:43, Michael Jumper <mj...@apache.org> wrote:
>
>> On Friday, March 6, 2026 2:46:31 AM Pacific Standard Time Palaash Jain
>> wrote:
>> > Hi,
>> > I have built libguac on Windows using a MinGW pull request and a custom
>> > guacd that does this,
>> >
>> > a broker accepts socket connections,
>> > creates a child worker (1 for each connection),
>> > duplicates the socket and passes it via a pipe to the worker and then it
>> > loads libguac and starts handling the connection.
>> > (all of this on Windows)
>> >
>> > I am facing scenarios where the socket connection between the Guacamole
>> > Client and guacd (worker.exe) is closed but the worker.exe was kept
>> running
>> > in the background,
>> >
>> > at the function *PFW_LFR_guac_display_plan_create*
>> >
>> https://github.com/apache/guacamole-server/blob/772a65a3334f7ded6d43cbe5e2ed
>> > 347040a1fb52/src/libguac/display-plan.c#L157 (NOTE: This build is a
>> clone of
>> > guacamole server repo dated 22nd May, 2025 this file hasn't been updated
>> > since then, could be missing something else)
>> >
>> > Can there be a case where the buffers of the layers of display might
>> > already have been set to NULL and it enters this function because of
>> which,
>> > it will keep on looping after checking this if condition,
>> >
>> > if (current->pending_frame.buffer == NULL) {
>> > GUAC_ASSERT(current->pending_frame.buffer_is_external);
>> > continue;
>> > }
>> >
>> > I am not able to reproduce this consistently so any inputs on this will
>> be
>> > very helpful.
>> >
>>
>> That's definitely a bug - the current pointer needs to be advanced before
>> continuing. If you change the quoted block to:
>>
>> if (current->pending_frame.buffer == NULL) {
>> GUAC_ASSERT(current->pending_frame.buffer_is_external);
>> current = current->pending_frame.next; /* <-- Add this line */
>> continue;
>> }
>>
>> does the issue go away?
>>
>> - Mike
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
>> For additional commands, e-mail: user-help@guacamole.apache.org
>>
>>
Re: Potential Infinite Looping
Posted by Palaash Jain <pa...@gmail.com>.
Hi Mike,
Thanks for your response, I will test with that fix and get back to you.
Since we had noticed this during load testing, will update asap once we
perform it again
- Palaash
On Sat, 7 Mar 2026 at 11:43, Michael Jumper <mj...@apache.org> wrote:
> On Friday, March 6, 2026 2:46:31 AM Pacific Standard Time Palaash Jain
> wrote:
> > Hi,
> > I have built libguac on Windows using a MinGW pull request and a custom
> > guacd that does this,
> >
> > a broker accepts socket connections,
> > creates a child worker (1 for each connection),
> > duplicates the socket and passes it via a pipe to the worker and then it
> > loads libguac and starts handling the connection.
> > (all of this on Windows)
> >
> > I am facing scenarios where the socket connection between the Guacamole
> > Client and guacd (worker.exe) is closed but the worker.exe was kept
> running
> > in the background,
> >
> > at the function *PFW_LFR_guac_display_plan_create*
> >
> https://github.com/apache/guacamole-server/blob/772a65a3334f7ded6d43cbe5e2ed
> > 347040a1fb52/src/libguac/display-plan.c#L157 (NOTE: This build is a
> clone of
> > guacamole server repo dated 22nd May, 2025 this file hasn't been updated
> > since then, could be missing something else)
> >
> > Can there be a case where the buffers of the layers of display might
> > already have been set to NULL and it enters this function because of
> which,
> > it will keep on looping after checking this if condition,
> >
> > if (current->pending_frame.buffer == NULL) {
> > GUAC_ASSERT(current->pending_frame.buffer_is_external);
> > continue;
> > }
> >
> > I am not able to reproduce this consistently so any inputs on this will
> be
> > very helpful.
> >
>
> That's definitely a bug - the current pointer needs to be advanced before
> continuing. If you change the quoted block to:
>
> if (current->pending_frame.buffer == NULL) {
> GUAC_ASSERT(current->pending_frame.buffer_is_external);
> current = current->pending_frame.next; /* <-- Add this line */
> continue;
> }
>
> does the issue go away?
>
> - Mike
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
> For additional commands, e-mail: user-help@guacamole.apache.org
>
>
Re: Potential Infinite Looping
Posted by Michael Jumper <mj...@apache.org>.
On Friday, March 6, 2026 2:46:31 AM Pacific Standard Time Palaash Jain wrote:
> Hi,
> I have built libguac on Windows using a MinGW pull request and a custom
> guacd that does this,
>
> a broker accepts socket connections,
> creates a child worker (1 for each connection),
> duplicates the socket and passes it via a pipe to the worker and then it
> loads libguac and starts handling the connection.
> (all of this on Windows)
>
> I am facing scenarios where the socket connection between the Guacamole
> Client and guacd (worker.exe) is closed but the worker.exe was kept running
> in the background,
>
> at the function *PFW_LFR_guac_display_plan_create*
> https://github.com/apache/guacamole-server/blob/772a65a3334f7ded6d43cbe5e2ed
> 347040a1fb52/src/libguac/display-plan.c#L157 (NOTE: This build is a clone of
> guacamole server repo dated 22nd May, 2025 this file hasn't been updated
> since then, could be missing something else)
>
> Can there be a case where the buffers of the layers of display might
> already have been set to NULL and it enters this function because of which,
> it will keep on looping after checking this if condition,
>
> if (current->pending_frame.buffer == NULL) {
> GUAC_ASSERT(current->pending_frame.buffer_is_external);
> continue;
> }
>
> I am not able to reproduce this consistently so any inputs on this will be
> very helpful.
>
That's definitely a bug - the current pointer needs to be advanced before
continuing. If you change the quoted block to:
if (current->pending_frame.buffer == NULL) {
GUAC_ASSERT(current->pending_frame.buffer_is_external);
current = current->pending_frame.next; /* <-- Add this line */
continue;
}
does the issue go away?
- Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org