Re: guacd immediately disconnects when built and run on Alpine 3.7 (musl libc)

2018-11-30 Thread Roman Shaposhnik
On Sat, Nov 17, 2018 at 7:31 PM Mike Jumper  wrote:
>
> On Sat, Nov 17, 2018 at 12:59 PM Roman Shaposhnik 
> wrote:
>
> > Hi!
> >
> > happy to report that I got to the bottom of this and have a patch that
> > makes guacd run on Alpine 3.8 just fine now:
> >https://issues.apache.org/jira/browse/GUACAMOLE-663
> >
> >
> Thanks, Roman. Please open a pull request with your proposed changes rather
> than attaching a patch to JIRA. We can then review your changes and merge
> when everything is accepted. See:
>
> https://github.com/apache/guacamole-server/blob/master/CONTRIBUTING
> http://guacamole.apache.org/open-source/#contribute

Sorry for the delay. I've submitted the following PR:
   https://github.com/apache/guacamole-server/pull/206

Thanks,
Roman.


Re: guacd immediately disconnects when built and run on Alpine 3.7 (musl libc)

2018-11-17 Thread Mike Jumper
On Sat, Nov 17, 2018 at 12:59 PM Roman Shaposhnik 
wrote:

> Hi!
>
> happy to report that I got to the bottom of this and have a patch that
> makes guacd run on Alpine 3.8 just fine now:
>https://issues.apache.org/jira/browse/GUACAMOLE-663
>
>
Thanks, Roman. Please open a pull request with your proposed changes rather
than attaching a patch to JIRA. We can then review your changes and merge
when everything is accepted. See:

https://github.com/apache/guacamole-server/blob/master/CONTRIBUTING
http://guacamole.apache.org/open-source/#contribute

Would be awesome if something along these lines made it into 1.0
> release. I'd love to help with testing or anything else.
>

The scope of the 1.0.0 release has already been finalized. Only changes
directly related to those already within release scope will be merged for
inclusion in 1.0.0. The changes you've contributed, after review and when
accepted, would go into the next release whose scope has not yet been
finalized. At the moment, that release would be 2.0.0.

- Mike


Re: guacd immediately disconnects when built and run on Alpine 3.7 (musl libc)

2018-11-17 Thread Roman Shaposhnik
Hi!

happy to report that I got to the bottom of this and have a patch that
makes guacd run on Alpine 3.8 just fine now:
   https://issues.apache.org/jira/browse/GUACAMOLE-663

Would be awesome if something along these lines made it into 1.0
release. I'd love to help with testing or anything else.

Thanks,
Roman.
On Sat, Nov 17, 2018 at 12:41 AM Roman Shaposhnik  wrote:
>
> Hi Mike!
>
> what's happening is kind of crazy -- and I'd really appreciate more of
> your advice getting
> to the bottom of this. Here's what I did:
>
> $ gdb /usr/sbin/guacd
> (gdb) set follow-fork-mode child
> (gdb) attach 1
> (gdb) cont
> Continuing.
> [New LWP 29]
> [New process 30]
> [New LWP 33]
> [New LWP 34]
> [New LWP 35]
> [New LWP 36]
>
> Thread 2.4 "guacd" received signal SIGSEGV, Segmentation fault.
> [Switching to LWP 35]
> guac_vnc_clipboard_end_handler (user=,
> stream=) at clipboard.c:109
> 109 char* output = output_data;
> (gdb)
>
> So you were absolutely right -- it did SIGSEGV and I guess we need to
> the bottom of this.
>
> However, the crazy part is this: the sub-process that SIGSEGVed is now
> stopped by gdb, however
> (since I accidentally clicked on reconnect in the GUI) the new
> sub-process that got forked is
> complete fine. In fact, for as long as I keep the SIGSEGVed one
> stopped I can start new sessions,
> interact with my VNC and everything looks just peachy. I can even
> fully disconnect/reconnect
> (making sure that new sub-processes get forked) and all that is totally fine.
>
> Any ideas on what could cause this weird behaviour (and also what
> could be a potential cause
> for the  SIGSEGV above)?
>
> Thanks,
> Roman.
> On Fri, Nov 16, 2018 at 9:30 PM Roman Shaposhnik  wrote:
> >
> > On Fri, Nov 16, 2018 at 12:31 AM Mike Jumper  wrote:
> > >
> > > On Wed, Nov 14, 2018 at 10:52 PM Roman Shaposhnik  wrote:
> > >
> > > > Hi!
> > > >
> > > > first of all -- just wanted to say that Guacamole is one
> > > > impressive project -- very well done.
> > >
> > >
> > > Thanks!
> > >
> > > ...
> > > > guacd[9]: INFO: User "@6c100210-b28a-46ae-9db7-00b30782b5c2" joined
> > > > connection "$b8a08e42-bb09-4d10-8631-9143ea018a5c" (1 users now
> > > > present)
> > > > guacd[9]: TRACE: Server completed frame 119195788ms.
> > > > guacd[1]: INFO: Connection "$b8a08e42-bb09-4d10-8631-9143ea018a5c" 
> > > > removed.
> > > >
> > >
> > > If the connection terminated normally, there would be additional log
> > > messages before that "Connection removed" message mentioning that the user
> > > is disconnected, the VNC connection is closed, etc. Those messages would 
> > > be
> > > logged by the process handling the VNC connection (in this case PID 9). 
> > > The
> > > fact that those messages do not appear suggests that the process handling
> > > the VNC connection may have crashed.
> >
> > That's very helpful! Thanks!
> >
> > > Are you able to run a debugger under Alpine?
> >
> > Yes. So let me attach gdb to guacd and see if any of the forked off
> > processes core dump
> > or exit abnormally. Will let you know tomorrow.
> >
> > Thanks,
> > Roman.


Re: guacd immediately disconnects when built and run on Alpine 3.7 (musl libc)

2018-11-17 Thread Roman Shaposhnik
Hi Mike!

what's happening is kind of crazy -- and I'd really appreciate more of
your advice getting
to the bottom of this. Here's what I did:

$ gdb /usr/sbin/guacd
(gdb) set follow-fork-mode child
(gdb) attach 1
(gdb) cont
Continuing.
[New LWP 29]
[New process 30]
[New LWP 33]
[New LWP 34]
[New LWP 35]
[New LWP 36]

Thread 2.4 "guacd" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 35]
guac_vnc_clipboard_end_handler (user=,
stream=) at clipboard.c:109
109 char* output = output_data;
(gdb)

So you were absolutely right -- it did SIGSEGV and I guess we need to
the bottom of this.

However, the crazy part is this: the sub-process that SIGSEGVed is now
stopped by gdb, however
(since I accidentally clicked on reconnect in the GUI) the new
sub-process that got forked is
complete fine. In fact, for as long as I keep the SIGSEGVed one
stopped I can start new sessions,
interact with my VNC and everything looks just peachy. I can even
fully disconnect/reconnect
(making sure that new sub-processes get forked) and all that is totally fine.

Any ideas on what could cause this weird behaviour (and also what
could be a potential cause
for the  SIGSEGV above)?

Thanks,
Roman.
On Fri, Nov 16, 2018 at 9:30 PM Roman Shaposhnik  wrote:
>
> On Fri, Nov 16, 2018 at 12:31 AM Mike Jumper  wrote:
> >
> > On Wed, Nov 14, 2018 at 10:52 PM Roman Shaposhnik  wrote:
> >
> > > Hi!
> > >
> > > first of all -- just wanted to say that Guacamole is one
> > > impressive project -- very well done.
> >
> >
> > Thanks!
> >
> > ...
> > > guacd[9]: INFO: User "@6c100210-b28a-46ae-9db7-00b30782b5c2" joined
> > > connection "$b8a08e42-bb09-4d10-8631-9143ea018a5c" (1 users now
> > > present)
> > > guacd[9]: TRACE: Server completed frame 119195788ms.
> > > guacd[1]: INFO: Connection "$b8a08e42-bb09-4d10-8631-9143ea018a5c" 
> > > removed.
> > >
> >
> > If the connection terminated normally, there would be additional log
> > messages before that "Connection removed" message mentioning that the user
> > is disconnected, the VNC connection is closed, etc. Those messages would be
> > logged by the process handling the VNC connection (in this case PID 9). The
> > fact that those messages do not appear suggests that the process handling
> > the VNC connection may have crashed.
>
> That's very helpful! Thanks!
>
> > Are you able to run a debugger under Alpine?
>
> Yes. So let me attach gdb to guacd and see if any of the forked off
> processes core dump
> or exit abnormally. Will let you know tomorrow.
>
> Thanks,
> Roman.


Re: guacd immediately disconnects when built and run on Alpine 3.7 (musl libc)

2018-11-16 Thread Roman Shaposhnik
On Fri, Nov 16, 2018 at 12:31 AM Mike Jumper  wrote:
>
> On Wed, Nov 14, 2018 at 10:52 PM Roman Shaposhnik  wrote:
>
> > Hi!
> >
> > first of all -- just wanted to say that Guacamole is one
> > impressive project -- very well done.
>
>
> Thanks!
>
> ...
> > guacd[9]: INFO: User "@6c100210-b28a-46ae-9db7-00b30782b5c2" joined
> > connection "$b8a08e42-bb09-4d10-8631-9143ea018a5c" (1 users now
> > present)
> > guacd[9]: TRACE: Server completed frame 119195788ms.
> > guacd[1]: INFO: Connection "$b8a08e42-bb09-4d10-8631-9143ea018a5c" removed.
> >
>
> If the connection terminated normally, there would be additional log
> messages before that "Connection removed" message mentioning that the user
> is disconnected, the VNC connection is closed, etc. Those messages would be
> logged by the process handling the VNC connection (in this case PID 9). The
> fact that those messages do not appear suggests that the process handling
> the VNC connection may have crashed.

That's very helpful! Thanks!

> Are you able to run a debugger under Alpine?

Yes. So let me attach gdb to guacd and see if any of the forked off
processes core dump
or exit abnormally. Will let you know tomorrow.

Thanks,
Roman.


Re: guacd immediately disconnects when built and run on Alpine 3.7 (musl libc)

2018-11-16 Thread Mike Jumper
On Wed, Nov 14, 2018 at 10:52 PM Roman Shaposhnik  wrote:

> Hi!
>
> first of all -- just wanted to say that Guacamole is one
> impressive project -- very well done.


Thanks!

...
> guacd[9]: INFO: User "@6c100210-b28a-46ae-9db7-00b30782b5c2" joined
> connection "$b8a08e42-bb09-4d10-8631-9143ea018a5c" (1 users now
> present)
> guacd[9]: TRACE: Server completed frame 119195788ms.
> guacd[1]: INFO: Connection "$b8a08e42-bb09-4d10-8631-9143ea018a5c" removed.
>

If the connection terminated normally, there would be additional log
messages before that "Connection removed" message mentioning that the user
is disconnected, the VNC connection is closed, etc. Those messages would be
logged by the process handling the VNC connection (in this case PID 9). The
fact that those messages do not appear suggests that the process handling
the VNC connection may have crashed.

Are you able to run a debugger under Alpine?

- Mike