Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 138843 - libsdl + xorg-x11-7.0 trash the stack
Summary: libsdl + xorg-x11-7.0 trash the stack
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-02 05:54 UTC by crusaderky
Modified: 2006-07-02 16:36 UTC (History)
1 user (show)

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 crusaderky 2006-07-02 05:54:28 UTC
everything worked fine until yesteday, when I updated xorg-x11 from 6.8.2-r1 to 7.0-r1.

One of the SDL apps I wrote suddendly stopped working. The app begins as the following:

int main(int argc, char ** argv)
{
    fprintf(stderr, "SDL_Init()\n");
    if( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
        fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
        exit(1);
    }
    fprintf(stderr, "SDL initialized\n");
    ....

So I debugged it and found out that ***I never reach the last fprintf*** and a completely unrelated function of my program is called instead.

I recompiled X and SDL with debugging symbols:
CFLAGS="-g" FEATURES="nostrip" USE="debug" emerge -1 libsdl xorg-server

then I debugged my application and obtained the following bt:

#6  0x0804a46b in poll () at poll.c:227
#7  0xb7c8af22 in _XEnq () from /usr/lib/libX11.so.6
#8  0x00000000 in ?? ()

where poll() is the unrelated function from my app.

I'm using libsdl-1.2.11 but it happens with 1.2.8-r1, too.


$ emerge --info
Portage 2.1-r1 (default-linux/x86/2006.0, gcc-3.4.6, glibc-2.3.6-r4, 2.6.16-gentoo-r9 i686)
=================================================================
System uname: 2.6.16-gentoo-r9 i686 AMD Athlon(TM) XP 2000+
Gentoo Base System version 1.6.15
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -pipe -march=athlon-xp -fforce-addr -fomit-frame-pointer -falign-functions=4 -mfpmath=sse"
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/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-Os -pipe -march=athlon-xp -fforce-addr -fomit-frame-pointer -falign-functions=4 -mfpmath=sse"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig digest distcc distlocks metadata-transfer parallel-fetch sandbox sfperms strict userfetch"
GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://194.117.143.70 http://pandemonium.tiscali.de/pub/gentoo/ ftp://194.117.143.72/mirrors/gentoo"
LC_ALL="it_IT.UTF-8"
LINGUAS="it"
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'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 3dnow X X509 a52 aac alsa apache2 audiofile avi berkdb bitmap-fonts bzip2 cdparanoia cdr chroot cjk cli crypt cscope cups curl dbus dga dlloader dri dts dvb dvd dvdr dvdread emboss encode erandom exif fam fbcon ffmpeg firefox flac flash foomaticdb fortran freetype gd gdbm ggi gif ginac glut gnutls gpm gtk gtk2 gtkhtml guile hal idn imagemagick imap imlib innodb ipv6 isdnlog java javascript jikes jpeg kerberos krb4 lcms ldap libcaca libg++ libwww live lzo mad matroska mcal md5sum memlimit mikmod mmx mmxext mng motif mozsvg mp3 mpeg mpi musepack mysql ncurses network nls nptl nsplugin nvidia odbc offensive ogg opengl pam parse-clocks pcre pdf pdflib perl pic plotutils png ppds pppd prelude python qhull qt qt3 qt4 quicktime readline real reflection rtc samba scanner sdl session skey slp sndfile snmp socks5 speex spell spl sqlite sse ssl svg tcltk tcpd theora threads tiff truetype truetype-fonts type1-fonts udev unicode usb v4l v4l2 vcd vorbis win32codecs wmf wxwindows xml xml2 xorg xosd xprint xv xvid xvmc yaz zlib elibc_glibc input_devices_keyboard input_devices_mouse input_devices_wacom input_devices_evdev kernel_linux linguas_it userland_GNU video_cards_nvidia video_cards_vesa"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-07-02 05:57:32 UTC
Reopen once you've attached a code sample to reproduce the bug.
Comment 2 Harald van Dijk (RETIRED) gentoo-dev 2006-07-02 06:28:56 UTC
Actually, it sounds like this is not a bug at all. Redefining library functions (poll() being one example) in your app makes the original function inaccessible. This is by design. And X and SDL are allowed to assume the standard library is usable. If you break that assumption, you get to clean up the mess.
Comment 3 crusaderky 2006-07-02 16:36:03 UTC
ouch. you're right.
I didn't even think that it could be the name of a library function.
Comment 4 crusaderky 2006-07-02 16:36:24 UTC
closed