[go] : Do not panic in test/nilptr.go

Message ID CAFULd4akD1Ba4FJ2-Kvvdt4Rwwdmj-Kspge-tKvBWgHwSPWj6A@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak Feb. 1, 2012, 7:38 p.m.
On Tue, Jan 31, 2012 at 8:36 PM, Ian Lance Taylor <iant@google.com> wrote:

>> There is no need for a panic in test/nilptr.go if array doesn't get
>> allocated in first 256 meg of memory. The compiler has nothing to do
>> with this.
> This is true but this does not seem like the right patch.

> I think I would prefer to just change go-test.exp to mark this test as
> xfail on Alpha.  A patch to do that is preapproved.

Attached is the patch I have committed.

2012-02-01  Uros Bizjak  <ubizjak@gmail.com>

	* go.test/go-test.exp (go-gc-tests): xfail test/nilptr.go runtime
	test on alpha*-*-*.

Tested on alphaev68-pc-linux-gnu, committed to mainline SVN.

(BTW: Do you have any idea on what to do with excessive memory usage
in chan/select2.go? )



Ian Taylor Feb. 1, 2012, 9:27 p.m. | #1
Uros Bizjak <ubizjak@gmail.com> writes:

> Attached is the patch I have committed.

Thanks for taking care of that.

> (BTW: Do you have any idea on what to do with excessive memory usage
> in chan/select2.go? )

At this point I don't.  It's sort of peculiar.  Sending an int on a
channel should not use any memory.  The test is careful to only measure
the memory allocated for sending and receiving, and as far as I can see
nothing else should be allocated during the test.  You reported that the
test was allocating 2098576 bytes.  When I run it I see it allocating
1408 bytes on x86_64, 640 bytes on i386.  2098576 is much larger than
either number.  What is allocating that memory?

In other words, there appears to be a real bug here.  You can probably
track it down by setting a breakpoint on runtime_mallocgc after the line
	runtime.MemStats.Alloc = 0
What is calling runtime_mallocgc?



Index: go.test/go-test.exp
--- go.test/go-test.exp	(revision 183805)
+++ go.test/go-test.exp	(working copy)
@@ -305,6 +305,14 @@ 
+	# Handle certain tests in a target-dependant way.
+	if [istarget "alpha*-*-*"] {
+	    if { [string match "*go.test/test/nilptr.go" $test] } {
+		go-execute-xfail $test
+		continue
+	    }
+	}
 	if { [string match "*bug347*" $test] \
 		 || [string match "*bug348*" $test] } {
 	    # These bugs rely on runtime.Caller which currently fails.