Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

chore: Add fuzz testing creating dirs and writting files. #103

Closed
wants to merge 1 commit into from

Conversation

ajnavarro
Copy link
Member

Panic caught:

fuzz: elapsed: 0s, gathering baseline coverage: 0/254 completed
fuzz: elapsed: 1s, gathering baseline coverage: 254/254 completed, now fuzzing with 12 workers
fuzz: elapsed: 3s, execs: 13770 (4588/sec), new interesting: 29 (total: 283)
fuzz: elapsed: 6s, execs: 26422 (4214/sec), new interesting: 41 (total: 295)
fuzz: elapsed: 9s, execs: 44758 (6120/sec), new interesting: 53 (total: 307)
fuzz: elapsed: 12s, execs: 60665 (5303/sec), new interesting: 60 (total: 314)
fuzz: elapsed: 15s, execs: 74012 (4448/sec), new interesting: 64 (total: 318)
fuzz: elapsed: 18s, execs: 92608 (6200/sec), new interesting: 66 (total: 320)
fuzz: elapsed: 21s, execs: 105352 (4247/sec), new interesting: 71 (total: 325)
fuzz: elapsed: 24s, execs: 115204 (3284/sec), new interesting: 74 (total: 328)
fuzz: elapsed: 27s, execs: 124056 (2947/sec), new interesting: 78 (total: 332)
fuzz: elapsed: 30s, execs: 134419 (3458/sec), new interesting: 86 (total: 340)
fuzz: elapsed: 33s, execs: 145090 (3557/sec), new interesting: 89 (total: 343)
fuzz: elapsed: 36s, execs: 157856 (4255/sec), new interesting: 92 (total: 346)
fuzz: minimizing 208-byte failing input file
fuzz: elapsed: 38s, minimizing
--- FAIL: FuzzMkdirAndWriteConcurrently (38.09s)
    --- FAIL: FuzzMkdirAndWriteConcurrently (0.00s)
        testing.go:1349: panic: runtime error: invalid memory address or nil pointer dereference
            goroutine 12871 [running]:
            runtime/debug.Stack()
                /usr/local/go/src/runtime/debug/stack.go:24 +0x90
            testing.tRunner.func1()
                /usr/local/go/src/testing/testing.go:1349 +0x1f2
            panic({0xa6ec60, 0xefe300})
                /usr/local/go/src/runtime/panic.go:838 +0x207
            github.com/ipfs/go-unixfs/hamt.(*childer).has(...)
                /home/ajnavarro/go/pkg/mod/github.com/ipfs/go-unixfs@v0.4.0/hamt/hamt.go:886
            github.com/ipfs/go-unixfs/hamt.(*Shard).swapValue(0xc039753730, {0xbc1440, 0xc00012e000}, 0xc032561348, {0xc000028d69, 0x14}, 0xc008ccd710)
                /home/ajnavarro/go/pkg/mod/github.com/ipfs/go-unixfs@v0.4.0/hamt/hamt.go:623 +0xa3
            github.com/ipfs/go-unixfs/hamt.(*Shard).swapValue(0xc0397536c0, {0xbc1440, 0xc00012e000}, 0xc032561348, {0xc000028d69, 0x14}, 0xc008ccd710)
                /home/ajnavarro/go/pkg/mod/github.com/ipfs/go-unixfs@v0.4.0/hamt/hamt.go:689 +0x745
            github.com/ipfs/go-unixfs/hamt.(*Shard).SetLink(0xc0397536c0, {0xbc1440, 0xc00012e000}, {0xc000028d69, 0x14}, 0xc0004af9b0)
                /home/ajnavarro/go/pkg/mod/github.com/ipfs/go-unixfs@v0.4.0/hamt/hamt.go:248 +0x1f7
            github.com/ipfs/go-unixfs/io.(*BasicDirectory).switchToSharding(0xc00015ea20, {0xbc1440, 0xc00012e000})
                /home/ajnavarro/go/pkg/mod/github.com/ipfs/go-unixfs@v0.4.0/io/directory.go:337 +0x2db
            github.com/ipfs/go-unixfs/io.(*DynamicDirectory).AddChild(0xc000305db0, {0xbc1440, 0xc00012e000}, {0xc00bbf0b49, 0x2}, {0xbc32b8, 0xc039751c80})
                /home/ajnavarro/go/pkg/mod/github.com/ipfs/go-unixfs@v0.4.0/io/directory.go:569 +0x113
            github.com/ipfs/go-mfs.(*Directory).Mkdir(0xc0001b8800, {0xc00bbf0b49, 0x2})
                /home/ajnavarro/workspace/go-mfs/dir.go:316 +0x516
            github.com/ipfs/go-mfs.Mkdir(0xc000305d90, {0xc00bbf0b49, 0x2}, {0x0?, 0x0?, {0x0?, 0x0?}})
                /home/ajnavarro/workspace/go-mfs/ops.go:175 +0x31f
            github.com/ipfs/go-mfs.FuzzMkdirAndWriteConcurrently.func1(0xc0396fb520, 0xd0?, 0x17?, {0xc00bbf0b49, 0x2}, {0xc00bbf0b71, 0x1}, {0xc00dd5b940, 0x1, 0x40})
                /home/ajnavarro/workspace/go-mfs/mfs_test.go:1540 +0x8d
            reflect.Value.call({0xa75ae0?, 0xc000305dc0?, 0x13?}, {0xaf8ffc, 0x4}, {0xc0396135c0, 0x6, 0x8?})
                /usr/local/go/src/reflect/value.go:556 +0x845
            reflect.Value.Call({0xa75ae0?, 0xc000305dc0?, 0x514?}, {0xc0396135c0, 0x6, 0x8})
                /usr/local/go/src/reflect/value.go:339 +0xbf
            testing.(*F).Fuzz.func1.1(0x0?)
                /usr/local/go/src/testing/fuzz.go:337 +0x231
            testing.tRunner(0xc0396fb520, 0xc03921d320)
                /usr/local/go/src/testing/testing.go:1439 +0x102
            created by testing.(*F).Fuzz.func1
                /usr/local/go/src/testing/fuzz.go:324 +0x5b8
            
    

Heavily related to ipfs/kubo#9063, but it is not the same panic.

Signed-off-by: Antonio Navarro Perez antnavper@gmail.com

Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
@ajnavarro ajnavarro requested a review from schomatis as a code owner September 9, 2022 14:18
@welcome
Copy link

welcome bot commented Sep 9, 2022

Thank you for submitting this PR!
A maintainer will be here shortly to review it.
We are super grateful, but we are also overloaded! Help us by making sure that:

  • The context for this PR is clear, with relevant discussion, decisions
    and stakeholders linked/mentioned.

  • Your contribution itself is clear (code comments, self-review for the
    rest) and in its best form. Follow the code contribution
    guidelines

    if they apply.

Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
Next steps:

  • A maintainer will triage and assign priority to this PR, commenting on
    any missing things and potentially assigning a reviewer for high
    priority items.

  • The PR gets reviews, discussed and approvals as needed.

  • The PR is merged by maintainers when it has been approved and comments addressed.

We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution.
We are very grateful for your contribution!

@ajnavarro ajnavarro changed the title chore: Add fuzz testing to reproduce a panic chore: Add fuzz testing creating dirs and writting files. Sep 9, 2022
@lidel lidel removed the request for review from schomatis January 19, 2023 19:51
@lidel lidel added the need/triage Needs initial labeling and prioritization label Jan 19, 2023
@aschmahmann aschmahmann added P2 Medium: Good to have, but can wait until someone steps up kind/maintenance Work required to avoid breaking changes or harm to project's status quo exp/intermediate Prior experience is likely helpful effort/hours Estimated to take one or several hours and removed need/triage Needs initial labeling and prioritization labels May 8, 2023
aschmahmann added a commit to ipfs/boxo that referenced this pull request Jun 26, 2023
@aschmahmann
Copy link
Contributor

Moving to ipfs/boxo#394 as this repository is no longer maintained and has been copied over to Boxo.

You can learn more in the FAQs for the Boxo repo copying/consolidation effort.

@aschmahmann aschmahmann deleted the tests/add-fuzz-reproduce-panic branch June 26, 2023 14:03
@BigLep BigLep mentioned this pull request Aug 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort/hours Estimated to take one or several hours exp/intermediate Prior experience is likely helpful kind/maintenance Work required to avoid breaking changes or harm to project's status quo P2 Medium: Good to have, but can wait until someone steps up
Projects
No open projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants