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

leaking struct, slice, map #291

Open
rcoreilly opened this issue Jul 11, 2022 · 1 comment
Open

leaking struct, slice, map #291

rcoreilly opened this issue Jul 11, 2022 · 1 comment

Comments

@rcoreilly
Copy link
Member

I haven't really been paying close attention to this test -- assumed it was another string formatting one that was failing -- tried to go back in time to when this test was first committed but that is not possible on modern go version.. anyway, it probably was always like this but I'm not sure :)

oreilly@mshadow:~/go/src/github.com/go-python/gopy/ > go test -run TestCStrings
2022/07/11 12:11:27 checking testbackend: "py3"...
2022/07/11 12:11:27 enabling testbackend: "py3"
2022/07/11 12:11:27 checking testbackend: "py2"...
2022/07/11 12:11:27 disabling testbackend: "py2", error: 'exec: "python2": executable file not found in $PATH'
2022/07/11 12:11:27 The following test backends are not available: py2
looping over backends: py3 in [py3]
run cmd: [build -vm=python3 -output=/var/folders/x1/r8shprmj7j71zbw3qvgl9dqc0000gq/T/gopy-3088345620 -package-prefix  ./_examples/cstrings]
github.com/go-python/gopy/_examples/cstrings

--- Processing package: github.com/go-python/gopy/_examples/cstrings ---

--- building package ---
gopy.test -test.paniconexit0 -test.timeout=10m0s -test.run=TestCStrings
goimports -w cstrings.go
go build -mod=mod -buildmode=c-shared -o cstrings_go.so .
/usr/local/bin/python3 build.py
CGO_CFLAGS=-I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -fPIC -Ofast
CGO_LDFLAGS=-L/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib -lpython3.9 -ldl -framework CoreFoundation
go build -mod=mod -buildmode=c-shared -o _cstrings.cpython-39-darwin.so .
running python3 test.py
--- FAIL: TestCStrings (8.01s)
    --- FAIL: TestCStrings/py3 (8.01s)
        main_test.go:1048: [python3:_examples/cstrings]: error running python module:
            got:
            gofnString leaked:  False
            gofnStruct leaked:  True
            gofnNestedStruct leaked:  True
            gofnSlice leaked:  True
            gofnMap leaked:  True
            OK
            
            
            want:
            gofnString leaked:  False
            gofnStruct leaked:  False
            gofnNestedStruct leaked:  False
            gofnSlice leaked:  False
            gofnMap leaked:  False
            OK
            
            [python3:_examples/cstrings] diff:
            --- /var/folders/x1/r8shprmj7j71zbw3qvgl9dqc0000gq/T/gopy-3088345620/want.txt	2022-07-11 12:11:35.000000000 -0700
            +++ /var/folders/x1/r8shprmj7j71zbw3qvgl9dqc0000gq/T/gopy-3088345620/got.txt	2022-07-11 12:11:35.000000000 -0700
            @@ -1,6 +1,6 @@
             gofnString leaked:  False
            -gofnStruct leaked:  False
            -gofnNestedStruct leaked:  False
            -gofnSlice leaked:  False
            -gofnMap leaked:  False
            +gofnStruct leaked:  True
            +gofnNestedStruct leaked:  True
            +gofnSlice leaked:  True
            +gofnMap leaked:  True
             OK
            
FAIL
@rcoreilly
Copy link
Member Author

I was able to confirm that it wasn't introduced by the variadic function addition, by going back to fcad870

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

1 participant