nebgor / sma-bluetooth

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

segfault :( #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Compiled smatool fine, ran it vanilla and things worked ok,
tried to run it with a time period and I got this... Guessing my config is 
wrong.

This GDB was configured as "arm-linux-gnueabi"...
(gdb) run
Starting program: /usr/local/src/sma-bluetooth/smatool -v -from 2011-01-06\ 
00:00:00 -to 2011-01-06\ 23:55:00
[Thread debugging using libthread_db enabled]
[New Thread 0x407d9e80 (LWP 2719)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x407d9e80 (LWP 2719)]
0x402b5fe8 in feof () from /lib/libc.so.6
(gdb) backtrace
#0  0x402b5fe8 in feof () from /lib/libc.so.6
#1  0x0000c74c in GetConfig (conf=0xbece4854) at smatool.c:614
#2  0x0000d454 in main (argc=6, argv=0xbece4d14) at smatool.c:822

smatool.conf
--
# Configuration for smatoool bluetooth inverter logger
#
# Not all fields are compulsory
#
# Inverter (compulsory) type 3000TL, 5000TL others not tested
Inverter        3000TL
# Inverter (compulsory bluetooth address) use "hcitool scan" to find
BTAddress       00:80:25:09:E0:06
# Inverter User password (compulsory)
Password        xxxxxxxxxxx
# Config file (optional) defaults to ./smatool.conf
Config
# String file (compulsory) data strings to drive the system
File            sma.in.new
# Location (optional) required to avoid waking up system in the dark. 
# Requires  mysql below.
Latitude
Longitude
# Mysql (optional) required for storing data
MySqlHost       localhost
MySqlDatabase   smatool
MySqlUser
MySqlPwd
# PVOutput.org specific data if you are outputting to PVOutput.org.
PVOutputURL     http://pvoutput.org/service/r1/addstatus.jsp
PVOutputKey     xxxxxxxxxxxxxxxxxxx7bec0db716a9a5333d7ff
PVOutputSid

Original issue reported on code.google.com by b...@ticm.com on 11 Jan 2011 at 9:03

GoogleCodeExporter commented 8 years ago
I should add - I'm using the current smatool.c, not the download.
Also here is a step through gdb...

822         GetConfig( &conf );
(gdb) s
GetConfig (conf=0xbee04854) at smatool.c:610
610         if (strlen(conf->Config) > 0 )
(gdb) s
611             fp=fopen(conf->Config,"r");
(gdb) s
614         while (!feof(fp)){  
(gdb) s

Program received signal SIGSEGV, Segmentation fault.
0x402b5fe8 in feof () from /lib/libc.so.6
(gdb) 

Original comment by b...@ticm.com on 11 Jan 2011 at 9:20

GoogleCodeExporter commented 8 years ago
Ahh if I add -conf ./smatool.conf to the command line it doesn't segfault - 
looks like the conf file is not defaulting to ./smatool.conf

Original comment by b...@ticm.com on 11 Jan 2011 at 9:25

GoogleCodeExporter commented 8 years ago
Thanks I'll have a look

Original comment by stephenb...@gmail.com on 11 Jan 2011 at 11:31

GoogleCodeExporter commented 8 years ago

Original comment by stephenb...@gmail.com on 11 Jan 2011 at 11:39

GoogleCodeExporter commented 8 years ago

Original comment by stephenb...@gmail.com on 12 Jan 2011 at 1:38

GoogleCodeExporter commented 8 years ago

Original comment by stephenb...@gmail.com on 12 Jan 2011 at 1:38

GoogleCodeExporter commented 8 years ago
Fix in hg

Original comment by stephenb...@gmail.com on 12 Jan 2011 at 3:22