Hi, The standard Go distribution doesn't support 32-bit PPC.
To compile Golang code to 32-bit PPC we first built a proof of concept based on docker-cli using the gccgo packages for Ubuntu. We got this working without too much effort. Afterwards we integrated this type of cross-compilation into Buildroot to compile the entire Docker tool suite for use on an embedded system. Most of Docker seems to be working fine on the embedded device, however local interactive terminal input / output with a running container is not working. What we observe is similar to what is described here: https://github.com/moby/moby/issues/39461 Investigation shows that two specific goroutines in Container daemon that are responsible for forwarding the input and output from the container to the user are not scheduled (they don't receive CPU cycles) until after Docker terminates. These two goroutines use the functions io.CopyBuffer() and ReadFrom() / WriteTo() to forward the traffic (the used method to forward traffic is demonstrated in recvtty.go at https://github.com/opencontainers/runc/blob/master/contrib/cmd/recvtty/recvtty.go ) When Docker terminates it sends signal 15 (TERM) to these processes. This somehow allows the two goroutines to be scheduled which flushes the output buffers to the terminal. This may be due to wrong system call bindings for 32-bit PPC in the unix package, however inspection of these bindings did not reveal any problem so far. We have been working on this for several weeks now, any help would be greatly appreciated. Thanks! Hugo On Fri, Jun 19, 2020 at 3:33 AM Ian Lance Taylor <i...@golang.org> wrote: > On Thu, Jun 18, 2020 at 1:17 PM Hugo Cornelis > <hugo.corne...@essensium.com> wrote: > > > > Does anyone have experience with porting go applications to the powerpc > 440fpu 32 bit. > > > > We have a team that is porting the Docker tool suite to a device that > uses this CPU, we generated the system call bindings and compiled the > Docker tool suite without much problems. > > > > Most of Docker seems to be working fine on the device, however > interactive terminal input/output is not working. > > > > Investigation shows that two specific goroutines that are responsible > for forwarding the I/O between two Docker related processes are not > scheduled (they don't receive CPU cycles) until after Docker terminates > these process with a signal 15 (TERM) and the two goroutines are suddenly > scheduled and all of the output buffers are suddenly flushed to the > terminal. > > > > We have looked at the terminal settings and flags applied to the file > descriptors and these seem all fine (although I must admit that the code > flows inside Docker and its tools are complicated). > > > > We suspect there may be a problem with one or more of the system call > bindings, for instance that there may be a system call declared with > //sysnb where it should be just //sys, if that makes sense. I would > actually not know how to distinguish between these two flags. > > > > We would now like to inspect the status of the two goroutines to > understand what they are waiting for, and why the scheduler does not > schedule them. > > > > Debugging with GODEBUG=schedtrace=1000;scheddetail=1, helps somewhat but > no idea how to relate the output of the scheduler state to the two > goroutines (if it would make sense at all). > > > > Does anyone have any experience debugging this type of problem? How > would we look at where exactly these processes are blocked without > developing core knowledge about the Docker tool suite? > > > > We have been working on this for several weeks now, any help would be > greatly appreciated. > > > The standard Go distribution doesn't support 32-bit PPC, so I feel > like there is some missing background information here. > > If the problem is with making system calls, then it often helps to > look at the "strace -f" output to see what is going on at the system > call level. > > Ian > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAARrXCQ43XxbS5kbMy_Rn66FG3ifW9%2B9%3D7y%3DB4UbmajEP0WcJw%40mail.gmail.com.