gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: smsd segmentation fault!


From: Jan Derfinak
Subject: Re: smsd segmentation fault!
Date: Wed, 30 Mar 2005 11:57:59 +0200 (CEST)

On Mon, 28 Mar 2005, Pawel Kot wrote:

Hi.

> On Mon, 28 Mar 2005, tasos wrote:
> 
> > Program received signal SIGSEGV, Segmentation fault.
> > [Switching to Thread -1220138064 (LWP 3299)]
> > 0xb7d9c290 in strncpy () from /lib/tls/libc.so.6
> > (gdb) bt
> > #0  0xb7d9c290 in strncpy () from /lib/tls/libc.so.6
> > #1  0xb7fe74fe in DB_Look () from
> > /usr/share/smsd/libmysql.so
> 
> Could you please show the contents of the database? Apperently it seems that
> some row has inconsistant values.
> 
> This is either in
>     strncpy (sms.remote.number, row[1], sizeof (sms.remote.number) - 1);
> or
>     strncpy (sms.user_data[0].u.text, row[2], GN_SMS_MAX_LENGTH + 1);
> and I think either row[1] or row[2] is null

Database query is:
SELECT id, number, text, dreport FROM outbox WHERE processed='0';

row[1] is "number"
row[2] is "text"

sms is stack variable defined in "while" loop.

The smsd gets sigseg in "strncpy" function. strncpy tries to access results
from "mysql_fetch_row". With information you give us it looks that row[1] or
row[2] points to address outside of smsd address space.

Without original content of your "outbox" table I cannot debug the bug, you
must do it yourself. Please recompile smsd with debug information (-g switch
for gcc must be turned on), run smsd in gdb with breakpoint just after 
mysql.c:171: while ((row = mysql_fetch_row (res1)))
and before any strncpy function.
Then examine content of row variable.

jan

-- 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]