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

vzlogger crash after some Minutes Status=11/SEGV #428

Closed
Morphi08 opened this issue Jul 4, 2020 · 24 comments
Closed

vzlogger crash after some Minutes Status=11/SEGV #428

Morphi08 opened this issue Jul 4, 2020 · 24 comments
Assignees
Labels

Comments

@Morphi08
Copy link

Morphi08 commented Jul 4, 2020

Hello,
i install e new Image on my Raspi 3 from Volkszahler; after that I updated all programs and edited my config.
All thinks would be Ok, but after some time, maybe 20 Minutes, the vzlogger deamon crash; in the Logfile is nothing unnormal, but in the syslog there is this statement:
Jul 4 18:05:59 raspberrypi systemd[1]: vzlogger.service: Main process exited, code=killed, status=11/SEGV Jul 4 18:05:59 raspberrypi systemd[1]: vzlogger.service: Failed with result ‚signal'.

The version of the vzlogger is 0.8.0

@mbehr1
Copy link
Contributor

mbehr1 commented Jul 4, 2020 via email

@Morphi08
Copy link
Author

Morphi08 commented Jul 4, 2020

I have to change some settings on the raspi and reboot, than I check that there is some core-dumps after the crash; I will submit it

@Morphi08
Copy link
Author

Morphi08 commented Jul 4, 2020

I hope this is useful....
core-vzlogger-sig11-user0-group0-pid727-time1593885104.gz

@mbehr1
Copy link
Contributor

mbehr1 commented Jul 5, 2020 via email

@Morphi08
Copy link
Author

Morphi08 commented Jul 5, 2020

hm, sorry .. I doesn't know this command; it won't get any information with this commands gdb bt full
when I use gdb, in the program bt -> there is no stack ?
can you provide me to use the right command?

@mbehr1
Copy link
Contributor

mbehr1 commented Jul 5, 2020 via email

@Morphi08
Copy link
Author

Morphi08 commented Jul 5, 2020

Hallo, das sollte jetzt gehen, nachdem man das "set on logging" eingeschaltet hat ;-)
gdb.txt
Ich hoffe die Datei kann helfen.

Hi, it would be work when the logging is set on into gdb; I hope the textfile can help

@Morphi08
Copy link
Author

Morphi08 commented Jul 5, 2020

i use for a workaround the crontab with this script every 10 minutes:

TEST=ps -A | grep vzlogger | awk '{ print $4 }'
if [ "$TEST" != "vzlogger" ]; then
sleep 5
systemctl start vzlogger
fi

@mbehr1
Copy link
Contributor

mbehr1 commented Jul 5, 2020 via email

@andig
Copy link
Contributor

andig commented Jul 5, 2020 via email

@Morphi08
Copy link
Author

Morphi08 commented Jul 5, 2020

Hallo andig, wenn Du mir sagst, nach was ich schauen soll, lässt sich das machen ..
@matthias, durch meinen "Watchdog" läuft die Messung zwar, der vzlogger ist 18x heute abgestürzt..; wenn Du eine Lib entsprechend anpassen kannst, teste ich diese gerne.

VG Arne

@mbehr1
Copy link
Contributor

mbehr1 commented Jul 11, 2020 via email

@mbehr1
Copy link
Contributor

mbehr1 commented Jul 11, 2020 via email

@devZer0
Copy link

devZer0 commented Jul 11, 2020

bei der gelegenheit - können wir einen binary-dump von deinem zähler haben? für https://github.com/devZer0/libsml-testing ? (und könnte man evtl. im volkszähler/vzlogger projekt ne info hinterlegen um leute dazu zu ermutigen sowas zu submitten) ?

@Morphi08
Copy link
Author

Morphi08 commented Jul 11, 2020 via email

@mbehr1
Copy link
Contributor

mbehr1 commented Jul 11, 2020

3 weitere (potentielle) Fixes sind hier: https://github.com/volkszaehler/libsml/pull/86/files

@mbehr1
Copy link
Contributor

mbehr1 commented Jul 11, 2020

@Morphi08
Hallo Arne,
kam beim install.sh die Ausgabe:
building and installing libsml
?
Kannst du mal in
cd vzlogger/libs/libsml
und dort
git pull
git log
make && make install
aufrufen?

Das nimmt zwar nicht den PR 86 mit (aber der erste ist bereits gemerged).

Tritt dein Fehler noch auf?

@Morphi08
Copy link
Author

Morphi08 commented Jul 11, 2020 via email

@Morphi08
Copy link
Author

Morphi08 commented Jul 11, 2020

[core-vzlogger-sig11-user0-group0-pid3042-time1594491503.gz]eading symbols from /usr/local/bin/vzlogger...done.
[New LWP 3046]
[New LWP 3048]
[New LWP 3049]
[New LWP 3042]
[New LWP 3050]
[New LWP 3051]
[New LWP 3047]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
Core was generated by `/usr/local/bin/vzlogger -c /etc/vzlogger.conf'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 sml_message_parse (buf=0x755059c8) at src/sml_message.c:71

warning: Source file is more recent than executable.
71 if (sml_buf_has_errors(buf) || !(msg->crc))
[Current thread is 1 (Thread 0x75e511e0 (LWP 3046))]
(gdb) bt full
#0 sml_message_parse (buf=0x755059c8) at src/sml_message.c:71
msg = 0x75500f70
msg_start = 51
len = 51
#1 0x0012b8cc in sml_file_parse (buffer=0x75e4e9c8 "v\vESYA\037\350\005\320n\302b", buffer_len=4972) at src/sml_file.c:54
file = 0x75505158
buf = 0x755059c8
msg = 0x75502cf8
#2 0x000d33d4 in MeterSML::read (this=0x1869418, rds=std::vector of length 32, capacity 32 = {...}, n=32)
at /home/pi/vzlogger/src/protocols/MeterSML.cpp:280
buffer = "\033\033\033\033\001\001\001\001v\vESYA\037\350\005\320n\302b\000b\000rc\001\001v\001\004ESY\bESY$\354n\302\v\t\001ESY\021\003\246\037\350\001\001c\230\375\000v\vESYA\037\350\005\320n\303b\000b\000rc\a\001w\001\v\t\001ESY\021\003\246\037\350\a\001\000b\n\377\377rb\001e\001\003\000\377\001\001\001\001\004ESY\001w\a\001\000\000\000\t\377\001\001\001\001\v\t\001ESY\021\003\246\037\350\001w\a\001\000\001\b\000\377d\000\000\200\001b\036R\374Y\000\000\000\000\000\020\a\000\377\001\001b\033R\376Y\000\000\000\000\000\000\355\252\001w\a\001\000$\a\000\377\001\001b\033R\376Y\000\000\000\000\000\000"...
bytes = 4988
m = 0
file = 0x75e50be4
body = 0x75e52820
entry = 0x7eab76ac <__vdso_gettimeofday+12>
#3 0x000bd7a0 in Meter::read (this=0x1869118, rds=std::vector of length 32, capacity 32 = {...}, n=32)
at /home/pi/vzlogger/src/Meter.cpp:246
No locals.
--Type for more, q to quit, c to continue without paging--
#4 0x0011ad94 in reading_thread (arg=0x1869238) at /home/pi/vzlogger/src/threads.cpp:70
mapping = 0x1869238
mtr = std::tr1::shared_ptr (use count 2, weak count 0) = {get() = 0x1869118}
aggIntEnd = 1594491638
details = 0x288750 <protocols+120>
n = 5
rds = std::vector of length 32, capacity 32 = {{_deleted = false, _value = 4122942.5087000001, _time = {tv_sec = 1594491490,
tv_usec = 417605}, _identifier = std::tr1::shared_ptr (use count 2, weak count 0) = {
get() = 0x755077a0}}, {_deleted = false, _value = 606.52999999999997, _time = {tv_sec = 1594491490, tv_usec = 417610},
_identifier = std::tr1::shared_ptr (use count 2, weak count 0) = {get() = 0x75504040}}, {
_deleted = false, _value = 218.25, _time = {tv_sec = 1594491490, tv_usec = 417613},
_identifier = std::tr1::shared_ptr (use count 2, weak count 0) = {get() = 0x75505a38}}, {
_deleted = false, _value = 18.850000000000001, _time = {tv_sec = 1594491490, tv_usec = 417616},
_identifier = std::tr1::shared_ptr (use count 2, weak count 0) = {get() = 0x75503cf8}}, {
_deleted = false, _value = 369.42000000000002, _time = {tv_sec = 1594491490, tv_usec = 417618},
_identifier = std::tr1::shared_ptr (use count 2, weak count 0) = {get() = 0x75503d08}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
--Type for more, q to quit, c to continue without paging--
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
--Type for more, q to quit, c to continue without paging--
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}, {
_deleted = false, _value = 0, _time = {tv_sec = 0, tv_usec = 0},
--Type for more, q to quit, c to continue without paging--
_identifier = std::tr1::shared_ptr (use count 28, weak count 0) = {get() = 0x183d750}}}
#5 0x76dc3494 in start_thread (arg=0x75e511e0) at pthread_create.c:486
ret =
start =
pd = 0x75e511e0
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {-63143936, -16400464, 3287808, 1977946592, 1977952288, 338, 2123819650, 1977946592,
0, 1977945372, 0 <repeats 54 times>}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0,
cleanup = 0x0, canceltype = 0}}}
not_first_call =
#6 0x76551578 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73 from /lib/arm-linux-gnueabihf/libc.so.6
No locals.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

@mbehr1
Copy link
Contributor

mbehr1 commented Jul 11, 2020 via email

@mbehr1
Copy link
Contributor

mbehr1 commented Jul 11, 2020

@Morphi08 ich glaube, du musst vzlogger auch neu compilieren:

#0 sml_message_parse (buf=0x755059c8) at src/sml_message.c:71
warning: Source file is more recent than executable.

oder min. ein libsml make && make install

@Morphi08
Copy link
Author

Morphi08 commented Jul 12, 2020 via email

@mbehr1
Copy link
Contributor

mbehr1 commented Jul 12, 2020

Hallo Arne,

prima. Dann scheinen die Fixes zu greifen. Ich finde grad durch Anwendung von libFuzzer noch massenhaft weitere mögliche... :-) Crashes.
Master umstellen nur nicht vergessen, sonst bleibt beim nächsten Update die libsml auf dem Stand.

Ich würde vorschlagen, wir machen das Issue hier zu, sobald PR 86 gemerged ist?

Gruß
Matthias

@mbehr1
Copy link
Contributor

mbehr1 commented Jul 18, 2020

Fixed with merge of libsml PR #86.

(@Morphi08 jetzt nicht vergessen, wieder auf libsml/master umzustellen)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants