SMS Server Tools 3
 Menu
Basic information:
Additional information:
Support:
Get SMS Server Tools 3:
Additional Options

 Sponsored links

 Search
Custom Search

 Visitor locations
 
 SMS Server Tools 3 Community
Welcome, Guest. The forum is currently read-only, but will open soon. Sat Dec 21, 2024 13:05
SMSTools3 Community » Help and support Bottom

[fixed in 3.1.15] smsd segfault

Login and Post Reply

Page:  1

Author Post
Member
Registered:
Mar 2011
Location: Russian Federation
A few monthes I get segfault of smsd with fresh package build like this:

Mar 18 16:00:48 localhost kernel: [ 4372.756124] smsd[2204]: segfault at 640774 ip 00007fb76d2d1bcf sp 00007fff73ca70e0 error 4 in libc-2.15.so[7fb76d28a000+197000]

But there is old build about 1 year old which works fine. I think the problem is in new gcc and/or in new glibc. How can I figure out what is the problem ?

Today I tried to rebuild package smstools3 with nostrip and with gdb information compiled in (-g). smsd forks and I cannot see anything :-). I am not familiar with gdb. I tried do things described in https://wiki.archlinux.org/index.php/Debug_-_Getting_Traces#Getting_the_trace


Operating system name and version: Archlinux
Version of smsd: 3.1.14
Smsd installed from: sources (AUR)
Name and model of a modem / phone: Huawei E150 for now
Interface: USB

Member
Registered:
Mar 2011
Location: Russian Federation
Topic owner
Just now I remembered about strace. Here is its output:



It happends when I run sendsms.

My current config is:



smsd compiled with iconv support to translate to UTF-8 on the fly. Exactly the same configuration works on openwrt with this modem. Patches for Makefile was taken from openwrt build discussed earlier on this forum. So again -- most likely this problem is in gcc or/and glibc which are very fresh in archlinux :-).

Member
Registered:
Apr 2011
Location: Kupchino, Russian Federation
At first, as root:

1) echo /tmp/core.%p > /proc/sys/kernel/core_pattern
This is required because smsd changes its working directory to / on start and it won't be able to create core files unless it is run from the user root. The command above asks Linux kernel to create core files in the directory /tmp instead of the current working directory. Note that this parameter is global and will immediately affect all sessions.

Next, as a regular user:

2) Make sure that the maximum size of core files isn't zero using the command ulimit -c. If it is zero, set it to some reasonable value or unlimited with the command ulimit -c unlimited. Note that this parameter is local for current session. So...
3) Run smsd in the same session.
4) Reproduce segmentation fault.
5) Make sure that a core file has been created in /tmp.
6) Run gdb -c <core_file> <smsd_binary>
7) In GDB session, issue the command bt.

After that you should see a stack trace where the topmost function is the one where the segmentation fault happened.

Member
Registered:
Mar 2011
Location: Russian Federation
Topic owner
Here is output of gdb:



But I don't know what it means ...

Member
Registered:
Mar 2012
Location: Russian Federation
I can confirm this. It seems that process_id == -1 at the moment of snprintf call...

Member
Registered:
Apr 2011
Location: Kupchino, Russian Federation
You found a bug. The process_id is a modem index in modem processes and [always hardcoded ;-)] -1 in the main smsd process. Because DEVICE is actually devices[process_id], DEVICE must never be used unconditionally in shared code. Here is a quick patch.



Member
Registered:
Mar 2011
Location: Russian Federation
Topic owner
Thanks for the patch. smsd does not segfault ... but it send one sms twice :). Here is how I did:

1. Stop smsd
2. issue command "sendsms s000105100 q" (check balance on Megafon)
3. Start smsd
4. Receove 2 answers

Log tels:



Next sms is sent once :-). But old smsd does so. There is another bug or my own "feature" :).

Today I'll test smsd better. Thanks.

Member
Registered:
Oct 2012
Location: Italy
I've the same problem as the original post, but thanks to the unterwulf patch everything is now working fine! (no twice sms, both recived and sent). IMHO the patch should be applied asap to the mainstream sources.

Meanwhile I've made a new spec file with the patch included for Fedora 17/18 (I'm using it). I'll try to submit them to the Fedora mantainers.

Many thanks,
Daniele

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Thanks unterwulf and others. The patch is now applied.

Login and Post Reply

Page:  1

SMSTools3 Community » Help and support Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.