Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 357133 - app-editors/vim-7.3.102 crashes when executing :python print "hello world"
Summary: app-editors/vim-7.3.102 crashes when executing :python print "hello world"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-02 19:26 UTC by Stribik András
Modified: 2014-01-25 21:01 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stribik András 2011-03-02 19:26:36 UTC
I have python-2.7.1-r1 and python-3.1.3-r1. The bug only happens when I try to print something. For example :python x = 0 works. Even if I compile both python and vim with USE="debug" and launch vim from gdb I don't get a stack trace or a core file. There are no debugging symbols in libpython2.7.so which means I can only see the assembly instructions. If I set a breakpoint to _Py_Print I can stop before the crash.

Reproducible: Always

Steps to Reproduce:
1. emerge vim
2. vim
3. :python print "hello world"

Actual Results:  
Vim crashes with the following message:

*** stack smashing detected ***: vim - terminated
vim: stack smashing attack in function <unknown> - terminated
Report to http://bugs.gentoo.org/

In the syslog I see:

2011-03-02T20:17:28+01:00 user notice ***[]: stack smashing detected ***: vim - terminated
2011-03-02T20:17:28+01:00 user notice vim[]: stack smashing attack in function <unknown> - terminated
2011-03-02T20:17:28+01:00 user notice Report[]: to http://bugs.gentoo.org/


Expected Results:  
It should display "hello world".
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2011-03-03 16:49:52 UTC
Please paste your `emerge --info app-editors/vim' output in a comment.
Comment 2 Stribik András 2011-03-03 21:27:36 UTC
Portage 2.1.9.41 (hardened/linux/amd64, gcc-4.5.2, glibc-2.13-r1, 2.6.37-hardened-r3 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.37-hardened-r3-x86_64-Pentium-R-_Dual-Core_CPU_T4300_@_2.10GHz-with-SuSE-9.0-X86-64
Timestamp of tree: Thu, 03 Mar 2011 01:15:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 3.1.4 [enabled]
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.7.1-r1, 3.1.3-r1
dev-util/ccache:     3.1.4
dev-util/cmake:      2.8.4
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.7.0
sys-apps/sandbox:    2.5
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.21
sys-devel/gcc:       4.5.2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.4-r1
sys-devel/make:      3.82
virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA AdobeFlash-10 AdobeFlash-10.1 dlj-1.1 googleearth Q3AEULA RTCW-ETEULA ut2003"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/openvpn/easy-rsa /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS=""
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs ccache collision-protect distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LC_ALL="hu_HU.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="hu en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/gamerlay /usr/local/portage/layman/games /usr/local/portage"
SYNC="rsync://rsync.cz.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 apm bash-completion berkdb bittorrent bzip2 caps cdda cddb cli cracklib crypt cscope css cxx dbus dri dts dv dvd emovix encode ffmpeg firefox flac ftp gdbm gif gnutls gpm hal hardened iconv ipv6 java java6 javascript jpeg jpeg2k justify kde lame laptop latex lm_sensors mad matroska mjpeg mmap mmx mng modplug modules mp3 mpeg mplayer msn mtp mudflap multilib musepack musicbrainz ncurses nls nptl nptlonly nsplugin offensive ogg opengl openmp pam pcre perl pic png policykit pppd python qt4 quicktime readline samba schroedinger semantic-desktop session sndfile socks5 speex sse sse2 ssl startup-notification svg sysfs tcpd theora threads truetype unicode urandom v4l2 vcd vim-syntax vorbis wifi x264 xattr xcomposite xine xinerama xorg xscreensaver xv xvid zlib zsh-completion" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul 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 cgi cgid 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="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="hu en" NETBEANS_MODULES="apisupport harness ide java nb php websvccommon" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

app-editors/vim-7.3.102 was built with the following:
USE="X acl bash-completion cscope debug gpm (multilib) nls perl python vim-pager -minimal -ruby"
CFLAGS="-O2 -pipe -march=native -fomit-frame-pointer -DDEBUG"
CXXFLAGS="-DDEBUG"
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2011-03-04 16:26:03 UTC
Can't reproduce it, but here goes.
Comment 4 Stribik András 2011-03-04 22:07:51 UTC
(In reply to comment #3)
> Can't reproduce it, but here goes.
> 

I created a small chroot environment in which I can reproduce the crash. You need to bind-mount /dev and mount proc. You can start it with chroot /path/to/vim-7.3.102-crash /usr/bin/vim. It looks ugly for some reason but still crashes when I type :python print.

I uploaded it here: http://www.megaupload.com/?d=5MTV1I7V . I'm really very sorry for the annoying hosting but it's 22MB so I can't post it here. The SHA256 should be 78e4eb888c2b96e439f3d57d7a7b01d854858b7d5e10231114096a7ba5550e68 .

It's understandable if you don't want to run some binary from the internet. In that case I would try to debug it myself but I can't get debugging symbols for libpython2.7.so and it looks really hopeless that way. If you can tell me how to get a stack trace or core dump in cases like this that would also help a lot.
Comment 5 Jim Ramsay (lack) (RETIRED) gentoo-dev 2011-04-25 16:00:33 UTC
A newer version of vim has been released, and some of the patches include fixes for the python support.

Can you please try upgrading to 7.3.162 (just added to the tree today) and see if you still have the same issue?
Comment 6 Stribik András 2011-04-26 05:35:25 UTC
It still happens with 7.3.162.
Comment 7 spacefrogg-gentoo 2011-08-21 15:53:02 UTC
And it still happens with 7.3.189
Comment 8 Tim Harder gentoo-dev 2014-01-25 21:01:04 UTC
Doesn't seem to be an issue anymore in recent versions.