Bug#419367: wammu: segfault on retrieve messages; samsung SGH X160

2007-04-15 Thread Mahesh T. Pai
Package: wammu
Version: 0.19-1
Severity: normal


Sending the log file created in /tmp/ as per the message.

Willing to provide more info, if you tell me how to find it.


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.18-4-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages wammu depends on:
ii  python   2.4.4-2 An interactive high-level object-o
ii  python-central   0.5.12  register and build utility for Pyt
ii  python-gammu 0.19-1  Python module to communicate with 
ii  python-wxgtk2.6  2.6.3.2.1.5 wxWidgets Cross-platform C++ GUI t

Versions of packages wammu recommends:
pn  python-bluez | python-bluetoo  (no description available)
pn  timidity   (no description available)

-- no debconf information
Setting speed to 19200
[Module   - "auto"]
Escaping SMS mode
[ERROR 12: Error during reading device.]
[ERROR 12: Error during reading device.]
[ERROR 12: Error during reading device.]
[ERROR 12: Error during reading device.]
[ERROR 12: Error during reading device.]
[ERROR 12: Error during reading device.]
[ERROR 12: Error during reading device.]
[ERROR 12: Error during reading device.]
[ERROR 12: Error during reading device.]
[ERROR 12: Error during reading device.]
[ERROR 12: Error during reading device.]
[ERROR 12: Error during reading device.]
[ERROR 12: Error during reading device.]
[ERROR 12: Error during reading device.]
[ERROR 12: Error during reading device.]
[ERROR 12: Error during reading device.]
Sending simple AT command to wake up some devices
Setting speed to 19200
[Module   - "auto"]
Escaping SMS mode
Sending simple AT command to wake up some devices
1 "AT"
2 "OK"
Enabling echo
1 "ATE1"
2 "OK"
Enabling CME errors
1 "AT+CMEE=1"
2 "OK"
Getting model
1 "AT+CGMM"
2 "SGH-X160"
3 "OK"
Checking for OBEX support
1 "AT+CPROTT=?"
2 "ERROR"
Enabling echo
1 "AT+CPROT=?"
2 "ERROR"
[Module   - 
"A2D|iPAQ|at|M20|S25|MC35|TC35|C35i|S65|S300|5110|5130|5190|5210|6110|6130|6150|6190|6210|6250|6310|6310i|6510|7110|8210|8250|8290|8310|8390|8850|8855|8890|8910|9110|9210"]
Escaping SMS mode
Sending simple AT command to wake up some devices
1 "AT"
2 "OK"
Enabling echo
1 "ATE1"
2 "OK"
Enabling CME errors
1 "AT+CMEE=1"
2 "OK"
Checking for OBEX support
1 "AT+CPROT=?"
2 "ERROR"
1 "AT+CGMI"
2 "Samsung"
3 "OK"
Manufacturer info received
Samsung
Getting firmware - method 2
1 "AT+CGMR"
2 "X160DDFG1"
3 "OK"
Received firmware version: "X160DDFG1"
[Closing]
[ERROR 14: No response in specified timeout. Probably phone not connected.]
[ERROR 2: Error opening device. Unknown/busy or no permissions.]
[ERROR 2: Error opening device. Unknown/busy or no permissions.]
[ERROR 2: Error opening device. Unknown/busy or no permissions.]
[ERROR 2: Error opening device. Unknown/busy or no permissions.]
[ERROR 2: Error opening device. Unknown/busy or no permissions.]
[ERROR 2: Error opening device. Unknown/busy or no permissions.]
[ERROR 2: Error opening device. Unknown/busy or no permissions.]
Setting speed to 19200
[Module   - "auto"]
Escaping SMS mode
Sending simple AT command to wake up some devices
1 "T"
2 "OK"
1 "AT"
2 "OK"
Enabling echo
1 "ATE1"
2 "OK"
Enabling CME errors
1 "AT+CMEE=1"
2 "OK"
Getting model
1 "AT+CGMM"
2 "SGH-X160"
3 "OK"
Checking for OBEX support
1 "AT+CPROT=?"
2 "ERROR"
[Module   - 
"A2D|iPAQ|at|M20|S25|MC35|TC35|C35i|S65|S300|5110|5130|5190|5210|6110|6130|6150|6190|6210|6250|6310|6310i|6510|7110|8210|8250|8290|8310|8390|8850|8855|8890|8910|9110|9210"]
Escaping SMS mode
Sending simple AT command to wake up some devices
1 "AT"
2 "OK"
Enabling echo
1 "ATE1"
2 "OK"
Enabling CME errors
1 "AT+CMEE=1"
2 "OK"
Checking for OBEX support
1 "AT+CPROT=?"
2 "ERROR"
1 "AT+CGMI"
2 "Samsung"
3 "OK"
Manufacturer info received
Samsung
Getting firmware - method 2
1 "AT+CGMR"
2 "X160DDFG1"
3 "OK"
Received firmware version: "X160DDFG1"
[Closing]
[Gammu- 1.10.0 built 10:15:07 Mar 13 2007 in gcc 4.1]
[Connection   - "at19200"]
[Model type   - ""]
[Device   - "/dev/ttyUSB0"]
[Run on   - Linux, kernel 2.6.18-4-686 (#1 SMP Wed Feb 21 16:06:54 UTC 
2007)]
Setting speed to 19200
[Module   - "auto"]
Escaping SMS mode
SENDING frame type 0x00/length 0x02/2
1B |0D ..  
Sending simple AT command to wake up some devices
SENDING frame type 0x00/length 0x03/3
41A|54T|0D AT. 
[Retrying 1 type 0x00]
SENDING frame type 0x00/length 0x03/3
41A|54T|0D AT. 
1 "AT"
2 "OK"
RECEIVED frame type 0x00/length 0x09/9
41A|54T|0D |0D |0A |4FO|4BK|0D |0A AT...OK..   
Enabling ec

Bug#419367: wammu: segfault on retrieve messages; samsung SGH X160

2007-04-16 Thread Michal Čihař
Hi

On Sun, 15 Apr 2007 16:06:42 +0530
"Mahesh T. Pai" <[EMAIL PROTECTED]> wrote:

> Sending the log file created in /tmp/ as per the message.
> 
> Willing to provide more info, if you tell me how to find it.

Can you please rebuild gammu with attached patch and test, whether it
will work?

-- 
Michal Čihař | http://cihar.com | http://blog.cihar.com
Index: ChangeLog
===
--- ChangeLog	(revision 478)
+++ ChangeLog	(working copy)
@@ -53,6 +53,7 @@
 [-] * Increse limits for SMS backups (this requires dynamic allocation).
 [!] * Development switched to Subversion, see README for details.
 [-] * Detect Motorola Bluetooth port (Daniel Gimpelevich).
+[-] * Fixup AT driver to work with Samsung SGH X160.
 
 20070403 - 1.10.2
 [-] * Fixed crash on LMB export/import (bug #261).
Index: common/phone/at/atgen.c
===
--- common/phone/at/atgen.c	(revision 474)
+++ common/phone/at/atgen.c	(working copy)
@@ -1717,7 +1717,39 @@
 	switch (Priv->ReplyState) {
 	case AT_Reply_OK:
 		smprintf(s, "SMS status received\n");
-		start = strstr(msg.Buffer, "+CPMS: ") + 7;
+		start = strstr(msg.Buffer, "+CPMS: ");
+		/*
+		 * Samsung formats this different way, sample response:
+		 * 1 "AT+CPMS="SM","SM""
+		 * 2 "+CPMS:"SM",3,30,"SM",3,30,"SM",3,30"
+		 * 3 "OK"
+		 */
+		if (start == NULL) {
+			start = strstr(msg.Buffer, "+CPMS:\"") + 6;
+			current+=ATGEN_ExtractOneParameter(start+current, buffer);
+			if (strcmp(buffer, "\"ME\"") == 0) {
+current+=ATGEN_ExtractOneParameter(start+current, buffer);
+SMSStatus->PhoneUsed = atoi(buffer);
+current+=ATGEN_ExtractOneParameter(start+current, buffer);
+SMSStatus->PhoneSize = atoi(buffer);
+smprintf(s, "Used : %i\n",SMSStatus->PhoneUsed);
+smprintf(s, "Size : %i\n",SMSStatus->PhoneSize);
+return ERR_NONE;
+			} else if (strcmp(buffer, "\"SM\"") == 0) {
+current+=ATGEN_ExtractOneParameter(start+current, buffer);
+SMSStatus->SIMUsed = atoi(buffer);
+current+=ATGEN_ExtractOneParameter(start+current, buffer);
+SMSStatus->SIMSize = atoi(buffer);
+smprintf(s, "Used : %i\n",SMSStatus->SIMUsed);
+smprintf(s, "Size : %i\n",SMSStatus->SIMSize);
+return ERR_NONE;
+			} else {
+smprintf(s, "Unknown memory: %s\n", buffer);
+return ERR_UNKNOWNRESPONSE;
+			}
+		}
+		/* Skip +CPMS: */
+		start += 7;
 		if (strstr(msg.Buffer,"ME")!=NULL) {
 			SMSStatus->PhoneUsed 	= atoi(start);
 			current+=ATGEN_ExtractOneParameter(start+current, buffer);
@@ -3991,6 +4023,8 @@
 return ATGEN_HandleCMSError(s);
 	case AT_Reply_CMEError:
 	return ATGEN_HandleCMEError(s);
+	case AT_Reply_Error:
+		return ERR_NOTSUPPORTED;
 default:
 break;
 	}


signature.asc
Description: PGP signature