Thanks for the information, next question is what it the host machine?

As your currently unable to build go we may have to get a binary dist on the machine to start debugging, I can provide that if needed.

Once you have a working go installs you can try building and running the following:

The attached golang patch can be used to add new debug syscall, if you can build go from ports (try outside of poudriere).

Then you can compile main.go from a directory named test using "go build" and then from the same directory run the test.sh and lets see what you get?

    Regards
    Steve


On 26/04/2018 19:23, Bjarne wrote:
Hi Steven

Thanks for getting back on this.

The os is 11.1-RELEASE-p9  and the ports tree is HEAD.
The build machine is a virtual server ,
5120 M RAM
4 cpu
on top of  xen :
release                : 4.4.104-39-default
version                : #1 SMP Thu Jan 4 08:11:03 UTC 2018 (7db1912)


It seems I have a reliable test environment. I have just reconfigured to 4 cpus and tested a rebuild and got same error as before.
Anything i can do to assist in debugging?

Bear in mind I dont know anything of lang/go and am still a beginner regading poudriere. I have frozen the build machine so it wont download new versions of anything.



On 26-04-2018 01:31, Steven Hartland wrote:
That happens very rarely, so rarely its been really hard to make any progress debugging it.

If you believe you have reliable reproduction case I'd be very interested in it.

One thing I noticed when re-reading your original post is that you say you tested on 11.1 but then your output mentions HEAD, are you running 11.1-RELEASE or 11-STABLE, if so what revision?

Also of interest is the hardware and related configuration?

    Regards
    Steve

On 25/04/2018 22:09, Derek (freebsd lists) wrote:
Ah, you'll note: fork/exec implicated here.

Looks like this guy strikes again:
https://github.com/golang/go/issues/15658

It pains me to say but Go on FreeBSD is (and has always been) broken.  Should be fine if you don't exec.  Something that might help, is setting GOMAXPROCS=1.

Derek

On 18-04-25 07:45 AM, Steven Hartland wrote:
Builds fine on 11.1-RELEASE-p6 here:

[00:04:02] Committing packages to repository
[00:04:02] Removing old packages
[00:04:02] Built ports: lang/go
[ports11-1-multiplay] [2018-04-25_11h37m16s] [committing:] Queued: 1 Built: 1  Failed: 0  Skipped: 0  Ignored: 0 Tobuild: 0   Time: 00:04:01 [00:04:02] Logs: /usr/local/poudriere/data/logs/bulk/ports11-1-multiplay/2018-04-25_11h37m16s
[00:04:02] Cleaning up

svn info
Path: .
Working Copy Root Path: /usr/local/poudriere/ports/multiplay
URL: https://svn.freebsd.org/ports/head
Relative URL: ^/head
Repository Root: https://svn.freebsd.org/ports
Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5
Revision: 468275
Node Kind: directory
Schedule: normal
Last Changed Author: tobik
Last Changed Rev: 468275
Last Changed Date: 2018-04-25 11:08:41 +0000 (Wed, 25 Apr 2018)


     Regards
     Steve

On 25/04/2018 12:07, Bjarne wrote:
I got a job to rebuild all packages every night, but since 2018-04-05 building /usr/ports/lang/go is failing.

Apparently 2018-04-05  some major changed was introduced, since 331 pakackes was rebuilt. Not sure what it was, I saw nothing in UPATING.

Top of logfile:

Building lang/go
:snip




_______________________________________________
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"




--
mvh,
Bjarne

--- /dev/null   2017-03-24 16:44:00.000000000 +0000
+++ src/syscall/exec_bsd_debug.go       2017-03-15 16:28:55.000000000 +0000
@@ -0,0 +1,41 @@
+// +build darwin dragonfly freebsd netbsd openbsd
+
+package syscall
+
+func ForkOnlyBSDTest() (err error) {
+       var r1 uintptr
+       var pid int
+       var err1 Errno
+       var wstatus WaitStatus
+
+       ForkLock.Lock()
+       runtime_BeforeFork()
+
+       r1, _, err1 = RawSyscall(SYS_FORK, 0, 0, 0)
+       if err1 != 0 {
+               runtime_AfterFork()
+               ForkLock.Unlock()
+               return err1
+       }
+
+       if r1 == 0 {
+               // in child, die die die my darling
+               for {
+                       RawSyscall(SYS_EXIT, 253, 0, 0)
+               }
+       }
+
+       runtime_AfterFork()
+       ForkLock.Unlock()
+
+       pid = int(r1)
+
+       // Prime directive, exterminate
+       // Whatever stands left
+       _, err = Wait4(pid, &wstatus, 0, nil)
+       for err == EINTR {
+               _, err = Wait4(pid, &wstatus, 0, nil)
+       }
+
+       return
+}
#!/bin/sh

rm -f test.log
while true; do 
        echo "==== NEW RUN $(date) ===="
        echo
        #time sh -c 'export GOGC=5; export GODEBUG=gctrace=2,schedtrace=100; 
./test'
        #time sh -c 'export GOGC=5; ./test'
        #time sh -c 'export GOGC=5; export GODEBUG=gcstackbarrierall=1; ./test'
        #time sh -c 'export GOGC=off; export GOTRACEBACK=crash; ./test'
        #time sh -c 'export GOGC=off; export GOTRACEBACK=crash; export 
GOMAXPROCS=24; ktrace -i -f ktrace-test.out ./test '
        #time sh -c 'export GOGC=off; export GODEBUG=efence=1; export 
GOTRACEBACK=crash; export GOMAXPROCS=24; ktrace -i -f ktrace-test.out ./test '
        #time sh -c 'export GOGC=off; export GOTRACEBACK=crash; cpuset -c -l 0 
./test'
        time sh -c 'export GOGC=2; export GOTRACEBACK=crash; ./test'
        exit=$?
        dt=`date +'%s'`
        echo "dt: $dt"
        err=0
        if [ -f test.core ]; then
                mv test.core results/test.core.$dt
                err=1
        fi
        if [ -f ktrace-test.out ]; then
                mv ktrace-test.out results/ktrace-test.out.$dt
                err=1
        fi

        if [ $exit -ne 0 ]; then
                break
        elif [ $err = 1 ]; then
                break
        fi
        echo
        echo
done >> test.log 2>> test.log

mv test.log results/test.log.$dt
ln -s results/test.log.$dt test.log
cnt=`grep -c starting results/test.log.$dt`
echo "Failure after $cnt attempts log: results/test.log.$dt"
exit 1
package main

import (
        "log"
        "runtime"
        "syscall"
)

var (
        forkRoutines = 24
)

func run() {
        for {
                if err := syscall.ForkOnlyBSDTest(); err != nil {
                        log.Fatal(err)
                }
        }
}

func main() {
        log.Printf("Starting %v forking goroutines...\n", forkRoutines)
        log.Println("GOMAXPROCS:", runtime.GOMAXPROCS(0))

        for i := 0; i < forkRoutines; i++ {
                go run()
        }

        // Block forever
        <-make(chan struct{})
}
_______________________________________________
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"

Reply via email to