nebgor / sma-bluetooth

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

Error "stack smashing detected" #36

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. run smatool -v on my Ubuntu 10.

What is the expected output? What do you see instead?
I expect to upload data to PVOutput.org.  Once there's more than 10-something 
lines of data to process, I get this :

20/8/2011 21:35:00  total=156.771 Kwh current=0 Watts togo=0 i=11 crc=3
20/8/2011 21:40:00  total=156.771 Kwh current=0 Watts togo=0 i=23 crc=3
*** stack smashing detected ***: ./smatool terminated
======= Backtrace: =========
/lib/libc.so.6(__fortify_fail+0x50)[0xb75a8970]
/lib/libc.so.6(+0xe591a)[0xb75a891a]
./smatool[0x8052805]
[0x62623635]
======= Memory map: ========
08048000-08055000 r-xp 00000000 08:05 793221     
/local/Downloads/sma/sma-bluetooth/smatool
08055000-08056000 r--p 0000d000 08:05 793221     
/local/Downloads/sma/sma-bluetooth/smatool
08056000-08057000 rw-p 0000e000 08:05 793221     
/local/Downloads/sma/sma-bluetooth/smatool
09355000-09398000 rw-p 00000000 00:00 0          [heap]
b6f24000-b6f3e000 r-xp 00000000 08:02 2965       /lib/libgcc_s.so.1
b6f3e000-b6f3f000 r--p 00019000 08:02 2965       /lib/libgcc_s.so.1
b6f3f000-b6f40000 rw-p 0001a000 08:02 2965       /lib/libgcc_s.so.1
b6f40000-b6f44000 r-xp 00000000 08:02 13558      /lib/libnss_dns-2.12.1.so
b6f44000-b6f45000 r--p 00004000 08:02 13558      /lib/libnss_dns-2.12.1.so
b6f45000-b6f46000 rw-p 00005000 08:02 13558      /lib/libnss_dns-2.12.1.so
b6f5c000-b6f91000 r--s 00000000 08:02 268774     /var/cache/nscd/services
b6f91000-b6f94000 rw-p 00000000 00:00 0 
b6f94000-b6f97000 r-xp 00000000 08:02 48114      /lib/libgpg-error.so.0.4.0
b6f97000-b6f98000 r--p 00002000 08:02 48114      /lib/libgpg-error.so.0.4.0
b6f98000-b6f99000 rw-p 00003000 08:02 48114      /lib/libgpg-error.so.0.4.0
b6f99000-b700a000 r-xp 00000000 08:02 34594      /lib/libgcrypt.so.11.5.3
b700a000-b700b000 r--p 00070000 08:02 34594      /lib/libgcrypt.so.11.5.3
b700b000-b700d000 rw-p 00071000 08:02 34594      /lib/libgcrypt.so.11.5.3
b700d000-b701c000 r-xp 00000000 08:02 35545      /usr/lib/libtasn1.so.3.1.9
b701c000-b701d000 r--p 0000e000 08:02 35545      /usr/lib/libtasn1.so.3.1.9
b701d000-b701e000 rw-p 0000f000 08:02 35545      /usr/lib/libtasn1.so.3.1.9
b701e000-b7020000 r-xp 00000000 08:02 1502       /lib/libkeyutils.so.1.3
b7020000-b7021000 r--p 00001000 08:02 1502       /lib/libkeyutils.so.1.3
b7021000-b7022000 rw-p 00002000 08:02 1502       /lib/libkeyutils.so.1.3
b7022000-b7024000 r-xp 00000000 08:02 10528      /lib/libdl-2.12.1.so
b7024000-b7025000 r--p 00001000 08:02 10528      /lib/libdl-2.12.1.so
b7025000-b7026000 rw-p 00002000 08:02 10528      /lib/libdl-2.12.1.so
b7026000-b7027000 rw-p 00000000 00:00 0 
b7027000-b702d000 r-xp 00000000 08:02 22331      /usr/lib/libkrb5support.so.0.1
b702d000-b702e000 r--p 00005000 08:02 22331      /usr/lib/libkrb5support.so.0.1
b702e000-b702f000 rw-p 00006000 08:02 22331      /usr/lib/libkrb5support.so.0.1
b702f000-b7031000 r-xp 00000000 08:02 61236      /lib/libcom_err.so.2.1
b7031000-b7032000 r--p 00001000 08:02 61236      /lib/libcom_err.so.2.1
b7032000-b7033000 rw-p 00002000 08:02 61236      /lib/libcom_err.so.2.1
b7033000-b7054000 r-xp 00000000 08:02 62265      /usr/lib/libk5crypto.so.3.1
b7054000-b7055000 ---p 00021000 08:02 62265      /usr/lib/libk5crypto.so.3.1
b7055000-b7056000 r--p 00021000 08:02 62265      /usr/lib/libk5crypto.so.3.1
b7056000-b7057000 rw-p 00022000 08:02 62265      /usr/lib/libk5crypto.so.3.1
b7057000-b7100000 r-xp 00000000 08:02 63139      /usr/lib/libkrb5.so.3.3
b7100000-b7105000 r--p 000a9000 08:02 63139      /usr/lib/libkrb5.so.3.3
b7105000-b7106000 rw-p 000ae000 08:02 63139      /usr/lib/libkrb5.so.3.3
b7106000-b719c000 r-xp 00000000 08:02 35554      /usr/lib/libgnutls.so.26.14.12
b719c000-b71a0000 r--p 00095000 08:02 35554      /usr/lib/libgnutls.so.26.14.12
b71a0000-b71a1000 rw-p 00099000 08:02 35554      /usr/lib/libgnutls.so.26.14.12
b71a1000-b71a2000 rw-p 00000000 00:00 0 
b71a2000-b71b8000 r-xp 00000000 08:02 28383      /usr/lib/libsasl2.so.2.0.23
b71b8000-b71b9000 r--p 00015000 08:02 28383      /usr/lib/libsasl2.so.2.0.23
b71b9000-b71ba000 rw-p 00016000 08:02 28383      /usr/lib/libsasl2.so.2.0.23
b71ba000-b71ca000 r-xp 00000000 08:02 23023      /lib/libresolv-2.12.1.so
b71ca000-b71cb000 r--p 00010000 08:02 23023      /lib/libresolv-2.12.1.so
b71cb000-b71cc000 rw-p 00011000 08:02 23023      /lib/libresolv-2.12.1.so
b71cc000-b71ce000 rw-p 00000000 00:00 0 
b71ce000-b71e1000 r-xp 00000000 08:02 10547      /lib/libnsl-2.12.1.so
b71e1000-b71e2000 r--p 00012000 08:02 10547      /lib/libnsl-2.12.1.so
b71e2000-b71e3000 rw-p 00013000 08:02 10547      /lib/libnsl-2.12.1.so
b71e3000-b71e5000 rw-p 00000000 00:00 0 
b71e5000-b71ee000 r-xp 00000000 08:02 10526      /lib/libcrypt-2.12.1.so
b71ee000-b71ef000 r--p 00008000 08:02 10526      /lib/libcrypt-2.12.1.so
b71ef000-b71f0000 rw-p 00009000 08:02 10526      /lib/libcrypt-2.12.1.so
b71f0000-b7217000 rw-p 00000000 00:00 0 
b7217000-b722c000 r-xp 00000000 08:02 23019      /lib/libpthread-2.12.1.so
b722c000-b722d000 ---p 00015000 08:02 23019      /lib/libpthread-2.12.1.so
b722d000-b722e000 r--p 00015000 08:02 23019      /lib/libpthread-2.12.1.so
b722e000-b722f000 rw-p 00016000 08:02 23019      /lib/libpthread-2.12.1.so
b722f000-b7232000 rw-p 00000000 00:00 0 
b7232000-b7245000 r-xp 00000000 08:02 22188      /lib/libz.so.1.2.3.4
b7245000-b7246000 r--p 00012000 08:02 22188      /lib/libz.so.1.2.3.4
b7246000-b7247000 rw-p 00013000 08:02 22188      /lib/libz.so.1.2.3.4
b7247000-b737c000 r-xp 00000000 08:02 14274      /lib/libcrypto.so.0.9.8
b737c000-b7384000 r--p 00134000 08:02 14274      /lib/libcrypto.so.0.9.8
b7384000-b7393000 rw-p 0013c000 08:02 14274      /lib/libcrypto.so.0.9.8
b7393000-b7396000 rw-p 00000000 00:00 0 
b7396000-b73da000 r-xp 00000000 08:02 14280      /lib/libssl.so.0.9.8
b73da000-b73db000 ---p 00044000 08:02 14280      /lib/libssl.so.0.9.8
b73db000-b73dc000 r--p 00044000 08:02 14280      /lib/libssl.so.0.9.8
b73dc000-b73df000 rw-p 00045000 08:02 14280      /lib/libssl.so.0.9.8
b73df000-b740c000 r-xp 00000000 08:02 63073      /usr/lib/libgssapi_krb5.so.2.2
b740c000-b740d000 r--p 0002c000 08:02 63073      /usr/lib/libgssapi_krb5.so.2.2
b740d000-b740e000 rw-p 0002d000 08:02 63073      /usr/lib/libgssapi_krb5.so.2.2
b740e000-b7415000 r-xp 00000000 08:02 23024      /lib/librt-2.12.1.so
b7415000-b7416000 r--p 00006000 08:02 23024      /lib/librt-2.12.1.so
b7416000-b7417000 rw-p 00007000 08:02 23024      /lib/librt-2.12.1.so
b7417000-b7459000 r-xp 00000000 08:02 11518      /usr/lib/libldap_r-2.4.so.2.5.6
b7459000-b745a000 ---p 00042000 08:02 11518      /usr/lib/libldap_r-2.4.so.2.5.6
b745a000-b745b000 r--p 00042000 08:02 11518      /usr/lib/libldap_r-2.4.so.2.5.6
b745b000-b745c000 rw-p 00043000 08:02 11518      /usr/lib/libldap_r-2.4.so.2.5.6
b745c000-b745e000 rw-p 00000000 00:00 0 
b745e000-b7469000 r-xp 00000000 08:02 11517      /usr/lib/liblber-2.4.so.2.5.6
b7469000-b746a000 r--p 0000a000 08:02 11517      /usr/lib/liblber-2.4.so.2.5.6
b746a000-b746b000 rw-p 0000b000 08:02 11517      /usr/lib/liblber-2.4.so.2.5.6
b746b000-b749b000 r-xp 00000000 08:02 32957      
/usr/lib/libidn.so.11.6.1Aborted

What version of the product are you using? On what operating system?
Latest version of smatool on Ubuntu 10.10

Please provide any additional information below.

Original issue reported on code.google.com by tom.bosm...@gmail.com on 20 Aug 2011 at 7:46

GoogleCodeExporter commented 8 years ago
This is caused by the PVOutput restriction of maximum 1 request per second.

I can't actually see the error since the only error that's reported is "22" (a 
Curl error meaning that there's a +400 http error).  It would be nice to use 
the curl_easy_getinfo functions to return the actual error message ...

Anyway , I've added a few "sleep(5)" statements after every curl connection to 
PVOutput.  This fixes the problem.

Original comment by tom.bosm...@gmail.com on 26 Aug 2011 at 7:59

Attachments:

GoogleCodeExporter commented 8 years ago
I still get this problem with latest sources.
I would like to fix this problem but have no idea what to search first.
Is it a libcurl mis-configuration (too small buffers?) or a problem of 
interface between smatool and pvoutput APIs?

Original comment by louis.cr...@gmail.com on 24 Mar 2012 at 8:46

GoogleCodeExporter commented 8 years ago
I run Ubuntu 11.10, and I own an SMA 2000HF

Original comment by louis.cr...@gmail.com on 24 Mar 2012 at 8:49