Libelektra: elektrad: crash on Debian Buster

Created on 17 Mar 2020  路  7Comments  路  Source: ElektraInitiative/libelektra

Steps to Reproduce the Problem

Install golang-1.14-go (freshly arrived in backports :fireworks:) and then compile and run elektrad:

PATH="$PATH:/usr/lib/go-1.14/bin" cmake -DTOOLS="kdb;web" . 
bin/elektrad

Expected Result

that elektrad starts successfully or prints some error message

Actual Result

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6b4ce7]

goroutine 1 [running]:
main.loadVersion()
        /home/markus/Projekte/Elektra/current/src/tools/web/elektrad/main.go:43 +0x37
main.main()
        /home/markus/Projekte/Elektra/current/src/tools/web/elektrad/main.go:17 +0x127

Backtrace:

Thread 1 "elektrad" received signal SIGSEGV, Segmentation fault.
main.loadVersion () at /home/markus/Projekte/Elektra/current/src/tools/web/elektrad/main.go:43
43              defer kdb.kdb.Close()
(gdb) bt
#0  main.loadVersion () at /home/markus/Projekte/Elektra/current/src/tools/web/elektrad/main.go:43
#1  0x00000000006b4ae7 in main.main () at /home/markus/Projekte/Elektra/current/src/tools/web/elektrad/main.go:17

System Information

  • Elektra Version: master
bug

Most helpful comment

In general it makes a lot of sense to have error messages when something fails at startup. Can you create a PR with these changes?

Not logging the error was a bug not a design decision :) I will open up a PR today

All 7 comments

@markus2330 thank you for testing and reporting. FYI I was only able to get it running in docker as described here, not on my host machine. It would be great if this could be improved.

@raphi011 I tried again with

PATH="$PATH:/usr/lib/go-1.14/bin" ~e/scripts/dev/configure-debian -DBINDINGS=ALL -DCMAKE_INSTALL_PREFIX=/srv -DTOOLS="ALL;elektrad;webd;webui;website-frontend" ~e && make -j 5
bin/elektrad

same error:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6b4ce7]

goroutine 1 [running]:
main.loadVersion()
        /home/markus/Projekte/Elektra/current/src/tools/elektrad/main.go:43 +0x37
main.main()
        /home/markus/Projekte/Elektra/current/src/tools/elektrad/main.go:17 +0x127

@markus2330 can you please try it with this branch? https://github.com/raphi011/libelektra/tree/elektrad-log-startup-error

it should log an error instead of panicing. I haven't been able to reproduce the runtime error yet.

Thank you! :+1:

In general it makes a lot of sense to have error messages when something fails at startup. Can you create a PR with these changes?

On your branch in your repo:

PATH="$PATH:/usr/lib/go-1.14/bin" cmake -DTOOLS="kdb;webd;elektrad;webui" ..
bin/elektrad
2020/04/29 07:31:27 C01200 Installation - Tried to get a key from a missing backend: system/hosts

So probably it was from the beginning only a discrepancy of which plugins were enabled in different build directories but who knows without seeing any error messages?

In general it makes a lot of sense to have error messages when something fails at startup. Can you create a PR with these changes?

Not logging the error was a bug not a design decision :) I will open up a PR today

PR opened, can I close this issue?

I did not yet check on another computer where I also had the crash.

Please close together with the PR (It is enough if you write in the PR description, although commit messages are generally preferred as they are stored in git).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

e1528532 picture e1528532  路  4Comments

markus2330 picture markus2330  路  3Comments

markus2330 picture markus2330  路  4Comments

mpranj picture mpranj  路  4Comments

sanssecours picture sanssecours  路  4Comments