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

Invalid template passed to ipfs object new [<template>] causes a sigsegv #7785

Closed
achingbrain opened this issue Nov 24, 2020 · 0 comments · Fixed by #7795
Closed

Invalid template passed to ipfs object new [<template>] causes a sigsegv #7785

achingbrain opened this issue Nov 24, 2020 · 0 comments · Fixed by #7795
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@achingbrain
Copy link
Member

Version information:

go-ipfs version: 0.7.0
Repo version: 10
System version: amd64/darwin
Golang version: go1.14.4

Description:

Running ipfs object new and not passing unixfs-dir as the template causes a big stack trace instead of just printing an error message:

$ ipfs object new hello
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x15107a7]

goroutine 1 [running]:
github.com/ipfs/go-blockservice.(*blockService).AddBlock(0xc000de3470, 0x0, 0x0, 0x0, 0x0)
	github.com/ipfs/[email protected]/blockservice.go:134 +0x37
github.com/ipfs/go-merkledag.(*dagService).Add(0xc0000e1410, 0x25d4840, 0xc0008328c0, 0x0, 0x0, 0x0, 0xc00095da90)
	github.com/ipfs/[email protected]/merkledag.go:51 +0x8c
github.com/ipfs/go-ipfs/core/coreapi.(*ObjectAPI).New(0xc0008a1b80, 0x25d4840, 0xc0008328c0, 0xc0001164a8, 0x1, 0x1, 0x0, 0xc000112fd0, 0x1a, 0x2191a26)
	github.com/ipfs/[email protected]/core/coreapi/object.go:53 +0xd3
github.com/ipfs/go-ipfs/core/commands/object.glob..func8(0xc0002ae000, 0x25d4cc0, 0xc0007808a0, 0x2023380, 0xc0007807e0, 0xc00091fc40, 0x1df067e)
	github.com/ipfs/[email protected]/core/commands/object/object.go:502 +0x1bf
github.com/ipfs/go-ipfs-cmds.(*executor).Execute(0xc0001809e8, 0xc0002ae000, 0x25d4cc0, 0xc0007808a0, 0x2023380, 0xc0007807e0, 0xc0007808a0, 0x0)
	github.com/ipfs/[email protected]/executor.go:77 +0x171
github.com/ipfs/go-ipfs-cmds/cli.Run(0x25d4840, 0xc0007fc940, 0x331be00, 0xc000186040, 0x4, 0x4, 0xc000180000, 0xc000180008, 0xc000180010, 0x23f4970, ...)
	github.com/ipfs/[email protected]/cli/run.go:137 +0xa72
main.mainRet(0x0)
	github.com/ipfs/[email protected]/cmd/ipfs/main.go:168 +0x451
main.main()
	github.com/ipfs/[email protected]/cmd/ipfs/main.go:71 +0x22
@achingbrain achingbrain added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Nov 24, 2020
@Stebalien Stebalien removed the need/triage Needs initial labeling and prioritization label Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants