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

Fix slice bounds out of range #11

Merged
merged 1 commit into from
May 11, 2022
Merged

Fix slice bounds out of range #11

merged 1 commit into from
May 11, 2022

Conversation

fridim
Copy link
Contributor

@fridim fridim commented May 11, 2022

see GPTEINFRA-3300

This change fixes the following error that occurs when there are
multiple slice reductions to execute:

panic: runtime error: slice bounds out of range [8:7]

goroutine 1 [running]:
main.strategicCleanupSlice({0xc000448800, 0xd, 0x1?})
        /home/fridim/sync/dev/agnosticv-public/cli/strategic_merge.go:33 +0x67d
main.strategicCleanupMap(0x7287c0?)
        /home/fridim/sync/dev/agnosticv-public/cli/strategic_merge.go:62 +0x194
main.strategicMerge(0xc000386ea0, 0x7a05c4?)
        /home/fridim/sync/dev/agnosticv-public/cli/strategic_merge.go:86 +0xca
main.customStrategyMerge(0xc0003d2180?, 0xc00043b6f8?, {{0xc0002ec9b0?, 0x7?}, {0xc0002ec9a0?, 0x0?}})
        /home/fridim/sync/dev/agnosticv-public/cli/merge.go:214 +0xd85
main.mergeVars({0xc0003c4210, 0x24}, {0xc00038b180, 0x3, 0x519daa?})
        /home/fridim/sync/dev/agnosticv-public/cli/merge.go:284 +0x7ad
main.findCatalogItems.func1({0xc0003c4210, 0x24}, {0x82fa48?, 0xc00033c820?}, {0x0?, 0x0?})
        /home/fridim/sync/dev/agnosticv-public/cli/agnosticv.go:243 +0x32f
path/filepath.walk({0xc0003c4210, 0x24}, {0x82fa48, 0xc00033c820}, 0xc00043be10)
        /usr/lib/go/src/path/filepath/path.go:418 +0x123
path/filepath.walk({0xc0004c4180, 0x1b}, {0x82fa48, 0xc00033c0d0}, 0xc00043be10)
        /usr/lib/go/src/path/filepath/path.go:442 +0x285
path/filepath.walk({0xc0003f61e8, 0x4}, {0x82fa48, 0xc000313ee0}, 0xc00043be10)
        /usr/lib/go/src/path/filepath/path.go:442 +0x285
path/filepath.walk({0x7995f8, 0x1}, {0x82fa48, 0xc0004c69c0}, 0xc00043be10)
        /usr/lib/go/src/path/filepath/path.go:442 +0x285
path/filepath.Walk({0x7995f8, 0x1}, 0xc000175e10)
        /usr/lib/go/src/path/filepath/path.go:505 +0x6c
main.findCatalogItems({0xc00001c094, 0x1f}, {0xc000099960, 0x1, 0x1}, {0x0, 0x0, 0x0}, {0x0, 0x0, ...})
        /home/fridim/sync/dev/agnosticv-public/cli/agnosticv.go:219 +0x272
main.main()
        /home/fridim/sync/dev/agnosticv-public/cli/agnosticv.go:491 +0x15c

see GPTEINFRA-3300

This change fixes the following error that occurs when there are
multiple slice reductions to execute:

```
panic: runtime error: slice bounds out of range [8:7]

goroutine 1 [running]:
main.strategicCleanupSlice({0xc000448800, 0xd, 0x1?})
        /home/fridim/sync/dev/agnosticv-public/cli/strategic_merge.go:33 +0x67d
main.strategicCleanupMap(0x7287c0?)
        /home/fridim/sync/dev/agnosticv-public/cli/strategic_merge.go:62 +0x194
main.strategicMerge(0xc000386ea0, 0x7a05c4?)
        /home/fridim/sync/dev/agnosticv-public/cli/strategic_merge.go:86 +0xca
main.customStrategyMerge(0xc0003d2180?, 0xc00043b6f8?, {{0xc0002ec9b0?, 0x7?}, {0xc0002ec9a0?, 0x0?}})
        /home/fridim/sync/dev/agnosticv-public/cli/merge.go:214 +0xd85
main.mergeVars({0xc0003c4210, 0x24}, {0xc00038b180, 0x3, 0x519daa?})
        /home/fridim/sync/dev/agnosticv-public/cli/merge.go:284 +0x7ad
main.findCatalogItems.func1({0xc0003c4210, 0x24}, {0x82fa48?, 0xc00033c820?}, {0x0?, 0x0?})
        /home/fridim/sync/dev/agnosticv-public/cli/agnosticv.go:243 +0x32f
path/filepath.walk({0xc0003c4210, 0x24}, {0x82fa48, 0xc00033c820}, 0xc00043be10)
        /usr/lib/go/src/path/filepath/path.go:418 +0x123
path/filepath.walk({0xc0004c4180, 0x1b}, {0x82fa48, 0xc00033c0d0}, 0xc00043be10)
        /usr/lib/go/src/path/filepath/path.go:442 +0x285
path/filepath.walk({0xc0003f61e8, 0x4}, {0x82fa48, 0xc000313ee0}, 0xc00043be10)
        /usr/lib/go/src/path/filepath/path.go:442 +0x285
path/filepath.walk({0x7995f8, 0x1}, {0x82fa48, 0xc0004c69c0}, 0xc00043be10)
        /usr/lib/go/src/path/filepath/path.go:442 +0x285
path/filepath.Walk({0x7995f8, 0x1}, 0xc000175e10)
        /usr/lib/go/src/path/filepath/path.go:505 +0x6c
main.findCatalogItems({0xc00001c094, 0x1f}, {0xc000099960, 0x1, 0x1}, {0x0, 0x0, 0x0}, {0x0, 0x0, ...})
        /home/fridim/sync/dev/agnosticv-public/cli/agnosticv.go:219 +0x272
main.main()
        /home/fridim/sync/dev/agnosticv-public/cli/agnosticv.go:491 +0x15c
```
@fridim fridim merged commit 8e4449d into master May 11, 2022
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

Successfully merging this pull request may close these issues.

2 participants