Readme app crashes
gaffo opened this issue · 4 comments
[TODO] ShallowSizeOfInstance(fst.Arc)
[TODO] ShallowSizeOfInstance(*fst.NoOutputs)
Found postings format: Lucene41
Found codec: Lucene42
Found codec: Lucene49
Found codec: Lucene410
2014/12/20 15:34:19 Setting default infoStream...
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x4df397]
goroutine 1 [running]:
github.com/balzaczyy/golucene/core/index.(*IndexWriter).AddDocument(0x0, 0xc20800b1f0, 0x1, 0x1, 0x0, 0x0)
/home/mike/workspace-classyfier/src/github.com/balzaczyy/golucene/core/index/writer.go:562 +0x87
main.main()
/home/mike/workspace-classyfier/src/github.com/gaffo/classyfier/main.go:182 +0x441
goroutine 5 [runnable]:
github.com/balzaczyy/golucene/core/index.(_ConcurrentMergeScheduler).worker(0xc2080464b0, 0x0)
/home/mike/workspace-classyfier/src/github.com/balzaczyy/golucene/core/index/concurrentMergeScheduler.go:90
created by github.com/balzaczyy/golucene/core/index.(_ConcurrentMergeScheduler).SetMaxMergesAndRoutines
/home/mike/workspace-classyfier/src/github.com/balzaczyy/golucene/core/index/concurrentMergeScheduler.go:148 +0x2b9
goroutine 6 [runnable]:
github.com/balzaczyy/golucene/core/index.(*ClosingControl).daemon(0xc20801e900)
/home/mike/workspace-classyfier/src/github.com/balzaczyy/golucene/core/index/writer.go:101
created by github.com/balzaczyy/golucene/core/index.newClosingControl
/home/mike/workspace-classyfier/src/github.com/balzaczyy/golucene/core/index/writer.go:97 +0xf1
exit status 2
This is on go: go version devel +da43976 Thu Dec 11 23:23:30 2014 +0000 linux/amd64 which is a recent from master.
I tried building go from source and it works. Also I have moved the example to gl.go. Please have a try.
go version devel +c7eb966 Wed Dec 24 07:30:28 2014 +0000 darwin/amd64
go run gl.go
BTW, the original example ignored all the error handling. So it could be the case, that some step might already failed, and resulted in null pointer. You can try add an error in main.go, L182, to check the details.
So I deleted that directory and a fresh pull of it seems to work fine. As does a run of all tests. So I'd call it fixed or no-issue. If I encounter it again I'll try for better error handling and get you a better bug report.