bravohe / sma-bluetooth

Automatically exported from code.google.com/p/sma-bluetooth
0 stars 0 forks source link

*** buffer overflow detected ***: ./smatool terminated #120

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Run ./smatool -v -c garage.conf

* 3 out of 4 runs gives this error
* 1 out of 4 I get the well known date error

What is the expected output? What do you see instead?
...
22/3/2013 19:45:00  total=1609.767 Kwh current=0 Watts togo=0 i=47 crc=0
22/3/2013 19:50:00  total=1609.767 Kwh current=0 Watts togo=0 i=59 crc=0
22/3/2013 19:55:00  total=1609.767 Kwh current=0 Watts togo=0 i=71 crc=0
22/3/2013 20:00:00  total=1609.767 Kwh current=0 Watts togo=0 i=83 crc=0
22/3/2013 20:05:00  total=1609.767 Kwh current=0 Watts togo=0 i=95 crc=0
22/3/2013 20:10:00  total=1609.767 Kwh current=0 Watts togo=0 i=107 crc=0
*** buffer overflow detected ***: ./smatool terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7f7d04c3f807]
/lib/x86_64-linux-gnu/libc.so.6(+0x109700)[0x7f7d04c3e700]
/lib/x86_64-linux-gnu/libc.so.6(+0x108b69)[0x7f7d04c3db69]
/lib/x86_64-linux-gnu/libc.so.6(_IO_default_xsputn+0xdd)[0x7f7d04bb113d]
/lib/x86_64-linux-gnu/libc.so.6(_IO_vfprintf+0x1ae7)[0x7f7d04b7f4a7]
/lib/x86_64-linux-gnu/libc.so.6(__vsprintf_chk+0x94)[0x7f7d04c3dc04]
/lib/x86_64-linux-gnu/libc.so.6(__sprintf_chk+0x7d)[0x7f7d04c3db4d]
./smatool[0x404513]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f7d04b5676d]
./smatool[0x404e65]
======= Memory map: ========
00400000-0040f000 r-xp 00000000 fc:01 285767                             
/usr/local/sbin/SMABluetooth/smatool
0060e000-0060f000 r--p 0000e000 fc:01 285767                             
/usr/local/sbin/SMABluetooth/smatool
0060f000-00610000 rw-p 0000f000 fc:01 285767                             
/usr/local/sbin/SMABluetooth/smatool
0067e000-006e0000 rw-p 00000000 00:00 0                                  [heap]
7f7cf8000000-7f7cf8021000 rw-p 00000000 00:00 0
...

What version of the product are you using? On what operating system?
0.18 on Ubuntu 12.04

Please provide any additional information below.
None

Original issue reported on code.google.com by joosblan...@gmail.com on 22 Mar 2013 at 7:27

GoogleCodeExporter commented 9 years ago
Date error:
Auto set dates from 2000-01-01 00:00:00 to 2013-03-22 20:29:00
bluetooth signal = 72%
serial=7e:5f:2c:c6
bluetooth signal = 72%
bluetooth signal = 72%
2013-03-22 06:32:37 Unit Serial          = 3821139 none
2013-03-22 06:32:37 NO DATA for 1f 82 = 8001 NO UNITS
2013-03-22 06:32:37 NO DATA for 20 82 = 9071 NO UNITS
2013-03-20 00:01:43 NO DATA for 21 82 = 601 NO UNITS
2013-03-20 00:01:43 NO DATA for 21 82 = 635 NO UNITS
2013-03-22 18:39:32 Total Power          = 0 Watts
2013-03-22 20:29:13 Max Phase 1          = 2500 Watts
2013-03-22 20:29:13 Max Phase 2          = 2500 Watts
2013-03-22 20:29:13 Max Phase 3          = 2500 Watts
2013-03-22 20:29:13 Unknown              = 0 Unknown
2013-03-22 20:29:13 Unknown              = 0 Unknown
2013-03-22 20:29:13 NO DATA for 80 41 = 0 NO UNITS
2013-03-22 18:39:32 Output Phase 1       = 0 Watts
2013-03-22 18:39:32 Output Phase 2       = 0 Watts
2013-03-22 18:39:32 Output Phase 3       = 0 Watts
2013-03-22 18:39:32 Line Voltage Phase 1 = 0 Volts
2013-03-22 18:39:32 Line Voltage Phase 2 = 0 Volts
2013-03-22 18:39:32 Line Voltage Phase 3 = 0 Volts
2013-03-22 18:39:32 Line Current Phase 1 = 0 Amps
2013-03-22 18:39:32 Line Current Phase 2 = 0 Amps
2013-03-22 18:39:32 Line Current Phase 3 = 0 Amps
2013-03-22 18:39:32 Grid Frequency       = 0 Hertz
bluetooth signal = 72%

22/8/1970 15:58:08  total=18446180161683456.000 Kwh current=0 Watts togo=0 i=11 
crc=0
1/1/1970 01:04:15  total=0.000 Kwh current=-221354173485073563648 Watts togo=0 
i=23 crc=0Date Error! prev=20185088 current=255

Original comment by joosblan...@gmail.com on 22 Mar 2013 at 7:30

GoogleCodeExporter commented 9 years ago
I have seen this in the mercurial tip aswell.

It is caused by the realloc in InitReturnKeys().

Compiling without the -O option to gcc fixes (avoids?) the issue.

Original comment by wayne.pa...@gmail.com on 16 Oct 2013 at 4:52