When trying to connect to GPRS over bluetooth using wvdial, wvdial segfaults after Init3 = AT+CGDCONT=1,"IP","internet","",0,0 Reproducible with all kernels (2.6.23-gentoo, 2.6.24-vanilla) It works with the same setup in Arch Linux Reproducible: Always Steps to Reproduce: 1. wvdial --conf ~/wvdial.conf GPRS 2. segfault Actual Results: --> WvDial: Internet dialer version 1.60 --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 OK --> Sending: AT+CGDCONT=1,"IP","internet","",0,0 AT+CGDCONT=1,"IP","internet","",0,0 OK --> Modem initialized. Neoprávněný přístup do paměti (SIGSEGV) (Unauthorized access to memory) Expected Results: wvdial connects to GPRS network wvdial.conf : [Modem1] Modem = /dev/rfcomm0 Baud=460800 SetVolume = 0 Dial Command = ATDT Init1 = ATZ Init2 = AT+CGDCONT=1,"IP","internet","",0,0 Init3 = ATM0 ;FlowControl = CRTSCTS ;ISDN=0 Stupid Mode=1 Modem Type = Analog Modem [Dialer GPRS] Username = internet Password = internet Phone=*99# Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Init3 = AT+CGDCONT=1,"IP","internet","",0,0 Inherits = Modem1 emerge --info Portage 2.1.4 (default-linux/x86/2007.0, gcc-4.2.2, glibc-2.7-r1, 2.6.24-rc8 i686) ================================================================= System uname: 2.6.24-rc8 i686 Genuine Intel(R) CPU U2500 @ 1.20GHz Timestamp of tree: Fri, 18 Jan 2008 19:30:08 +0000 ccache version 2.4 [disabled] app-shells/bash: 3.2_p33 dev-java/java-config: 1.3.7, 2.1.3 dev-lang/python: 2.4.4-r5, 2.5.1-r5 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: 2.4-r7 sys-apps/baselayout: 1.12.11.1 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.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-r3 ACCEPT_KEYWORDS="x86 ~x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=pentium-m -pipe -fomit-frame-pointer -mno-tls-direct-seg-refs" 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/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS="-O2 -march=pentium-m -pipe -fomit-frame-pointer -mno-tls-direct-seg-refs" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--with-bdeps=y" FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" LINGUAS="cs en de" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*" PORTAGE_TMPDIR="/home/portage/" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage/local/layman/gnome-experimental /usr/portage/local/layman/jokey" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="7zip X a52 aac aalib accessibility acl acpi additions alsa amr audiofile bash-completion battery berkdb bitmap-fonts bluetooth bonobo bzip2 calendar cddb cdinstall cdparanoia cdr chm clamav cli cpufreq cracklib crypt cups curl dbus dell dga directory dri dvb dvd dvdr dvdread enblend encode exif extras fam fat fax ffmpeg firefox flac foomaticdb fortran ftp gdbm gif gnome gnutls gpgme gphoto2 gpm gtk hal hddtemp iconv icq imagemagick imlib ipw3945 isdnlog jabber java javascript jfs jpeg jpeg2k kqemu libgda libnotify lm_sensors maildir mbox midi mime mmx mmxext mono mp3 mpeg mplayer msn mudflap ncurses nls nocd nptl nptlonly nsplugin ntfs offensive ogg ole opengl openmp pam pcmcia pcre pdf perl plugins pmu png pop ppds pppd python quicktime radio rar rdesktop readline real reflection reiserfs samba sasl scanner sdl session sidebar sift slang smime smtp snmp spell spl sqlite sse sse2 ssl synaptics szip tcpd tetex tiff timidity toolbar truetype truetype-fonts type1-fonts unicode usb v4l v4l2 video vorbis wifi win32codecs x86 xcomposite xfce xfs xorg xrandr xscreensaver xvid 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" CAMERAS="canon adc65 agfa cl20 aox barbie casio clicksmart310 digigr8 digita dimera directory enigma13 fuji gsmart300 hp215 iclick jamcam jd11 kodak konica largan lg_gsm mars minolta mustek panasonic pccam300 pccam600 polaroid ptp2 ricoh samsung sierra sipix smal sonix sonydscf1 sonydscf55 soundvision spca50x sq905 tv0674 stv0680 sx330z template toshiba" ELIBC="glibc" INPUT_DEVICES="synaptics keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="cs en de" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo" Unset: CPPFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS strace wvdial --conf wvdial.conf GPRS (last part) write(3, "AT+CGDCONT=1,\"IP\",\"internet\",\"\","..., 35AT+CGDCONT=1,"IP","internet","",0,0) = 35 write(3, "\n", 1 ) = 1 write(3, "OK", 2OK) = 2 write(3, "\n", 1 ) = 1 gettimeofday({1200690587, 11872}, NULL) = 0 write(3, "--> ", 4--> ) = 4 write(3, "Modem initialized.", 18Modem initialized.) = 18 write(3, "\n", 1 ) = 1 gettimeofday({1200690587, 12195}, NULL) = 0 time(NULL) = 1200690587 select(0, [], [], [], {0, 0}) = 0 (Timeout) gettimeofday({1200690587, 12366}, NULL) = 0 time(NULL) = 1200690587 sigprocmask(SIG_BLOCK, NULL, []) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 sigprocmask(SIG_SETMASK, [], NULL) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 mmap2(0xaff00000, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xaff00000 sigprocmask(SIG_SETMASK, [], NULL) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 sigprocmask(SIG_SETMASK, [], NULL) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 sigprocmask(SIG_SETMASK, [], NULL) = 0 sigprocmask(SIG_BLOCK, NULL, []) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++
Please follow http://www.gentoo.org/doc/en/bugzilla-howto.xml and post here the backtrace.
(gdb) run Starting program: /usr/bin/wvdial --conf /home/kolcon/wvdial.conf GPRS --> WvDial: Internet dialer version 1.60 --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 OK --> Sending: AT+CGDCONT=1,"IP","internet","",0,0 AT+CGDCONT=1,"IP","internet","",0,0 OK --> Modem initialized. Program received signal SIGSEGV, Segmentation fault. 0xb7c2110f in makecontext () from /lib/libc.so.6 (gdb) (gdb) bt #0 0xb7c2110f in makecontext () from /lib/libc.so.6 #1 0xb7d644f3 in WvTaskMan::do_task () from /usr/lib/libwvbase.so.4.4 #2 0x00000001 in ?? () #3 0x0806dc10 in ?? () #4 0xb7d33768 in ?? () from /usr/lib/libwvbase.so.4.4 #5 0xb7da5ff4 in ?? () from /usr/lib/libwvbase.so.4.4 #6 0x00000080 in ?? () #7 0x0806dd94 in ?? () #8 0x0806dc10 in ?? () #9 0xb7ff36a0 in ?? () from /lib/ld-linux.so.2 #10 0xb7d6472e in WvTaskMan::_stackmaster () from /usr/lib/libwvbase.so.4.4 #11 0xb7d647fa in WvTaskMan::stackmaster () from /usr/lib/libwvbase.so.4.4 #12 0xb7d64140 in ?? () from /usr/lib/libwvbase.so.4.4 #13 0x0806dc10 in ?? () #14 0x00000000 in ?? () (gdb)
Build wvstreams with debug USE flag and with FEATURES=nostrip and post the backtrace.
(gdb) bt #0 0xb7b2d10f in makecontext () from /lib/libc.so.6 #1 0xb7c704df in WvTaskMan::do_task () at utils/wvtask.cc:513 #2 0xb7c70708 in WvTaskMan::_stackmaster () at utils/wvtask.cc:429 #3 0xb7c707ca in WvTaskMan::stackmaster () at utils/wvtask.cc:386 #4 0xb7c70120 in ?? () from /usr/lib/libwvbase.so.4.4 #5 0x0806dc10 in ?? () #6 0x00000000 in ?? ()
Should I try something like emerge -e system, emerge -u world etc.?
No. I tried to bump wvstreams version to 4.4.1 but the included gnulib is utterly broken and I didn't had time to fix it.
Thank you for your great efforts. I will wait, though it is currently stopping me completely from using gentoo :((
This is not a bug in wvdial or wvstreams, but a bug in gentoo's glibc package. On archlinux the same bug was reported by one of our users, and after looking at valgrind outputs, we found out that glibc was reading invalid memory in the make/getcontext functions. The cause of this problem is 0060_all_glibc-2.7-i386- makecontext-align-BZ5435.patch. It should be removed, or fixed using an additional patch from upstream CVS. On archlinux we apply the additional patch, which can be found here: http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/base/glibc/fix-makecontext.patch?rev=1.1&content-type=text/vnd.viewcvs-markup
toolchain guys, please, review comment #8.
(In reply to comment #8) > This is not a bug in wvdial or wvstreams, but a bug in gentoo's glibc package. > > On archlinux the same bug was reported by one of our users, and after looking > at valgrind outputs, we found out that glibc was reading invalid memory in the > make/getcontext functions. > > The cause of this problem is 0060_all_glibc-2.7-i386- > makecontext-align-BZ5435.patch. It should be removed, or fixed using an > additional patch from upstream CVS. On archlinux we apply the additional patch, > which can be found here: > http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/base/glibc/fix-makecontext.patch?rev=1.1&content-type=text/vnd.viewcvs-markup > patch not found ? anyway, ive already tried another patch but not working et all, somebody with working help ?
correct link: http://repos.archlinux.org/viewvc.cgi/glibc/trunk/fix-makecontext.patch?revision=1 but doesn't solve for me (glibc 2.7 on x86)
Manually applying the changes from the patch to sysdeps/unix/sysv/linux/i386/makecontext.S solved the problem at least here. glibc-2.7-r2 on x86
Reassigned to toolchain team.
is it already in glibc patchset, right now ?
Updated to sys-libs/glibc-2.8_p20080602 today. Problem doesn't occur anymore with this glibc version.
Fixed in the newer versions of glibc, thanks for reporting.