# wvdial: segmentation fault

## hefest

I have used a wvdial script to connect to the Internet via an UMTS modem.

My setup worked very well for almost 2 years, but since yesterday I can't connect, getting a segmentation fault once I run wvdial. I don't know why.

I use a vodafone UMTS card in an Acer TravelMate 4062 and have no obvious hardware issues. I can tell the card works because I'm sending this message from another laptop.

My software versions are wvdial 1.60 and ppp 2.4.4.

My kernel is 2.6.22-r2 with suspend2 patches, CONFIG_PPP=m, CONFIG_PPP_MULTILINK=y, CONFIG_PPP_FILTER=y, CONFIG_PPP_ASYNC=m, CONFIG_PPP_SYNC_TTY=m, CONFIG_PPP_DEFLATE=m, CONFIG_PPP_BSDCOMP=m, CONFIG_PPP_MPPE=m, CONFIG_PPPOE=m and CONFIG_PPP_OATM=m.

Basically, I see the ttyUSB(0-2) devices, I can connect (via minicom) but I believe either wvdial or pppd are running into a segmentation fault.

Here are the details: ignore them if the above is enough.

$ cat /etc/wvdial.conf

[Dialer Defaults]

Init1 = ATZ

Init2 = AT+CSQ

Init3 = AT_OPSYS=3,2

Init4 = AT+CGDCONT=1,"IP","carnet.vip.hr"

Phone = *99***1# 

Username = my_user_name

Password = my_password

Modem = /dev/ttyUSB0

Baud = 460800

Stupid Mode = 1

$ wvdial

--> WvDial: Internet dialer version 1.60

--> Initializing modem.

--> Sending: ATZ

ATZ

OK

--> Sending: AT+CSQ

AT+CSQ

+CSQ: 0,0

OK

--> Sending: AT_OPSYS=3,2

AT_OPSYS=3,2

OK

--> Sending: AT+CGDCONT=1,"IP","carnet.vip.hr"

AT+CGDCONT=1,"IP","carnet.vip.hr"

OK

--> Modem initialized.

Segmentation fault.

$ grep PPP /usr/src/linux/.config 

CONFIG_PPP=m

CONFIG_PPP_MULTILINK=y

CONFIG_PPP_FILTER=y

CONFIG_PPP_ASYNC=m

CONFIG_PPP_SYNC_TTY=m

CONFIG_PPP_DEFLATE=m

CONFIG_PPP_BSDCOMP=m

CONFIG_PPP_MPPE=m

CONFIG_PPPOE=m

CONFIG_PPPOATM=m

$ lsusb

Bus 001 Device 001: ID 0000:0000  

Bus 005 Device 001: ID 0000:0000  

Bus 004 Device 001: ID 0000:0000  

Bus 003 Device 001: ID 0000:0000  

Bus 002 Device 001: ID 0000:0000

$ lsmod

Module                  Size  Used by

ppp_async               7684  0 

ppp_generic            18836  1 ppp_async

crc_ccitt               1408  1 ppp_async

ehci_hcd               22936  0 

ohci_hcd               15244  0 

option                  6016  0 

usbserial              21992  1 option

cpufreq_powersave       1024  1 

ipv6                  184292  16 

pcmcia                 26408  2 

snd_pcm_oss            30144  0 

snd_mixer_oss          12032  1 snd_pcm_oss

snd_seq_oss            21504  0 

snd_seq_midi_event      3456  1 snd_seq_oss

snd_seq                29040  4 snd_seq_oss,snd_seq_midi_event

snd_seq_device          4620  2 snd_seq_oss,snd_seq

genrtc                  6604  0 

slhc                    4480  1 ppp_generic

acpi_cpufreq            5392  0 

freq_table              1924  1 acpi_cpufreq

processor              17720  1 acpi_cpufreq

nvram                   4872  0 

i915                   18048  3 

drm                    54172  4 i915

8139cp                 15624  0 

intelfb                27348  0 

ipw2200               144528  0 

ieee80211              22856  1 ipw2200

ieee80211_crypt         2432  1 ieee80211

i2c_i801                6288  0 

i2c_algo_bit            4360  1 intelfb

yenta_socket           18588  3 

rsrc_nonstatic          9228  1 yenta_socket

pcmcia_core            23480  3 pcmcia,yenta_socket,rsrc_nonstatic

i2c_core               13328  3 intelfb,i2c_i801,i2c_algo_bit

firmware_class          6272  2 pcmcia,ipw2200

8139too                18320  0 

mii                     3328  2 8139cp,8139too

snd_hda_intel         195568  1 

intel_agp              17300  1 

agpgart                19152  4 drm,intelfb,intel_agp

snd_pcm                41872  2 snd_pcm_oss,snd_hda_intel

snd_timer              14088  2 snd_seq,snd_pcm

snd                    28516  10 snd_pcm_oss,snd_mixer_oss,snd_seq_oss,snd_seq,snd_seq_device,snd_hda_intel,snd_pcm,snd_timer

snd_page_alloc          6280  2 snd_hda_intel,snd_pcm

tg3                    87816  0 

e1000                  93312  0 

nfs                    86336  0 

lockd                  46632  1 nfs

sunrpc                110204  2 nfs,lockd

jfs                   139484  0 

scsi_wait_scan           896  0 

pdc_adma                5892  0 

sata_mv                13196  0 

ata_piix                9988  0 

ahci                   14980  0 

sata_qstor              6276  0 

sata_vsc                5764  0 

sata_uli                4868  0 

sata_sis                6276  0 

sata_sx4                9348  0 

sata_nv                13192  0 

sata_via                7940  0 

sata_svw                5124  0 

sata_sil24              9988  0 

sata_sil                7564  0 

sata_promise            8452  0 

pata_sis                9348  1 sata_sis

libata                 76620  16 pdc_adma,sata_mv,ata_piix,ahci,sata_qstor,sata_vsc,sata_uli,sata_sis,sata_sx4,sata_nv,sata_via,sata_svw,sata_sil24,sata_sil,sata_promise,pata_sis

sl811_hcd               9216  0 

uhci_hcd               17684  0 

$  cat /etc/ppp/peers/wvdial

debug

dump

novj

nobsdcomp

refuse-chap

nodeflate

ipcp-accept-local

ipcp-accept-remote

noipdefault

nopredictor1

novjccomp

refuse-mschap

refuse-mschap-v2

refuse-eap

defaultroute

noauth

$  emerge --info

Portage 2.1.4_rc10 (default-linux/x86/2007.0/desktop, gcc-3.4.6, glibc-2.7-r1, 2.6.22-suspend2-r2 i686)

=================================================================

System uname: 2.6.22-suspend2-r2 i686 Intel(R) Pentium(R) M processor 1.73GHz

Timestamp of tree: Tue, 18 Dec 2007 13:30:01 +0000

app-shells/bash:     3.2_p17-r1

dev-java/java-config: 1.3.7, 2.1.3

dev-lang/python:     2.4.4-r4, 2.5.1-r4

dev-python/pycrypto: 2.0.1-r6

dev-util/confcache:  0.4.2-r1

sys-apps/baselayout: 1.12.10-r5

sys-apps/sandbox:    1.2.18.1-r2

sys-devel/autoconf:  2.13, 2.61-r1

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10

sys-devel/binutils:  2.18-r1

sys-devel/gcc-config: 1.4.0-r4

sys-devel/libtool:   1.5.24

virtual/os-headers:  2.6.23-r2

ACCEPT_KEYWORDS="x86 ~x86"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -mtune=i686 -pipe"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php4/ext-active/ /etc/php/cgi-php4/ext-active/ /etc/php/cli-php4/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"

CXXFLAGS="-O2 -mtune=i686 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="distlocks metadata-transfer parallel-fetch sandbox sfperms unmerge-orphans userfetch"

GENTOO_MIRRORS="http://192.168.0.210/gentoo-portage http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"

LANG="hr_HR"

LC_ALL="hr_HR.utf8"

LINGUAS="hr en de it en_GB en_US"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/portage/local/layman/voip"

SYNC="rsync://192.168.0.210/gentoo-portage"

USE="3dnow X aalib accessibility acl acpi aiglx alsa apache2 avahi bitmap-fonts cairo cdparanoia cdr cli cracklib crypt cups dbus dri dvd dvdr dvdread eds emboss encode esd evo fam ffmpeg firefox font-server freetype gdbm gif glitz gnome gpm gstreamer gtk gtk2 hal iconv imagemagick ipv6 isdnlog java jmx jpeg kde kerberos lm_sensors mad midi mikmod mmx mono mozsvg mp3 mpeg mudflap ncurses nls no-seamonkey nptl nptlonly nsplugin odbc ogg opengl openmp oss pam pcre pda pdf perl png postgres pppd python qt3 qt3support qt4 quicktime rdesktop readline reflection samba sdl session spell spl sse ssl svg symlink tcpd theora tiff truetype truetype-fonts type1-fonts unicode utf8 v4l vcd vhosts vorbis win32codecs wxwindows x86 xine xml xorg xscreensaver xv zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="hr en de it en_GB en_US" USERLAND="GNU" VIDEO_CARDS="i810 vesa fbdev glint"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

$ minicom

ATZ                                                  

OK                                                   

ATZ                                                  

OK

AT+CSQ

+CSQ: 22,0

OK

AT_OPSYS=3,2

OK

AT+CGDCONT=1,"IP","carnet.vip.hr"

OK

ATDT *99***1#

CONNECT 384000

Don't really know how I would run pppd manually, but pppd call wvdial doesn't generate a segmentation fault.

Obviously, hints are very welcome.

----------

## migel

I got the same problem -"wvdial segmentation fault" few days ago. I'm using wvdial to connect via GPRS over Bluetoth.

----------

## Hu

The net-dialup/wvdial package was only bumped to 1.60 in Aug 2007, so you must have originally installed with an older version.  When did you emerge =net-dialup/wvdial-1.60?  Have you changed any other packages recently?

Please read How to get meaningful backtraces in Gentoo and obtain a backtrace from the core dump when wvdial crashes.  That backtrace may let us identify what is causing it to crash, after which a fix can be determined.

----------

## EddieHung

Hi all,

I'm seeing this problem too.

After recompiling wvdial and wvstreams with debug info (no -fomit-frame-pointer, with -ggdb and nostrip), this is the backtrace I got:

```
eddie@eddies-lappy ~ $ gdb --args wvdial --config ~/.wvdial.conf

GNU gdb 6.7.1

Copyright (C) 2007 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.  Type "show copying"

and "show warranty" for details.

This GDB was configured as "i686-pc-linux-gnu"...

Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) r

Starting program: /usr/bin/wvdial --config /home/eddie/.wvdial.conf

--> Ignoring malformed input line: ";Do NOT edit this file by hand!"

--> WvDial: Internet dialer version 1.60

--> Initializing modem.

--> Sending: ATZ

ATZ

OK

--> Sending: AT+CGDCONT=1,"IP","three.co.uk"

AT+CGDCONT=1,"IP","three.co.uk"

OK

--> Modem initialized.

Program received signal SIGSEGV, Segmentation fault.

0xb7baabdf in makecontext () from /lib/libc.so.6

(gdb) bt

#0  0xb7baabdf in makecontext () from /lib/libc.so.6

#1  0xb7d082f7 in WvTaskMan::do_task () at utils/wvtask.cc:513

#2  0xb7d08502 in WvTaskMan::_stackmaster () at utils/wvtask.cc:429

#3  0xb7d085a7 in WvTaskMan::stackmaster () at utils/wvtask.cc:386

#4  0x0806c360 in ?? ()

#5  0xbfce7cf8 in ?? ()

#6  0xb7f946a0 in ?? () from /lib/ld-linux.so.2

#7  0xb7cfb1a7 in WvCont::call (this=0x646e6500) at ./include/wvcont.h:54

Backtrace stopped: previous frame inner to this frame (corrupt stack?)

(gdb)
```

Doesn't seem to be the most useful or meaningful backtrace in the world to me, but hopefully it'll mean something to somebody!

As an alternative solution, there are many guides out there which teach you how to use PPP to initiate the connection, one of which I found was: http://gentoo-wiki.com/HOWTO_Access_the_internet_with_your_cellphone_and_bluetooth_(UMTS/GPRS)

I'm successfully using PPP to connect, so the problem definitely lies with wvdial.

It can be seen segfaulting in /var/log/messages:

```
Dec 22 18:04:32 eddies-lappy NetworkManager: <debug> [1198346672.845787] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_a5c_201e_noserial_if0_bluetooth_hci_bluetooth_hci').

Dec 22 18:04:37 eddies-lappy hcid[3733]: link_key_request (sba=00:0E:9B:DF:1C:8C, dba=00:12:D2:EF:E4:A1)

Dec 22 18:04:38 eddies-lappy wvdial[17236]: segfault at aff20004 eip b7b57bdf esp bf6fdf6c error 6
```

.. even when running by itself, or from being run from inside gnome-ppp.

EDIT: I can also confirm that this did, at one point in the past, work just fine. It may have something to do with the bluez packages being updated.. I'll try and confirm that.

EDIT2: Just re-emerged bluez-libs and bluez-utils v3.22, and still segfaulting. And for the record, I'm using the latest vanilla kernel: 2.6.24-rc6.

Eddie

----------

## hefest

 *EddieHung wrote:*   

> 
> 
> ```
> 
> Program received signal SIGSEGV, Segmentation fault.
> ...

 

I too can connect (using kppp), so it does seem to be a wvdial (or underlying library) issue...from the backtrace, it seems wvstreams (wvtask.cc) or glibc (libc.so.6) related.

Gonna try reemerging glibc and wvstriams and see where that leaves me...

----------

## migel

I also successfully tried using net-dialup/ppp. So the problem lies in wvdial

----------

## hefest

Reemerged wvstreams and glibc, no effect.

----------

## shpokas

 *hefest wrote:*   

> Reemerged wvstreams and glibc, no effect.

 

still no solution?   :Surprised: 

got segfault as well

and there's no wvdial downgrade ... I am confused

----------

## colchaodemola

 *shpokas wrote:*   

>  *hefest wrote:*   Reemerged wvstreams and glibc, no effect. 
> 
> still no solution?  
> 
> got segfault as well
> ...

 

same problem here :/ No news ?

----------

## Lumi

 *colchaodemola wrote:*   

>  *shpokas wrote:*    *hefest wrote:*   Reemerged wvstreams and glibc, no effect. 
> 
> still no solution?  
> 
> got segfault as well
> ...

 

Wvdial segmentation fault is a wvstreams problem, then it build this valgrind support at new glibc and gcc.

For problem solution need cut valgrind support from autotools scripts.

http://www.linux.org.ru/jump-message.jsp?msgid=2656025&cid=2656750 (sorry, on russian language)

little and dirty patch:

$ cat /usr/local/portage/net-libs/wvstreams/files/wvstreams-4.4-gcc4-valgrind-cut.patch 

diff -urN wvstreams-4.4.orig/work/wvstreams-4.4/include/uniconfkey.h wvstreams-4.4/work/wvstreams-4.4/include/uniconfkey.h

--- wvstreams-4.4.orig/work/wvstreams-4.4/include/uniconfkey.h	2007-07-20 01:22:49.000000000 +0400

+++ wvstreams-4.4/work/wvstreams-4.4/include/uniconfkey.h	2008-03-15 16:57:54.822351693 +0300

@@ -7,10 +7,10 @@

 #ifndef __UNICONFKEY_H

 #define __UNICONFKEY_H

+#include <limits.h>

 #include "wvstring.h"

 #include "wvlinklist.h"

-

 // The Python headers try to #define ANY as void.  If we're building Python

 // wrappers, get rid of that.

 #undef ANY

diff -urN wvstreams-4.4.orig/work/wvstreams-4.4/configure.ac wvstreams-4.4/work/wvstreams-4.4/configure.ac

--- wvstreams-4.4.orig/work/wvstreams-4.4/configure.ac	2008-03-15 17:14:33.000000000 +0300

+++ wvstreams-4.4/work/wvstreams-4.4/configure.ac	2008-03-15 17:24:31.883350937 +0300

@@ -482,10 +482,6 @@

     AC_PATH_PROG(MOC, moc, [moc not found], $with_qt/bin)

 fi

-# valgrind

-AC_CHECK_PROG(VALGRIND, valgrind, valgrind)

-AC_CHECK_HEADERS(valgrind/memcheck.h)

-

 # xplc

 if test "$with_xplc" != "no"; then

 	if pkg-config --modversion xplc-${xplc_version}; then

@@ -531,9 +527,6 @@

     AC_MSG_WARN([XPLC is missing.])

     missing_required="$missing_required XPLC"

 fi

-if test "$VALGRIND" = ""; then

-    AC_MSG_WARN([Valgrind is missing.])

-fi

 if test "$with_openssl" = "no"; then

     AC_MSG_WARN([OpenSSL is missing.])

     missing_required="$missing_required OpenSSL>=0.9.7"

@@ -556,15 +549,6 @@

     fi

 fi

-if test "$VALGRIND" != ""; then

-    VALGRIND="valgrind --tool=memcheck --leak-check=yes --num-callers=10 --suppressions=\$(WVSTREAMS_SRC)/suppressions.wv"

-    if valgrind --help | grep log-file >/dev/null; then

-	VALGRIND="$VALGRIND --log-file=valgrind.log"

-    else

-	VALGRIND="$VALGRIND --logfile=valgrind.log"

-    fi

-fi

-

 AC_SUBST(SO_VERSION)

 AC_SUBST(enable_debug)

diff -urN wvstreams-4.4.orig/work/wvstreams-4.4/include/wvserialize.h wvstreams-4.4/work/wvstreams-4.4/include/wvserialize.h

--- wvstreams-4.4.orig/work/wvstreams-4.4/include/wvserialize.h	2007-07-20 01:22:49.000000000 +0400

+++ wvstreams-4.4/work/wvstreams-4.4/include/wvserialize.h	2008-03-15 17:42:33.559350597 +0300

@@ -348,9 +348,10 @@

  * (zero) character.  Serialized WvStrings are guaranteed not to contain nul

  * except as the last character.

  */

+/*

 template <>

 extern WvString _wv_deserialize<WvString>(WvBuf &buf);

-

+*/

 /** Deserialize a WvBuf. */

 // FIXME: it should be possible to do this without using a class!

-- 

wbr, Mike aka Lumi@L.O.R

----------

