[vz-dev] Dockstar - vzlogger Core Dump

Gerhard Bertelsmann info at gerhard-bertelsmann.de
Fri Jan 6 19:32:16 CET 2012


Hallo,

Am Fr, 6.01.2012, 03:07, schrieb Thorben Thuermer:
> On Fri, 6 Jan 2012 02:14:44 +0100 (CET)
> "Gerhard Bertelsmann" <info at gerhard-bertelsmann.de> wrote:
>> Hier der Ausgabe des Backtrace (noch ohne zusätzlichen Debug - läuft
>> gerade (noch)):
>> #0  0x4027dd78 in raise () from /lib/arm-linux-gnueabi/libc.so.6
>> (gdb) bt full
> [...]
>> Backtrace stopped: previous frame identical to this frame (corrupt
>> stack?)
>
> das ist ein recht sicheres zeichen fuer arge memory-corruption,
> da wohl die ruecksprungaddressen auf dem stack ueberschrieben wurden...
> (normalerweise sollte man die funktionsaufrufe bis zurueck zu main()
> sehen,
>  bei der debug-version sogar mit parametern,
>  bei "bt full" noch mit lokalen variablen)
>
> wenn du lust hast das noch weiter zu debuggen, kannst du zB
> "electric-fence"
> installieren, ein tool das illegale speicherzugriffe fruehzeitig erkennt,
> und das programm anhaelt. (zur verwendung: README.Debian im
> doc-verzeichniss)

Ich habe mal folgendes gemacht:

root at Stromkasten:~# export LD_PRELOAD=libefence.so.0.0

root at Stromkasten:~# vzlogger -d

  Electric Fence 2.1 Copyright (C) 1987-1998 Bruce Perens.
[Jan 06 19:06:07][mtr0] New meter initialized (protocol=sml)
[Jan 06 19:06:07][ch0]  New channel initialized (uuid=...5de9e1
middleware=http://192.168.0.250/middleware.php id=1-0:1.8.2*255
counter=yes)
[Jan 06 19:06:07][ch1]  New channel initialized (uuid=...3f5403
middleware=http://192.168.0.250/middleware.php id=1-0:1.8.1*255
counter=yes)
[Jan 06 19:06:07][ch2]  New channel initialized (uuid=...187dcf
middleware=http://192.168.0.250/middleware.php id=1-0:1.8.0*255
counter=yes)
[Jan 06 19:06:07]       Daemonize process...
root at Stromkasten:~#

Brach dann nach ein paar Messungen ab:


[Jan 06 19:11:03][mtr0] Reading: id=129-129:199.130.3*255 value=0.00
ts=1325873463.794
[Jan 06 19:11:03][mtr0] Reading: id=1-0:0.0.9*255 value=0.00
ts=1325873463.794
[Jan 06 19:11:03][mtr0] Reading: id=1-0:1.8.0*255 value=3491321.75
ts=1325873463.794
[Jan 06 19:11:03][mtr0] Reading: id=1-0:1.8.1*255 value=946594.19
ts=1325873463.794
[Jan 06 19:11:03][mtr0] Reading: id=1-0:1.8.2*255 value=2544727.50
ts=1325873463.794
[Jan 06 19:11:03][mtr0] Reading: id=1-0:15.7.0*255 value=1386.40
ts=1325873463.794
[Jan 06 19:11:03][mtr0] Reading: id=129-129:199.130.5*255 value=0.00
ts=1325873463.794
[Jan 06 19:11:03][mtr0] Reading: id=0-0:0.0.0*0 value=0.00 ts=0.000
[Jan 06 19:11:03][ch0]  Adding reading to queue (value=2544727.50
delta=1.00 ts=1325873463.794)
[Jan 06 19:11:03][ch0]  JSON request body: [ [ 1325873463794.105957,
1.000000 ] ]
[Jan 06 19:11:03][ch0]  CURL: Re-using existing connection! (#0) with host
192.168.0.250
[Jan 06 19:11:03][ch0]  CURL: Connected to 192.168.0.250 (192.168.0.250)
port 80 (#0)
[Jan 06 19:11:03][ch0]  Buffer dump: |!1.00| (size=1, keep=0)
[Jan 06 19:11:03][ch1]  Adding reading to queue (value=946594.19
delta=0.00 ts=1325873463.794)
[Jan 06 19:11:03][ch1]  JSON request body: [ [ 1325873463794.102051,
0.000000 ] ]
[Jan 06 19:11:03][ch1]  Buffer dump: |!0.00| (size=1, keep=0)
[Jan 06 19:11:03][ch2]  Adding reading to queue (value=3491321.75
delta=1.25 ts=1325873463.794)
[Jan 06 19:11:03][ch2]  JSON request body: [ [ 1325873463794.099121,
1.250000 ] ]
[Jan 06 19:11:03][ch2]  Buffer dump: |!1.25| (size=1, keep=0)
[Jan 06 19:11:03][ch2]  CURL: Re-using existing connection! (#0) with host
192.168.0.250
[Jan 06 19:11:03][ch1]  CURL: Re-using existing connection! (#0) with host
192.168.0.250
[Jan 06 19:11:03][ch0]  CURL: Sent 38 bytes..
[Jan 06 19:11:03][ch0]  CURL: upload completely sent off: 38 out of 38 bytes
[Jan 06 19:11:03][ch1]  CURL: Connected to 192.168.0.250 (192.168.0.250)
port 80 (#0)
[Jan 06 19:11:03][ch2]  CURL: Connected to 192.168.0.250 (192.168.0.250)
port 80 (#0)
[Jan 06 19:11:03][ch0]  CURL: additional stuff not fine transfer.c:1036: 0 0
[Jan 06 19:11:03][ch2]  CURL: Sent 38 bytes..
[Jan 06 19:11:03][ch1]  CURL: Sent 38 bytes..
[Jan 06 19:11:03][ch1]  CURL: upload completely sent off: 38 out of 38 bytes
[Jan 06 19:11:03][ch2]  CURL: upload completely sent off: 38 out of 38 bytes
[Jan 06 19:11:03][ch2]  CURL: additional stuff not fine transfer.c:1036: 0 0
[Jan 06 19:11:03][ch1]  CURL: additional stuff not fine transfer.c:1036: 0 0
[Jan 06 19:11:04][ch0]  CURL: HTTP 1.1 or later with persistent
connection, pipelining supported
[Jan 06 19:11:04][ch0]  CURL: Received 17 bytes
[Jan 06 19:11:04][ch0]  CURL: Connection #0 to host 192.168.0.250 left intact
[Jan 06 19:11:04][ch0]  Request succeeded with code: 200
[Jan 06 19:11:04][ch2]  CURL: HTTP 1.1 or later with persistent
connection, pipelining supported
[Jan 06 19:11:04][ch2]  CURL: Received 17 bytes
[Jan 06 19:11:04][ch2]  CURL: Connection #0 to host 192.168.0.250 left intact
[Jan 06 19:11:04][ch2]  Request succeeded with code: 200
[Jan 06 19:11:04][ch1]  CURL: HTTP 1.1 or later with persistent
connection, pipelining supported
[Jan 06 19:11:04][ch1]  CURL: Received 17 bytes
[Jan 06 19:11:04][ch1]  CURL: Connection #0 to host 192.168.0.250 left intact
[Jan 06 19:11:04][ch1]  Request succeeded with code: 200
[Jan 06 19:11:06][mtr0] Got 8 new readings from meter:
[Jan 06 19:11:06][mtr0] Reading: id=129-129:199.130.3*255 value=0.00
ts=1325873466.891
[Jan 06 19:11:06][mtr0] Reading: id=1-0:0.0.9*255 value=0.00
ts=1325873466.891
[Jan 06 19:11:06][mtr0] Reading: id=1-0:1.8.0*255 value=3491323.00
ts=1325873466.891
[Jan 06 19:11:06][mtr0] Reading: id=1-0:1.8.1*255 value=946594.19
ts=1325873466.891
[Jan 06 19:11:06][mtr0] Reading: id=1-0:1.8.2*255 value=2544728.75
ts=1325873466.891
[Jan 06 19:11:06][mtr0] Reading: id=1-0:15.7.0*255 value=1383.10
ts=1325873466.891
[Jan 06 19:11:06][mtr0] Reading: id=129-129:199.130.5*255 value=0.00
ts=1325873466.891
[Jan 06 19:11:06][mtr0] Reading: id=0-0:0.0.0*0 value=0.00 ts=0.000
[Jan 06 19:11:06][ch0]  Adding reading to queue (value=2544728.75
delta=1.25 ts=1325873466.891)
[Jan 06 19:11:06][ch0]  JSON request body: [ [ 1325873466891.032959,
1.250000 ] ]
[Jan 06 19:11:06][ch0]  Buffer dump: |!1.25| (size=1, keep=0)
[Jan 06 19:11:06][ch1]  Adding reading to queue (value=946594.19
delta=0.00 ts=1325873466.891)
[Jan 06 19:11:06][ch1]  Buffer dump: |!0.00| (size=1, keep=0)
[Jan 06 19:11:06][ch2]  Adding reading to queue (value=3491323.00
delta=1.25 ts=1325873466.891)
[Jan 06 19:11:06][ch1]  JSON request body: [ [ 1325873466891.028809,
0.000000 ] ]
[Jan 06 19:11:06][ch0]  CURL: Re-using existing connection! (#0) with host
192.168.0.250
[Jan 06 19:11:06][ch2]  JSON request body: [ [ 1325873466891.025146,
1.250000 ] ]
[Jan 06 19:11:06][ch2]  Buffer dump: |!1.25| (size=1, keep=0)
[Jan 06 19:11:06][ch0]  CURL: Connected to 192.168.0.250 (192.168.0.250)
port 80 (#0)
[Jan 06 19:11:06][ch1]  CURL: Re-using existing connection! (#0) with host
192.168.0.250
[Jan 06 19:11:06][ch1]  CURL: Connected to 192.168.0.250 (192.168.0.250)
port 80 (#0)
[Jan 06 19:11:06][ch2]  CURL: Re-using existing connection! (#0) with host
192.168.0.250
[Jan 06 19:11:06][ch2]  CURL: Connected to 192.168.0.250 (192.168.0.250)
port 80 (#0)
[Jan 06 19:11:06][ch0]  CURL: Sent 38 bytes..
[Jan 06 19:11:06][ch0]  CURL: upload completely sent off: 38 out of 38 bytes
[Jan 06 19:11:06][ch0]  CURL: additional stuff not fine transfer.c:1036: 0 0
[Jan 06 19:11:06][ch1]  CURL: Sent 38 bytes..
[Jan 06 19:11:06][ch1]  CURL: upload completely sent off: 38 out of 38 bytes
[Jan 06 19:11:06][ch1]  CURL: additional stuff not fine transfer.c:1036: 0 0
[Jan 06 19:11:06][ch2]  CURL: Sent 38 bytes..
[Jan 06 19:11:06][ch2]  CURL: upload completely sent off: 38 out of 38 bytes
[Jan 06 19:11:06][ch2]  CURL: additional stuff not fine transfer.c:1036: 0 0
[Jan 06 19:11:07][ch0]  CURL: HTTP 1.1 or later with persistent
connection, pipelining supported
[Jan 06 19:11:07][ch0]  CURL: Received 17 bytes
[Jan 06 19:11:07][ch0]  CURL: Connection #0 to host 192.168.0.250 left intact
[Jan 06 19:11:07][ch0]  Request succeeded with code: 200
[Jan 06 19:11:07][ch1]  CURL: HTTP 1.1 or later with persistent
connection, pipelining supported
[Jan 06 19:11:07][ch1]  CURL: Received 17 bytes
[Jan 06 19:11:07][ch1]  CURL: Connection #0 to host 192.168.0.250 left intact
[Jan 06 19:11:07][ch1]  Request succeeded with code: 200
[Jan 06 19:11:07][ch2]  CURL: HTTP 1.1 or later with persistent
connection, pipelining supported
[Jan 06 19:11:07][ch2]  CURL: Received 17 bytes
[Jan 06 19:11:07][ch2]  CURL: Connection #0 to host 192.168.0.250 left intact
[Jan 06 19:11:07][ch2]  Request succeeded with code: 200

GDB sagt:

root at Stromkasten:~# gdb /usr/local/bin/vzlogger -c /core
GNU gdb (GDB) 7.3-debian
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/local/bin/vzlogger...done.

warning: exec file is newer than core file.
[New LWP 11100]
[New LWP 11102]
[New LWP 11101]
[Thread debugging using libthread_db enabled]
Core was generated by `vzlogger'.
Program terminated with signal 11, Segmentation fault.
#0  0x4024fa88 in pthread_cancel (th=1920233071) at pthread_cancel.c:35
35	pthread_cancel.c: No such file or directory.
	in pthread_cancel.c
(gdb) bt full
#0  0x4024fa88 in pthread_cancel (th=1920233071) at pthread_cancel.c:35
        pd = 0x72746e6f
        result = <optimized out>
        oldval = <optimized out>
        newval = <optimized out>
#1  0x0000ae94 in quit (sig=<optimized out>) at src/vzlogger.c:235
        ch = <optimized out>
        __it_234 = 0x8a7ab0
        mapping = <optimized out>
        __it_231 = 0x8a7a80
#2  <signal handler called>
No locals.
#3  0x4024a0c8 in pthread_join (threadid=1091154976, thread_return=0x0) at
pthread_join.c:89
        __tid = 11101
        _buffer = {__routine = 0x40249fb0 <cleanup>, __arg = 0x4109b63c,
__canceltype = 9075328, __prev = 0x0}
        oldtype = 0
        self = <optimized out>
        result = 0
#4  0x0000aa34 in main (argc=<optimized out>, argv=<optimized out>) at
src/vzlogger.c:418
        mtr = 0x8a7ac0
        __it_420 = <optimized out>
        mapping = 0x8a7ac0
        action = {__sigaction_handler = {sa_handler = 0xae50 <quit>,
sa_sigaction = 0xae50 <quit>}, sa_mask = {__val = {0 <repeats 32
times>}}, sa_flags = 0, sa_restorer = 0xa17c <_init+8>}
        __it_372 = <optimized out>
        httpd_handle = 0x8a7960
        __it_415 = 0x8a7a80
(gdb) qut

Ich bin kein GDB Spezialist. Verursacht der Aufruf von pthread_cancel den
Fehler ?



Gruß

Gerd





More information about the volkszaehler-dev mailing list