public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Recent Go patch broke Alpha bootstrap
@ 2013-11-07 23:39 Uros Bizjak
  2013-11-08  2:17 ` Ian Lance Taylor
  0 siblings, 1 reply; 12+ messages in thread
From: Uros Bizjak @ 2013-11-07 23:39 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ian Lance Taylor

Hello!

Recent Go mega-patch broke Alpha bootstrap. Following fixlet is needed:

--cut here--
Index: runtime/proc.c
===================================================================
--- runtime/proc.c      (revision 204522)
+++ runtime/proc.c      (working copy)
@@ -2098,7 +2098,7 @@
                __splitstack_block_signals_context(&newg->stack_context[0],
                                                   &dont_block_signals, nil);
 #else
-               *ret_stack = runtime_mallocgc(stacksize,
FlagNoProfiling|FlagNoGC, 0, 0);
+               *ret_stack = runtime_mallocgc(stacksize, 0,
FlagNoProfiling|FlagNoGC);
                *ret_stacksize = stacksize;
                newg->gcinitial_sp = *ret_stack;
                newg->gcstack_size = stacksize;
--cut here--

However, all runtime tests panic with:

gmake[2]: *** [os/check] Error 1
runtime: address space conflict: map(0xc000001000) = 0xc000002000
fatal error: runtime: address space conflict

runtime stack:
runtime_dopanic
        ../../../gcc-svn/trunk/libgo/runtime/panic.c:81
runtime_throw
        ../../../gcc-svn/trunk/libgo/runtime/panic.c:115
runtime_SysMap
        ../../../gcc-svn/trunk/libgo/runtime/mem.c:185
runtime_MHeap_MapSpans
        ../../../gcc-svn/trunk/libgo/runtime/mheap.c:81
runtime_MHeap_SysAlloc
        ../../../gcc-svn/trunk/libgo/runtime/malloc.goc:524
MHeap_Grow
        ../../../gcc-svn/trunk/libgo/runtime/mheap.c:241
MHeap_AllocLocked
        ../../../gcc-svn/trunk/libgo/runtime/mheap.c:126
runtime_MHeap_Alloc
        ../../../gcc-svn/trunk/libgo/runtime/mheap.c:95
runtime_mallocgc
        ../../../gcc-svn/trunk/libgo/runtime/malloc.goc:124
runtime_malg
        ../../../gcc-svn/trunk/libgo/runtime/proc.c:2101
__go_go
        ../../../gcc-svn/trunk/libgo/runtime/proc.c:2164
main
        ../../../gcc-svn/trunk/libgo/runtime/go-main.c:42

        :0

        :0

        :0

The fixed place is mentioned in the trace, so I guess there is
additional issue to fix.

Uros.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Recent Go patch broke Alpha bootstrap
  2013-11-07 23:39 Recent Go patch broke Alpha bootstrap Uros Bizjak
@ 2013-11-08  2:17 ` Ian Lance Taylor
  2013-11-08  9:32   ` Uros Bizjak
  0 siblings, 1 reply; 12+ messages in thread
From: Ian Lance Taylor @ 2013-11-08  2:17 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1248 bytes --]

On Thu, Nov 7, 2013 at 2:25 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
>
> Recent Go mega-patch broke Alpha bootstrap. Following fixlet is needed:
>
> --cut here--
> Index: runtime/proc.c
> ===================================================================
> --- runtime/proc.c      (revision 204522)
> +++ runtime/proc.c      (working copy)
> @@ -2098,7 +2098,7 @@
>                 __splitstack_block_signals_context(&newg->stack_context[0],
>                                                    &dont_block_signals, nil);
>  #else
> -               *ret_stack = runtime_mallocgc(stacksize,
> FlagNoProfiling|FlagNoGC, 0, 0);
> +               *ret_stack = runtime_mallocgc(stacksize, 0,
> FlagNoProfiling|FlagNoGC);
>                 *ret_stacksize = stacksize;
>                 newg->gcinitial_sp = *ret_stack;
>                 newg->gcstack_size = stacksize;
> --cut here--
>
> However, all runtime tests panic with:
>
> gmake[2]: *** [os/check] Error 1
> runtime: address space conflict: map(0xc000001000) = 0xc000002000
> fatal error: runtime: address space conflict

Thanks for the patch and report.  This patch should fix them.
Bootstrapped and tested on x86_64-unknown-linux-gnu, not that that
proves much.  Committed to mainline.

Ian

[-- Attachment #2: foo.patch --]
[-- Type: text/x-patch, Size: 1143 bytes --]

diff -r 9f650ddab115 libgo/runtime/mheap.c
--- a/libgo/runtime/mheap.c	Wed Nov 06 11:23:33 2013 -0800
+++ b/libgo/runtime/mheap.c	Thu Nov 07 15:34:54 2013 -0800
@@ -68,6 +68,7 @@
 void
 runtime_MHeap_MapSpans(MHeap *h)
 {
+	uintptr pagesize;
 	uintptr n;
 
 	// Map spans array, PageSize at a time.
@@ -76,6 +77,8 @@
 		n -= (uintptr)h->arena_start;
 	n = n / PageSize * sizeof(h->spans[0]);
 	n = ROUND(n, PageSize);
+	pagesize = getpagesize();
+	n = ROUND(n, pagesize);
 	if(h->spans_mapped >= n)
 		return;
 	runtime_SysMap((byte*)h->spans + h->spans_mapped, n - h->spans_mapped, &mstats.other_sys);
diff -r 9f650ddab115 libgo/runtime/proc.c
--- a/libgo/runtime/proc.c	Wed Nov 06 11:23:33 2013 -0800
+++ b/libgo/runtime/proc.c	Thu Nov 07 15:34:54 2013 -0800
@@ -2098,7 +2098,7 @@
 		__splitstack_block_signals_context(&newg->stack_context[0],
 						   &dont_block_signals, nil);
 #else
-		*ret_stack = runtime_mallocgc(stacksize, FlagNoProfiling|FlagNoGC, 0, 0);
+		*ret_stack = runtime_mallocgc(stacksize, 0, FlagNoProfiling|FlagNoGC);
 		*ret_stacksize = stacksize;
 		newg->gcinitial_sp = *ret_stack;
 		newg->gcstack_size = stacksize;

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Recent Go patch broke Alpha bootstrap
  2013-11-08  2:17 ` Ian Lance Taylor
@ 2013-11-08  9:32   ` Uros Bizjak
  2013-11-11 21:25     ` Ian Lance Taylor
  2013-11-11 22:02     ` Ian Lance Taylor
  0 siblings, 2 replies; 12+ messages in thread
From: Uros Bizjak @ 2013-11-08  9:32 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches

On Fri, Nov 8, 2013 at 12:39 AM, Ian Lance Taylor <iant@google.com> wrote:

>> Recent Go mega-patch broke Alpha bootstrap. Following fixlet is needed:
>>
> Thanks for the patch and report.  This patch should fix them.
> Bootstrapped and tested on x86_64-unknown-linux-gnu, not that that
> proves much.  Committed to mainline.

With your patch, I was able to compile libgo and run libgo testsuite.
There are two new testsuite failures for newly introduced tests:

--- FAIL: TestKillStartProcess (0.00 seconds)
        os_test.go:1173: Failed to build exe
/tmp/go-build420056795/main.exe: exec: "go": executable file not found
in $PATH
--- FAIL: TestKillFindProcess (0.00 seconds)
        os_test.go:1173: Failed to build exe
/tmp/go-build353151102/main.exe: exec: "go": executable file not found
in $PATH
FAIL
FAIL: os
gmake[2]: *** [os/check] Error 1

This should be trivial, I have no go in $PATH (IIRC, we already have
fixed failure like this).

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x1c]

goroutine 5 [running]:
syscall.Exitsyscall
        ../../../gcc-svn/trunk/libgo/runtime/proc.c:1986
pprof.profileWriter
        /home/uros/gcc-build/alphaev68-unknown-linux-gnu/libgo/gotest29851/test/pprof.go:600
created by runtime_pprof.StartCPUProfile
        /home/uros/gcc-build/alphaev68-unknown-linux-gnu/libgo/gotest29851/test/pprof.go:594

goroutine 1 [chan receive]:
testing.RunTests
        ../../../gcc-svn/trunk/libgo/go/testing/testing.go:470
testing.Main
        ../../../gcc-svn/trunk/libgo/go/testing/testing.go:401
main.main
        /home/uros/gcc-build/alphaev68-unknown-linux-gnu/libgo/gotest29851/test/_testmain.go:34

goroutine 4 [chan receive]:
pprof_test.testCPUProfile
        /home/uros/gcc-build/alphaev68-unknown-linux-gnu/libgo/gotest29851/test/pprof_test.go:108
testing.tRunner
        ../../../gcc-svn/trunk/libgo/go/testing/testing.go:389
created by testing.RunTests
        ../../../gcc-svn/trunk/libgo/go/testing/testing.go:469
FAIL: runtime/pprof
gmake[2]: *** [runtime/pprof/check] Error 1

This one is new, I have to look into it a bit deeper.

All other libgo tests pass.

Uros.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Recent Go patch broke Alpha bootstrap
  2013-11-08  9:32   ` Uros Bizjak
@ 2013-11-11 21:25     ` Ian Lance Taylor
  2013-11-11 22:02     ` Ian Lance Taylor
  1 sibling, 0 replies; 12+ messages in thread
From: Ian Lance Taylor @ 2013-11-11 21:25 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]

On Fri, Nov 8, 2013 at 1:10 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Fri, Nov 8, 2013 at 12:39 AM, Ian Lance Taylor <iant@google.com> wrote:
>
>>> Recent Go mega-patch broke Alpha bootstrap. Following fixlet is needed:
>>>
>> Thanks for the patch and report.  This patch should fix them.
>> Bootstrapped and tested on x86_64-unknown-linux-gnu, not that that
>> proves much.  Committed to mainline.
>
> With your patch, I was able to compile libgo and run libgo testsuite.
> There are two new testsuite failures for newly introduced tests:
>
> --- FAIL: TestKillStartProcess (0.00 seconds)
>         os_test.go:1173: Failed to build exe
> /tmp/go-build420056795/main.exe: exec: "go": executable file not found
> in $PATH
> --- FAIL: TestKillFindProcess (0.00 seconds)
>         os_test.go:1173: Failed to build exe
> /tmp/go-build353151102/main.exe: exec: "go": executable file not found
> in $PATH
> FAIL
> FAIL: os
> gmake[2]: *** [os/check] Error 1
>
> This should be trivial, I have no go in $PATH (IIRC, we already have
> fixed failure like this).

Thanks for the bug report.  Fixed with the appended patch.  Committed
to mainline.

Ian

[-- Attachment #2: foo.patch --]
[-- Type: text/x-patch, Size: 425 bytes --]

diff -r 283d5ed3b086 libgo/go/os/os_test.go
--- a/libgo/go/os/os_test.go	Mon Nov 11 09:46:39 2013 -0800
+++ b/libgo/go/os/os_test.go	Mon Nov 11 11:39:53 2013 -0800
@@ -1142,6 +1142,7 @@
 }
 
 func testKillProcess(t *testing.T, processKiller func(p *Process)) {
+	t.Skip("gccgo does not have a go command")
 	dir, err := ioutil.TempDir("", "go-build")
 	if err != nil {
 		t.Fatalf("Failed to create temp directory: %v", err)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Recent Go patch broke Alpha bootstrap
  2013-11-08  9:32   ` Uros Bizjak
  2013-11-11 21:25     ` Ian Lance Taylor
@ 2013-11-11 22:02     ` Ian Lance Taylor
  2013-11-12 11:35       ` Uros Bizjak
  1 sibling, 1 reply; 12+ messages in thread
From: Ian Lance Taylor @ 2013-11-11 22:02 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

On Fri, Nov 8, 2013 at 1:10 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>
> panic: runtime error: invalid memory address or nil pointer dereference
> [signal 0xb code=0x1 addr=0x1c]
>
> goroutine 5 [running]:
> syscall.Exitsyscall
>         ../../../gcc-svn/trunk/libgo/runtime/proc.c:1986
> pprof.profileWriter
>         /home/uros/gcc-build/alphaev68-unknown-linux-gnu/libgo/gotest29851/test/pprof.go:600
> created by runtime_pprof.StartCPUProfile
>         /home/uros/gcc-build/alphaev68-unknown-linux-gnu/libgo/gotest29851/test/pprof.go:594
>
> goroutine 1 [chan receive]:
> testing.RunTests
>         ../../../gcc-svn/trunk/libgo/go/testing/testing.go:470
> testing.Main
>         ../../../gcc-svn/trunk/libgo/go/testing/testing.go:401
> main.main
>         /home/uros/gcc-build/alphaev68-unknown-linux-gnu/libgo/gotest29851/test/_testmain.go:34
>
> goroutine 4 [chan receive]:
> pprof_test.testCPUProfile
>         /home/uros/gcc-build/alphaev68-unknown-linux-gnu/libgo/gotest29851/test/pprof_test.go:108
> testing.tRunner
>         ../../../gcc-svn/trunk/libgo/go/testing/testing.go:389
> created by testing.RunTests
>         ../../../gcc-svn/trunk/libgo/go/testing/testing.go:469
> FAIL: runtime/pprof
> gmake[2]: *** [runtime/pprof/check] Error 1
>
> This one is new, I have to look into it a bit deeper.


I don't know what is happening here.  I can't recreate it.  There was
a different problem that could arise in runtime/pprof, that was fixed
by a patch I submitted on Saturday
(http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01016.html).  So it's
possible that this is fixed now.

If you are able to recreate it, try setting GOTRACEBACK=2 in the
environment.  That will provide more information in the backtrace.

Ian

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Recent Go patch broke Alpha bootstrap
  2013-11-11 22:02     ` Ian Lance Taylor
@ 2013-11-12 11:35       ` Uros Bizjak
  2013-11-12 14:31         ` Uros Bizjak
  2013-11-13 15:48         ` Uros Bizjak
  0 siblings, 2 replies; 12+ messages in thread
From: Uros Bizjak @ 2013-11-12 11:35 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches

On Mon, Nov 11, 2013 at 8:52 PM, Ian Lance Taylor <iant@google.com> wrote:
> On Fri, Nov 8, 2013 at 1:10 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>>
>> panic: runtime error: invalid memory address or nil pointer dereference
>> [signal 0xb code=0x1 addr=0x1c]

>> FAIL: runtime/pprof
>> gmake[2]: *** [runtime/pprof/check] Error 1
>>
>> This one is new, I have to look into it a bit deeper.
>
>
> I don't know what is happening here.  I can't recreate it.  There was
> a different problem that could arise in runtime/pprof, that was fixed
> by a patch I submitted on Saturday
> (http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01016.html).  So it's
> possible that this is fixed now.

The failure is specific to !USING_SPLIT_STACK targets:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x200009e9280 (LWP 21478)]
0x000000012001e854 in syscall.Exitsyscall () at
../../../gcc-svn/trunk/libgo/runtime/proc.c:1986
1986            m->p->syscalltick++;
(gdb) list
1981    #ifdef USING_SPLIT_STACK
1982            gp->gcstack = nil;
1983    #endif
1984            gp->gcnext_sp = nil;
1985            runtime_memclr(&gp->gcregs, sizeof gp->gcregs);
1986            m->p->syscalltick++;
1987    }
1988
1989    static bool
1990    exitsyscallfast(void)
(gdb) p m
$2 = <optimized out>

The crash is at line 1986, but it is unclear if m or p are null.

> If you are able to recreate it, try setting GOTRACEBACK=2 in the
> environment.  That will provide more information in the backtrace.

Following is full traceback:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x1c]

goroutine 10 [running]:
runtime_dopanic
        ../../../gcc-svn/trunk/libgo/runtime/panic.c:77
__go_panic
        ../../../gcc-svn/trunk/libgo/runtime/go-panic.c:113
runtime_panicstring
        ../../../gcc-svn/trunk/libgo/runtime/panic.c:134
sig_panic_info_handler
        ../../../gcc-svn/trunk/libgo/runtime/go-signal.c:291

        :0
syscall.Exitsyscall
        ../../../gcc-svn/trunk/libgo/runtime/proc.c:1986
runtime_notetsleepg
        ../../../gcc-svn/trunk/libgo/runtime/lock_futex.c:190
getprofile
        ../../../gcc-svn/trunk/libgo/runtime/cpuprof.c:370
runtime.CPUProfile
        ../../../gcc-svn/trunk/libgo/runtime/cpuprof.c:446
pprof.profileWriter
        /home/uros/gcc-build/alphaev68-unknown-linux-gnu/libgo/gotest21332/test/pprof.go:600
kickoff
        ../../../gcc-svn/trunk/libgo/runtime/proc.c:229

        :0

        :0
created by runtime_pprof.StartCPUProfile
        /home/uros/gcc-build/alphaev68-unknown-linux-gnu/libgo/gotest21332/test/pprof.go:594

goroutine 1 [chan receive]:
runtime_mcall
        ../../../gcc-svn/trunk/libgo/runtime/proc.c:292
runtime_chanrecv
        ../../../gcc-svn/trunk/libgo/runtime/chan.c:378
testing.RunTests
        ../../../gcc-svn/trunk/libgo/go/testing/testing.go:470
testing.Main
        ../../../gcc-svn/trunk/libgo/go/testing/testing.go:401
main.main
        /home/uros/gcc-build/alphaev68-unknown-linux-gnu/libgo/gotest21332/test/_testmain.go:34
runtime_main
        ../../../gcc-svn/trunk/libgo/runtime/proc.c:560
kickoff
        ../../../gcc-svn/trunk/libgo/runtime/proc.c:229

        :0

        :0

goroutine 2 [syscall]:
        goroutine in C code; stack unavailable
created by runtime_main
        ../../../gcc-svn/trunk/libgo/runtime/proc.c:547

goroutine 8 [chan receive]:
runtime_mcall
        ../../../gcc-svn/trunk/libgo/runtime/proc.c:292
runtime_chanrecv
        ../../../gcc-svn/trunk/libgo/runtime/chan.c:378
__go_receive_small
        ../../../gcc-svn/trunk/libgo/runtime/chan.c:503
runtime_pprof.StopCPUProfile
        /home/uros/gcc-build/alphaev68-unknown-linux-gnu/libgo/gotest21332/test/pprof.go:621
__go_undefer
        ../../../gcc-svn/trunk/libgo/runtime/go-defer.c:52
runtime_pprof_test.TestCPUProfileWithFork
        /home/uros/gcc-build/alphaev68-unknown-linux-gnu/libgo/gotest21332/test/pprof_test.go:181
testing.tRunner
        ../../../gcc-svn/trunk/libgo/go/testing/testing.go:389
kickoff
        ../../../gcc-svn/trunk/libgo/runtime/proc.c:229

        :0

        :0
created by testing.RunTests
        ../../../gcc-svn/trunk/libgo/go/testing/testing.go:469

Uros.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Recent Go patch broke Alpha bootstrap
  2013-11-12 11:35       ` Uros Bizjak
@ 2013-11-12 14:31         ` Uros Bizjak
  2013-11-13 15:48         ` Uros Bizjak
  1 sibling, 0 replies; 12+ messages in thread
From: Uros Bizjak @ 2013-11-12 14:31 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches

On Tue, Nov 12, 2013 at 8:52 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Mon, Nov 11, 2013 at 8:52 PM, Ian Lance Taylor <iant@google.com> wrote:
>> On Fri, Nov 8, 2013 at 1:10 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>>>
>>> panic: runtime error: invalid memory address or nil pointer dereference
>>> [signal 0xb code=0x1 addr=0x1c]
>
>>> FAIL: runtime/pprof
>>> gmake[2]: *** [runtime/pprof/check] Error 1
>>>
>>> This one is new, I have to look into it a bit deeper.
>>
>>
>> I don't know what is happening here.  I can't recreate it.  There was
>> a different problem that could arise in runtime/pprof, that was fixed
>> by a patch I submitted on Saturday
>> (http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01016.html).  So it's
>> possible that this is fixed now.
>
> The failure is specific to !USING_SPLIT_STACK targets:
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0x200009e9280 (LWP 21478)]
> 0x000000012001e854 in syscall.Exitsyscall () at
> ../../../gcc-svn/trunk/libgo/runtime/proc.c:1986
> 1986            m->p->syscalltick++;
> (gdb) list
> 1981    #ifdef USING_SPLIT_STACK
> 1982            gp->gcstack = nil;
> 1983    #endif
> 1984            gp->gcnext_sp = nil;
> 1985            runtime_memclr(&gp->gcregs, sizeof gp->gcregs);
> 1986            m->p->syscalltick++;
> 1987    }
> 1988
> 1989    static bool
> 1990    exitsyscallfast(void)
> (gdb) p m
> $2 = <optimized out>
>
> The crash is at line 1986, but it is unclear if m or p are null.

It is p that is null.

Trying to add debug printf fixes the failure. Adding:

Index: proc.c
===================================================================
--- proc.c      (revision 204684)
+++ proc.c      (working copy)
@@ -1969,6 +1969,7 @@ runtime_exitsyscall(void)

        m->locks--;

+       printf ("Testx %p\n", m->p);
        // Call the scheduler.
        runtime_mcall(exitsyscall0);

makes test to pass.

However, moving pritf after runtime_mcall shows that m->p can be null
after the call:

$ ./a.out
Testy 0xc21000f000
Testy (nil)
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x1c]

goroutine 10 [running]:
syscall.Exitsyscall
        ../../../gcc-svn/trunk/libgo/runtime/proc.c:1987
pprof.profileWriter
        /home/uros/gcc-build/alphaev68-unknown-linux-gnu/libgo/gotest5746/test/pprof.go:600
created by runtime_pprof.StartCPUProfile
        /home/uros/gcc-build/alphaev68-unknown-linux-gnu/libgo/gotest5746/test/pprof.go:594

goroutine 1 [chan receive]:
testing.RunTests
        ../../../gcc-svn/trunk/libgo/go/testing/testing.go:470
testing.Main
        ../../../gcc-svn/trunk/libgo/go/testing/testing.go:401
main.main
        /home/uros/gcc-build/alphaev68-unknown-linux-gnu/libgo/gotest5746/test/_testmain.go:34

goroutine 8 [chan receive]:
testing.tRunner
        ../../../gcc-svn/trunk/libgo/go/testing/testing.go:389
created by testing.RunTests
        ../../../gcc-svn/trunk/libgo/go/testing/testing.go:469

Trivial fix would be adding if (m->p) in front of the dereference, but
I don't know if exitsyscall0 is allowed to return nill in m->p.

Uros.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Recent Go patch broke Alpha bootstrap
  2013-11-12 11:35       ` Uros Bizjak
  2013-11-12 14:31         ` Uros Bizjak
@ 2013-11-13 15:48         ` Uros Bizjak
  2013-11-15  9:28           ` Ian Lance Taylor
  1 sibling, 1 reply; 12+ messages in thread
From: Uros Bizjak @ 2013-11-13 15:48 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches

On Tue, Nov 12, 2013 at 8:52 AM, Uros Bizjak <ubizjak@gmail.com> wrote:

>>> panic: runtime error: invalid memory address or nil pointer dereference
>>> [signal 0xb code=0x1 addr=0x1c]
>
>>> FAIL: runtime/pprof
>>> gmake[2]: *** [runtime/pprof/check] Error 1
>>>
>>> This one is new, I have to look into it a bit deeper.
>>
>>
>> I don't know what is happening here.  I can't recreate it.  There was
>> a different problem that could arise in runtime/pprof, that was fixed
>> by a patch I submitted on Saturday
>> (http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01016.html).  So it's
>> possible that this is fixed now.
>
> The failure is specific to !USING_SPLIT_STACK targets:

The same error triggered on CentOS 5.10 x86_64 (another
!USING_SPLIT_STACK target) for 32bit lib (net, runtime). The panic:
string is the same, only addr=0x9f. There are also a couple of
segfaults (database/sql, net/http) and abort in sync/atomic.

Uros.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Recent Go patch broke Alpha bootstrap
  2013-11-13 15:48         ` Uros Bizjak
@ 2013-11-15  9:28           ` Ian Lance Taylor
  2013-11-15 12:35             ` Uros Bizjak
  0 siblings, 1 reply; 12+ messages in thread
From: Ian Lance Taylor @ 2013-11-15  9:28 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1097 bytes --]

On Wed, Nov 13, 2013 at 7:25 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Tue, Nov 12, 2013 at 8:52 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>
>>>> panic: runtime error: invalid memory address or nil pointer dereference
>>>> [signal 0xb code=0x1 addr=0x1c]
>>
>>>> FAIL: runtime/pprof
>>>> gmake[2]: *** [runtime/pprof/check] Error 1
>>>>
>>>> This one is new, I have to look into it a bit deeper.
>>>
>>>
>>> I don't know what is happening here.  I can't recreate it.  There was
>>> a different problem that could arise in runtime/pprof, that was fixed
>>> by a patch I submitted on Saturday
>>> (http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01016.html).  So it's
>>> possible that this is fixed now.
>>
>> The failure is specific to !USING_SPLIT_STACK targets:
>
> The same error triggered on CentOS 5.10 x86_64 (another
> !USING_SPLIT_STACK target) for 32bit lib (net, runtime). The panic:
> string is the same, only addr=0x9f. There are also a couple of
> segfaults (database/sql, net/http) and abort in sync/atomic.

Could you check to see if this patch fixes the problem?  Thanks.

Ian

[-- Attachment #2: foo.patch --]
[-- Type: text/x-patch, Size: 450 bytes --]

diff -r 9b2a1ae08a21 libgo/runtime/proc.c
--- a/libgo/runtime/proc.c	Thu Nov 14 14:29:49 2013 -0800
+++ b/libgo/runtime/proc.c	Thu Nov 14 18:42:54 2013 -0800
@@ -1983,7 +1983,10 @@
 #endif
 	gp->gcnext_sp = nil;
 	runtime_memclr(&gp->gcregs, sizeof gp->gcregs);
-	m->p->syscalltick++;
+
+	// Don't refer to m again, we might be running on a different
+	// thread after returning from runtime_mcall.
+	runtime_m()->p->syscalltick++;
 }
 
 static bool

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Recent Go patch broke Alpha bootstrap
  2013-11-15  9:28           ` Ian Lance Taylor
@ 2013-11-15 12:35             ` Uros Bizjak
  2013-11-15 13:47               ` Uros Bizjak
  0 siblings, 1 reply; 12+ messages in thread
From: Uros Bizjak @ 2013-11-15 12:35 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches

On Fri, Nov 15, 2013 at 3:52 AM, Ian Lance Taylor <iant@google.com> wrote:

>>>>> panic: runtime error: invalid memory address or nil pointer dereference
>>>>> [signal 0xb code=0x1 addr=0x1c]
>>>
>>>>> FAIL: runtime/pprof
>>>>> gmake[2]: *** [runtime/pprof/check] Error 1
>>>>>
>>>>> This one is new, I have to look into it a bit deeper.
>>>>
>>>>
>>>> I don't know what is happening here.  I can't recreate it.  There was
>>>> a different problem that could arise in runtime/pprof, that was fixed
>>>> by a patch I submitted on Saturday
>>>> (http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01016.html).  So it's
>>>> possible that this is fixed now.
>>>
>>> The failure is specific to !USING_SPLIT_STACK targets:
>>
>> The same error triggered on CentOS 5.10 x86_64 (another
>> !USING_SPLIT_STACK target) for 32bit lib (net, runtime). The panic:
>> string is the same, only addr=0x9f. There are also a couple of
>> segfaults (database/sql, net/http) and abort in sync/atomic.
>
> Could you check to see if this patch fixes the problem?  Thanks.

Unfortunately, it doesn't.

I still see panic in runtime (trace below), segfault in sync,
database/sql, net/http and abort in sync/atomic on 32bit CentOS 5.10
library.

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x9f]

goroutine 1 [chan receive]:
testing.RunTests
        ../../../../gcc-svn/trunk/libgo/go/testing/testing.go:470
testing.Main
        ../../../../gcc-svn/trunk/libgo/go/testing/testing.go:401
main.main
        /home/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest28068/test/_testmain.go:256

goroutine 64 [running]:
        goroutine running on other thread; stack unavailable
created by testing.RunTests
        ../../../../gcc-svn/trunk/libgo/go/testing/testing.go:469

goroutine 75 [runnable]:
created by runtime_test.testConcurrentReadsAfterGrowth
        /home/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest28068/test/map_test.go:261

goroutine 84 [runnable]:
created by runtime_test.testConcurrentReadsAfterGrowth
        /home/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest28068/test/map_test.go:266

goroutine 82 [runnable]:
created by runtime_test.testConcurrentReadsAfterGrowth
        /home/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest28068/test/map_test.go:266

goroutine 73 [runnable]:
created by runtime_test.testConcurrentReadsAfterGrowth
        /home/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest28068/test/map_test.go:261

goroutine 77 [runnable]:
created by runtime_test.testConcurrentReadsAfterGrowth
        /home/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest28068/test/map_test.go:261

goroutine 80 [runnable]:
created by runtime_test.testConcurrentReadsAfterGrowth
        /home/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest28068/test/map_test.go:266

goroutine 69 [runnable]:
created by runtime_test.testConcurrentReadsAfterGrowth
        /home/uros/gcc-build/x86_64-unknown-linux-gnu/32/libgo/gotest28068/test/map_test.go:261

goroutine 78 [runnable]:
created by runtime_test.testConcurrentReadsAfterGrowth

[... Many more same goroutine logs...]

Uros.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Recent Go patch broke Alpha bootstrap
  2013-11-15 12:35             ` Uros Bizjak
@ 2013-11-15 13:47               ` Uros Bizjak
  2013-11-15 18:27                 ` Ian Lance Taylor
  0 siblings, 1 reply; 12+ messages in thread
From: Uros Bizjak @ 2013-11-15 13:47 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches

On Fri, Nov 15, 2013 at 12:35 PM, Uros Bizjak <ubizjak@gmail.com> wrote:

>>>>>> panic: runtime error: invalid memory address or nil pointer dereference
>>>>>> [signal 0xb code=0x1 addr=0x1c]
>>>>
>>>>>> FAIL: runtime/pprof
>>>>>> gmake[2]: *** [runtime/pprof/check] Error 1
>>>>>>
>>>>>> This one is new, I have to look into it a bit deeper.
>>>>>
>>>>>
>>>>> I don't know what is happening here.  I can't recreate it.  There was
>>>>> a different problem that could arise in runtime/pprof, that was fixed
>>>>> by a patch I submitted on Saturday
>>>>> (http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01016.html).  So it's
>>>>> possible that this is fixed now.
>>>>
>>>> The failure is specific to !USING_SPLIT_STACK targets:
>>>
>>> The same error triggered on CentOS 5.10 x86_64 (another
>>> !USING_SPLIT_STACK target) for 32bit lib (net, runtime). The panic:
>>> string is the same, only addr=0x9f. There are also a couple of
>>> segfaults (database/sql, net/http) and abort in sync/atomic.
>>
>> Could you check to see if this patch fixes the problem?  Thanks.

Oh, I was not clear.

The patch fixes the net failure on Alpha and Centos 5.10, but other
failures on 32bit Centos 5.10 remain.

Thanks,
Uros.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Recent Go patch broke Alpha bootstrap
  2013-11-15 13:47               ` Uros Bizjak
@ 2013-11-15 18:27                 ` Ian Lance Taylor
  0 siblings, 0 replies; 12+ messages in thread
From: Ian Lance Taylor @ 2013-11-15 18:27 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 1634 bytes --]

On Fri, Nov 15, 2013 at 4:34 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Fri, Nov 15, 2013 at 12:35 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
>
>>>>>>> panic: runtime error: invalid memory address or nil pointer dereference
>>>>>>> [signal 0xb code=0x1 addr=0x1c]
>>>>>
>>>>>>> FAIL: runtime/pprof
>>>>>>> gmake[2]: *** [runtime/pprof/check] Error 1
>>>>>>>
>>>>>>> This one is new, I have to look into it a bit deeper.
>>>>>>
>>>>>>
>>>>>> I don't know what is happening here.  I can't recreate it.  There was
>>>>>> a different problem that could arise in runtime/pprof, that was fixed
>>>>>> by a patch I submitted on Saturday
>>>>>> (http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01016.html).  So it's
>>>>>> possible that this is fixed now.
>>>>>
>>>>> The failure is specific to !USING_SPLIT_STACK targets:
>>>>
>>>> The same error triggered on CentOS 5.10 x86_64 (another
>>>> !USING_SPLIT_STACK target) for 32bit lib (net, runtime). The panic:
>>>> string is the same, only addr=0x9f. There are also a couple of
>>>> segfaults (database/sql, net/http) and abort in sync/atomic.
>>>
>>> Could you check to see if this patch fixes the problem?  Thanks.
>
> Oh, I was not clear.
>
> The patch fixes the net failure on Alpha and Centos 5.10, but other
> failures on 32bit Centos 5.10 remain.

Thanks for testing it.  I've committed the patch to mainline.

As I noted in an earlier e-mail, the 32-bit failures are due to a
general bug in the middle-end, http://gcc.gnu.org/PR59099 .  That bug
is causing a miscompilation of the libgo runtime code, code that is
written in C.  The miscompilation shows up as test failures.

Ian

[-- Attachment #2: foo.patch --]
[-- Type: text/x-patch, Size: 450 bytes --]

diff -r 9b2a1ae08a21 libgo/runtime/proc.c
--- a/libgo/runtime/proc.c	Thu Nov 14 14:29:49 2013 -0800
+++ b/libgo/runtime/proc.c	Thu Nov 14 18:42:54 2013 -0800
@@ -1983,7 +1983,10 @@
 #endif
 	gp->gcnext_sp = nil;
 	runtime_memclr(&gp->gcregs, sizeof gp->gcregs);
-	m->p->syscalltick++;
+
+	// Don't refer to m again, we might be running on a different
+	// thread after returning from runtime_mcall.
+	runtime_m()->p->syscalltick++;
 }
 
 static bool

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-11-15 17:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-07 23:39 Recent Go patch broke Alpha bootstrap Uros Bizjak
2013-11-08  2:17 ` Ian Lance Taylor
2013-11-08  9:32   ` Uros Bizjak
2013-11-11 21:25     ` Ian Lance Taylor
2013-11-11 22:02     ` Ian Lance Taylor
2013-11-12 11:35       ` Uros Bizjak
2013-11-12 14:31         ` Uros Bizjak
2013-11-13 15:48         ` Uros Bizjak
2013-11-15  9:28           ` Ian Lance Taylor
2013-11-15 12:35             ` Uros Bizjak
2013-11-15 13:47               ` Uros Bizjak
2013-11-15 18:27                 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).