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

Regression bug? Infinite recursion for embedded structs #263

Closed
carbocation opened this issue Nov 26, 2016 · 2 comments
Closed

Regression bug? Infinite recursion for embedded structs #263

carbocation opened this issue Nov 26, 2016 · 2 comments

Comments

@carbocation
Copy link
Contributor

carbocation commented Nov 26, 2016

I think that the changes for #157 introduced a regression to a bug that was fixed for #60 . I'm seeing memory exhaustion when a struct contains another struct that embeds that struct type, which is seemingly caused by reflect descending into structs indefinitely since cc395bc (making 344b1e9 the last good commit).

Example structures:

type Application struct {
    ID int64 `db:"id"`
    Entity *Entity `db:"entity_data"`
}

type Entity struct {
    Application

    Version string
}

Trying to structscan an Application no longer works after cc395bc .

I got here via bisecting:

git bisect start
# bad: [f71d5ee01769df469d115332106ef504ded071dc] Merge pull request #261 from gibson042/2016-11-placeholder-documentation
git bisect bad f71d5ee01769df469d115332106ef504ded071dc
# good: [debbfda33b4efc552406157658f49ab0c5ebeb31] Remove use of bytes.Count in sqlx.In
git bisect good debbfda33b4efc552406157658f49ab0c5ebeb31
# bad: [54aec3fd91a2b2129ffaca0d652b8a9223ee2d9e] Merge pull request #159 from cortex/master
git bisect bad 54aec3fd91a2b2129ffaca0d652b8a9223ee2d9e
# good: [cce5bd827a54704dd8da81bd16ddd20ce8316af4] add some documentation, simplify GetByPath a bit, add a comment about GetByTraversals implementation
git bisect good cce5bd827a54704dd8da81bd16ddd20ce8316af4
# bad: [3a92b1fd96032c4490fa618370fbf98ec69b680c] stop making a copy of the stmt for qstmt
git bisect bad 3a92b1fd96032c4490fa618370fbf98ec69b680c
# good: [344b1e96d6e410a093b7bce40287731a49e253f6] Merge pull request #140 from jmoiron/ptrs
git bisect good 344b1e96d6e410a093b7bce40287731a49e253f6
# bad: [ae682dc5c71d087ef97d506ec543320fdd7b0ff1] Merge pull request #157 from Pitmairen/master
git bisect bad ae682dc5c71d087ef97d506ec543320fdd7b0ff1
# bad: [cc395bccac9fc05114b41b677fe5e663d8c52f6b] Add support for named pointers to structs
git bisect bad cc395bccac9fc05114b41b677fe5e663d8c52f6b
# first bad commit: [cc395bccac9fc05114b41b677fe5e663d8c52f6b] Add support for named pointers to structs
@jmoiron
Copy link
Owner

jmoiron commented Dec 2, 2016

Does it fix after merging #264?

@carbocation
Copy link
Contributor Author

Yes, this is fixed by #264 , 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