Re: guacd immediately disconnects when built and run on Alpine 3.7 (musl libc)
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)
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)
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)
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)
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)
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
guacd immediately disconnects when built and run on Alpine 3.7 (musl libc)
Hi! first of all -- just wanted to say that Guacamole is one impressive project -- very well done. I am using it for Edge Computing applications and trying to optimize on size as much as possible. This make me use Alpine linux as my target platform. Unfortunately, it seems that on Alpine (when built against musl libc) guacd has some kind of a mysterious issue. I say mysterious because it starts up just fine and even allows for the first frame of VNC screen to be displayed on the webpage, but the moment I hit any key or move my mouse over the browser it disconnects. You can see the log from guacd bellow (running at at a TRACE level). Comparing this to the same session with guacd built and running on ubuntu it seems that right after sending the first frame connection terminates for whatever reason. I'd be really grateful for any kind of pointers or suggestion on how to get to the bottom of this, since it seems that at least once guacd was working on Alpine 3.7: https://www.mail-archive.com/user@guacamole.apache.org/msg00218.html https://www.mail-archive.com/user@guacamole.apache.org/msg00219.html but that was Guacamole 0.9.3-incubating so perhaps something has changed. Finally, here's how I'm building it: https://github.com/rvs/zenbuild/blob/master/pkg/guacd/Dockerfile https://github.com/rvs/zenbuild/blob/master/pkg/guacd/Dockerfile.ubuntu And running by essentially following standard Guacamole tutorial, but replacing a pre-built container with: $ docker run --name some-guacd -p 4822:4822 guacd:apline Thanks, Roman. guacd[1]: INFO: Guacamole proxy daemon (guacd) version 0.9.14 started guacd[1]: DEBUG: Successfully bound socket to host 0.0.0.0, port 4822 guacd[1]: INFO: Listening on host 0.0.0.0, port 4822 guacd[1]: INFO: Creating new client for protocol "vnc" guacd[1]: INFO: Connection ID is "$b8a08e42-bb09-4d10-8631-9143ea018a5c" guacd[9]: DEBUG: Parameter "password" omitted. Using default value of "". guacd[9]: INFO: Cursor rendering: local guacd[9]: DEBUG: Parameter "swap-red-blue" omitted. Using default value of 0. guacd[9]: DEBUG: Parameter "read-only" omitted. Using default value of 0. guacd[9]: DEBUG: Parameter "dest-port" omitted. Using default value of 0. guacd[9]: DEBUG: Parameter "encodings" omitted. Using default value of "zrle ultra copyrect hextile zlib corre rre raw". guacd[9]: DEBUG: Parameter "autoretry" omitted. Using default value of 0. guacd[9]: DEBUG: Parameter "reverse-connect" omitted. Using default value of 0. guacd[9]: DEBUG: Parameter "listen-timeout" omitted. Using default value of 5000. guacd[9]: DEBUG: Parameter "recording-name" omitted. Using default value of "recording". guacd[9]: DEBUG: Parameter "create-recording-path" omitted. Using default value of 0. 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.