Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test failed if Golang over 1.4 #5

Closed
walf443 opened this issue Jan 9, 2015 · 5 comments
Closed

test failed if Golang over 1.4 #5

walf443 opened this issue Jan 9, 2015 · 5 comments

Comments

@walf443
Copy link
Contributor

walf443 commented Jan 9, 2015

SEE: https://travis-ci.org/walf443/pp/builds/46443280

@walf443
Copy link
Contributor Author

walf443 commented Jan 9, 2015

It seems to crash on printer_test.go line 82:

    checkCases = []interface{}{
        map[string]int{"hell": 23, "world": 34},
        map[string]map[string]string{"s1": map[string]string{"v1": "m1", "va1": "me1"}, "si2": map[string]string{"v2": "m2"}},
        Foo{Bar: 1, Hoge: "a", Hello: map[string]string{"hel": "world", "a": "b"}, HogeHoges: []HogeHoge{HogeHoge{Hell: "a", World: 1}, HogeHoge{Hell: "bbb", World: 100}}},
        arr,
        []string{"aaa", "bbb", "ccc"},
        make(chan bool, 10),
        unsafe.Pointer(uintptr(1)),
        func(a string, b float32) int { return 0 },
        &HogeHoge{},
        &Piyo{Field1: map[string]string{"a": "b", "cc": "dd"}, F2: &Foo{}, Fie3: 128},
        []interface{}{1, 3},
        interface{}(1),
        HogeHoge{A: "test"},
        FooPri{Public: "hello", private: "world"},
        new(regexp.Regexp), // THIS LINE
    }

@walf443
Copy link
Contributor Author

walf443 commented Jan 9, 2015

hmm. it seems to be Golang's bug. SEE golang/go#9384

@k0kubun
Copy link
Owner

k0kubun commented Jan 9, 2015

Thank you for your report!

hmm. it seems to be Golang's bug. SEE golang/go#9384

I see. I commited a workaround in cdb03a4. Now CI passes.

@k0kubun k0kubun closed this as completed Jan 9, 2015
@k0kubun
Copy link
Owner

k0kubun commented Jan 9, 2015

In my current understanding, uintptr(1) means a pointer whose address is 0x00000001.
Because it is an invalid address, conversion to unsafe.Pointer crashes.

So I changed to cast a pointer of a real struct to unsafe.Pointer. bbb232f

@walf443
Copy link
Contributor Author

walf443 commented Jan 9, 2015

I see. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants