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

Bug: indexing with cdxj causes a panic #11

Closed
Avokadoen opened this issue Mar 1, 2021 · 2 comments
Closed

Bug: indexing with cdxj causes a panic #11

Avokadoen opened this issue Mar 1, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Avokadoen
Copy link
Contributor

Avokadoen commented Mar 1, 2021

Describe the bug
gowarcserver panics when i try to index testdata/IAH-20080430204825-00000-blackbook.warc

To Reproduce
Steps to reproduce the behavior:

  1. checkout branch in pr Allow end user to control badger's memory usage #3 (badger-control in fork)
  2. run gowarcserver index with -f cdxj i.e ./warcserver index -f cdxj ./testdata/IAH-20080430204825-00000-blackbook.warc

Expected behavior
gowarcserver should index the files or report a user error to the terminal.

Additional context

[akselhjerpbakk@localhost gowarcserver]$ ./warcserver index -f cdxj ./testdata/IAH-20080430204825-00000-blackbook.warc 
Using config file: /home/akselhjerpbakk/Projects/warcproject/gowarcserver/config.yaml
Format: cdxj
Count:  2
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x91749c]

goroutine 1 [running]:
github.com/golang/protobuf/jsonpb.(*jsonWriter).marshalMessage(0xc0001c9aa0, 0xcd9ba0, 0xc0001d4a00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/akselhjerpbakk/go/pkg/mod/github.com/golang/[email protected]/jsonpb/encode.go:219 +0x73c
github.com/golang/protobuf/jsonpb.(*Marshaler).marshal(0x0, 0xccfca0, 0xc0001d4a00, 0x32, 0x2e2, 0xc0001d4a00, 0xc000330040, 0x0)
        /home/akselhjerpbakk/go/pkg/mod/github.com/golang/[email protected]/jsonpb/encode.go:116 +0x207
github.com/golang/protobuf/jsonpb.(*Marshaler).MarshalToString(...)
        /home/akselhjerpbakk/go/pkg/mod/github.com/golang/[email protected]/jsonpb/encode.go:78
github.com/nlnwa/gowarcserver/pkg/index.(*CdxJ).Write(0xc000010268, 0xcd4920, 0xc00007cd40, 0x7ffee18cb20a, 0x32, 0x2e2, 0x0, 0x0)
        /home/akselhjerpbakk/Projects/warcproject/gowarcserver/pkg/index/indexwriter.go:74 +0xe6
github.com/nlnwa/gowarcserver/cmd/warcserver/cmd/index.readFile(0xc0001dc5a0, 0x0, 0x0)
        /home/akselhjerpbakk/Projects/warcproject/gowarcserver/cmd/warcserver/cmd/index/index.go:120 +0x15f
github.com/nlnwa/gowarcserver/cmd/warcserver/cmd/index.runE(0xc0001dc5a0, 0x0, 0x0)
        /home/akselhjerpbakk/Projects/warcproject/gowarcserver/cmd/warcserver/cmd/index/index.go:92 +0xf0
github.com/nlnwa/gowarcserver/cmd/warcserver/cmd/index.NewCommand.func2(0xc0001d3400, 0xc0001dc780, 0x1, 0x3, 0x0, 0x0)
        /home/akselhjerpbakk/Projects/warcproject/gowarcserver/cmd/warcserver/cmd/index/index.go:79 +0xba
github.com/spf13/cobra.(*Command).execute(0xc0001d3400, 0xc0001dc6f0, 0x3, 0x3, 0xc0001d3400, 0xc0001dc6f0)
        /home/akselhjerpbakk/go/pkg/mod/github.com/spf13/[email protected]/command.go:826 +0x47c
github.com/spf13/cobra.(*Command).ExecuteC(0xc0001d2f00, 0xc000000180, 0xc0001c9f78, 0x4118e5)
        /home/akselhjerpbakk/go/pkg/mod/github.com/spf13/[email protected]/command.go:914 +0x30b
github.com/spf13/cobra.(*Command).Execute(...)
        /home/akselhjerpbakk/go/pkg/mod/github.com/spf13/[email protected]/command.go:864
main.main()
        /home/akselhjerpbakk/Projects/warcproject/gowarcserver/cmd/warcserver/main.go:27 +0x2b
@Avokadoen Avokadoen added the bug Something isn't working label Mar 1, 2021
@Avokadoen Avokadoen self-assigned this Mar 6, 2021
@Avokadoen
Copy link
Contributor Author

Avokadoen commented Mar 6, 2021

After some investigation, the master does not actually have this bug. PR #3 does meaning this is a regression.

@Avokadoen
Copy link
Contributor Author

Avokadoen commented Mar 6, 2021

03c1e7f closes this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant