-
Notifications
You must be signed in to change notification settings - Fork 3
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
runtime error on certain org files (minimal example included) #10
Comments
Thanks for the detailed bug report! I'll take a look. |
Hmm, are you running on either Windows or a Mac, by any chance? I'm not getting an error on Linux and I wonder if this is a line-end problem... |
Although I can't reproduce the error, I added a check that should handle it. I also compiled and uploaded new versions for Linux and Windows. Unfortunately I can't build it for the the Mac so I'll have to wait until someone can do that for me. If you use Linux or Windows, would you mind testing the version I uploaded (or you can fetch it from the repo and build it, if you like). |
Thanks for looking into this so quickly: after recompilation, the error appears to have gone :-) Here is more information that may help anyway. I am on Linux (Debian bullseye).
Compilation raises several warnings: $ go build -o microfts |
Great! It's the holidays here so I have some time to mess around with this stuff :). Yeah, those errors are from the C code included with lmdb-go. I haven't looked at how to address those. |
I get a runtime error on certain org files. A minimal org file that shows the error is the following:
#+STARTUP: hidestars
** Q
And here is the backtrace
$ ./microfts input -org /tmp/db.db /tmp/a.org
panic: runtime error: slice bounds out of range [1:0]
goroutine 1 [running]:
main.orgPart(0x24, 0xc000020180, 0x2b, 0x23, 0xc00002019f, 0x4)
/home/dicosmo/code/microfts/fulltext.go:144 +0x5cf
main.forParts(0xc000020180, 0x2b, 0xc000143bc0)
/home/dicosmo/code/microfts/fulltext.go:108 +0xf7
main.(*lmdbConfigStruct).indexOrg(0x665de0, 0x7ffceb819254, 0xa)
/home/dicosmo/code/microfts/fts-lmdb.go:554 +0x18f
main.(*lmdbConfigStruct).index(0x665de0, 0x7ffceb819254, 0xa)
/home/dicosmo/code/microfts/fts-lmdb.go:527 +0x48
main.cmdInput.func1()
/home/dicosmo/code/microfts/fts-lmdb.go:518 +0x4f
main.(*lmdbConfigStruct).update.func1.1()
/home/dicosmo/code/microfts/fts-lmdb.go:1682 +0x2f
main.(*lmdbConfigStruct).runTxn(0x665de0, 0xc00002cc40, 0x0, 0xc000143d08)
/home/dicosmo/code/microfts/fts-lmdb.go:1720 +0x1d0
main.(*lmdbConfigStruct).update.func1(0xc00002cc40, 0xc00002cc40, 0x0)
/home/dicosmo/code/microfts/fts-lmdb.go:1681 +0x72
github.com/AskAlexSharov/lmdb-go/lmdb.(*Txn).runOpTerm(0xc00002cc40, 0xc000143df0, 0x0, 0x0)
/home/dicosmo/go/pkg/mod/github.com/!ask!alex!sharov/lmdb-go@v1.9.1/lmdb/txn.go:158 +0x6e
github.com/AskAlexSharov/lmdb-go/lmdb.(*Env).run(0xc00007a6f0, 0x1, 0x0, 0xc000143df0, 0x0, 0x0)
/home/dicosmo/go/pkg/mod/github.com/!ask!alex!sharov/lmdb-go@v1.9.1/lmdb/env.go:515 +0xbb
github.com/AskAlexSharov/lmdb-go/lmdb.(*Env).Update(...)
/home/dicosmo/go/pkg/mod/github.com/!ask!alex!sharov/lmdb-go@v1.9.1/lmdb/env.go:482
main.(*lmdbConfigStruct).update(0x665de0, 0xc000143e70)
/home/dicosmo/code/microfts/fts-lmdb.go:1680 +0x77
main.cmdInput(0x665de0)
/home/dicosmo/code/microfts/fts-lmdb.go:516 +0x19e
main.runLmdb(0xc000070180)
/home/dicosmo/code/microfts/fts-lmdb.go:210 +0x3be
main.main()
/home/dicosmo/code/microfts/fulltext.go:357 +0xc6f
The text was updated successfully, but these errors were encountered: