Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 104533 - bomberclone segfaults with libsdl-1.2.9
Summary: bomberclone segfaults with libsdl-1.2.9
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Games
URL: http://www.devolution.com/pipermail/s...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-01 19:37 UTC by Aaron
Modified: 2006-05-22 05:22 UTC (History)
1 user (show)

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


Attachments
hack (newdiff.patch,28.17 KB, patch)
2005-09-06 18:59 UTC, Aaron
Details | Diff
hack 2 (1.2.9-fix-blit-N.patch,28.17 KB, patch)
2005-09-06 19:41 UTC, Aaron
Details | Diff
ebuild that applies the patch (libsdl-1.2.9-r1.ebuild,4.24 KB, patch)
2005-09-06 19:41 UTC, Aaron
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron 2005-09-01 19:37:24 UTC
bomberclone compiles successfully, but segfaults when trying to run (when 
using libsdl-1.2.9). however it works perfectly fine using libsdl-1.2.8-r1 

Reproducible: Always
Steps to Reproduce:
1.emerge =libsdl-1.2.9 
2.emerge =bomberclone-0.11.6.2 
3.  
  
Actual Results:  
bomberclone segfaults when trying to run using libsdl-1.2.9 

Expected Results:  
run correctly and not segfault. 

Portage 2.0.51.22-r2 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r1, 
2.6.13-gentoo x86_64) 
================================================================= 
System uname: 2.6.13-gentoo x86_64 AMD Athlon(tm) 64 Processor 3500+ 
Gentoo Base System version 1.12.0_pre7 
dev-lang/python:     2.4.1-r1 
sys-apps/sandbox:    1.2.12 
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 
sys-devel/binutils:  2.16.1 
sys-devel/libtool:   1.5.18-r1 
virtual/os-headers:  2.6.11-r2 
ACCEPT_KEYWORDS="amd64 ~amd64" 
AUTOCLEAN="yes" 
CBUILD="x86_64-pc-linux-gnu" 
CFLAGS="-O2 -march=athlon64 -mtune=athlon64 -pipe -fno-ident" 
CHOST="x86_64-pc-linux-gnu" 
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" 
CXXFLAGS="-O2 -march=athlon64 -mtune=athlon64 -pipe -fno-ident 
-fvisibility-inlines-hidden" 
DISTDIR="/usr/portage/distfiles" 
FEATURES="autoconfig distlocks sandbox sfperms strict" 
GENTOO_MIRRORS="http://distro.ibiblio.org/pub/linux/distributions/gentoo 
http://gentoo.osuosl.org http://mirror.usu.edu/mirrors/gentoo/" 
LDFLAGS="-Wl,-O1" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR="/usr/portage" 
PORTDIR_OVERLAY="/usr/local/portage" 
SYNC="rsync://rsync.gentoo.org/gentoo-portage" 
USE="amd64 X a52 aac alsa arts berkdb bzip2 cdr crypt cups dlloader dv dvd 
dvdr encode esd exif ffmpeg gif gnutls gphoto2 hal ieee1394 jpeg kde 
kdeenablefinal mp3 mysql ncurses nvidia ogg oggvorbis opengl pic png qt samba 
sdl spell ssl theora tiff truetype usb vorbis wmf xine xml xml2 xv zlib 
userland_GNU kernel_linux elibc_glibc" 
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LINGUAS, MAKEOPTS
Comment 1 htranou 2005-09-02 02:02:54 UTC
(In reply to comment #0)
> bomberclone compiles successfully, but segfaults when trying to run (when 
> using libsdl-1.2.9). however it works perfectly fine using libsdl-1.2.8-r1 
> 
> Reproducible: Always
> Steps to Reproduce:
> 1.emerge =libsdl-1.2.9 
> 2.emerge =bomberclone-0.11.6.2 
> 3.  
>   
> Actual Results:  
> bomberclone segfaults when trying to run using libsdl-1.2.9 
> 
> Expected Results:  
> run correctly and not segfault. 
> 
> Portage 2.0.51.22-r2 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r1, 
> 2.6.13-gentoo x86_64) 
> ================================================================= 
> System uname: 2.6.13-gentoo x86_64 AMD Athlon(tm) 64 Processor 3500+ 
> Gentoo Base System version 1.12.0_pre7 
> dev-lang/python:     2.4.1-r1 
> sys-apps/sandbox:    1.2.12 
> 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 
> sys-devel/binutils:  2.16.1 
> sys-devel/libtool:   1.5.18-r1 
> virtual/os-headers:  2.6.11-r2 
> ACCEPT_KEYWORDS="amd64 ~amd64" 
> AUTOCLEAN="yes" 
> CBUILD="x86_64-pc-linux-gnu" 
> CFLAGS="-O2 -march=athlon64 -mtune=athlon64 -pipe -fno-ident" 
> CHOST="x86_64-pc-linux-gnu" 
> CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/qmail/control" 
> CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" 
> CXXFLAGS="-O2 -march=athlon64 -mtune=athlon64 -pipe -fno-ident 
> -fvisibility-inlines-hidden" 
> DISTDIR="/usr/portage/distfiles" 
> FEATURES="autoconfig distlocks sandbox sfperms strict" 
> GENTOO_MIRRORS="http://distro.ibiblio.org/pub/linux/distributions/gentoo 
> http://gentoo.osuosl.org http://mirror.usu.edu/mirrors/gentoo/" 
> LDFLAGS="-Wl,-O1" 
> PKGDIR="/usr/portage/packages" 
> PORTAGE_TMPDIR="/var/tmp" 
> PORTDIR="/usr/portage" 
> PORTDIR_OVERLAY="/usr/local/portage" 
> SYNC="rsync://rsync.gentoo.org/gentoo-portage" 
> USE="amd64 X a52 aac alsa arts berkdb bzip2 cdr crypt cups dlloader dv dvd 
> dvdr encode esd exif ffmpeg gif gnutls gphoto2 hal ieee1394 jpeg kde 
> kdeenablefinal mp3 mysql ncurses nvidia ogg oggvorbis opengl pic png qt samba 
> sdl spell ssl theora tiff truetype usb vorbis wmf xine xml xml2 xv zlib 
> userland_GNU kernel_linux elibc_glibc" 
> Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LINGUAS, MAKEOPTS

It seems i have the same problem for scummvm and barrage. I tried recompiling
libsdl, scummvm and its dependencies, with no luck.

I'm not on my linux box, so I can't send the emerge info, but it's very similar
to this one, except that i use less aggressive cflags.

(I have a 2.6.13 kernel too, could it be that? They were released around the
same date)
Comment 2 Aaron 2005-09-06 18:59:57 UTC
Created attachment 67787 [details, diff]
hack

here is a VERY temporary patch. All it does it revert
SDL-1.2.9/src/video/SDL_blit_N.c back to the 1.2.8 version.

works though...
Comment 3 Aaron 2005-09-06 19:41:03 UTC
Created attachment 67789 [details, diff]
hack 2

this patch obsoletes the old one.
Comment 4 Aaron 2005-09-06 19:41:28 UTC
Created attachment 67790 [details, diff]
ebuild that applies the patch
Comment 5 Aaron 2005-09-06 19:48:13 UTC
dont use them. and i would report this bug upstream but i cant find their 
bugzilla 
 
(In reply to comment #4) 
> Created an attachment (id=67790) [edit] 
> ebuild that applies the patch 
>  
 
 
Comment 6 SpanKY gentoo-dev 2005-09-06 21:38:48 UTC
sdl doesnt have a bugzilla, just a dev mailing list

neither bomberclone or barrage segfault, but they produce black screens and go
nowhere ... but i havent tried downgrading to 1.2.8 yet

can you guys test lbreakout2 and see if it works for you ?
Comment 7 SpanKY gentoo-dev 2005-09-29 02:38:04 UTC
seems that the culprit is this change:
http://www.libsdl.org/cgi/cvsweb.cgi/SDL12/src/video/SDL_blit_N.c.diff?r1=1.9&r2=1.10

the last change in the last hunk:
-(table[which].cpu_mmx == SDL_HasMMX())
+(table[which].blit_features & GetBlitFeatures()) == table[which].blit_features)

the bug seems to be that on non-altivec systems, if blit_features is 0, this
statement returns true when it used to return false

(table[which].cpu_mmx == SDL_HasMMX()))
           0          ==        1
(table[which].blit_features & GetBlitFeatures()) == table[which].blit_features)
             (0             &     1)             ==         0

if i change the statement to read:
(table[which].blit_features & GetBlitFeatures())

bomberclone no longer segfaults on my box

can you confirm/fix in upstream CVS Ryan ?
Comment 8 SpanKY gentoo-dev 2005-09-29 04:34:43 UTC
mmm that isnt quite correct, maybe this instead:

(table[which].blit_features & GetBlitFeatures()) == GetBlitFeatures()
Comment 9 bugs 2005-10-18 11:16:33 UTC
Browsing around portage for an AMD64 SDL bug and thought I'd just ask.
Perhaps bugs people haven't actually reproduced on a couple of platforms where
they *are* using AMD64 should be marked as Hardware: AMD64 for the convenience
of those searching?
Just until it is reproduced elsewhere.
Heck, maybe default to a hardware and expand it based on reports.

After all, many bugs in AMD64 are restricted to 32 vs 64 bit arithmetic screwups
on someone's part.
Comment 10 SpanKY gentoo-dev 2005-10-18 20:13:17 UTC
this isnt an amd64-specific bug
Comment 11 bugs 2005-10-20 08:03:41 UTC
Dang. Then it ain't the bug I was trying to track down, either.
RTFS time :(

Sorry for the static.
Comment 12 Aaron 2006-01-04 19:22:11 UTC
sorry for the delay

bomberclone: works
barrage: works
lbreakout2: works

this is with the newest libsdl ebuild.
Comment 13 Chris Gianelloni (RETIRED) gentoo-dev 2006-01-05 06:54:36 UTC
Which ebuild exactly?  Latest x86 stable?  Latest ~x86?  What version specifically?
Comment 14 Aaron 2006-01-05 08:14:19 UTC
again, i'm really sorry. next time i'll put the full version/path and my emerge info.

games-action/bomberclone-0.11.6.2
games-action/barrage-1.0.2
games-arcade/lbreakout2-2.5.2
media-libs/libsdl-1.2.9-r1

!!! Relying on the shell to locate gcc, this may break
!!! DISTCC, installing gcc-config and setting your current gcc
!!! profile will fix this
Portage 2.1_pre3-r1 (default-darwin/macos/10.4, gcc-4.0.1, libsystem-7.1-r0, 8.3.1 i386)
=================================================================
System uname: 8.3.1 i386 i386
macos-20041118
distcc 2.18.3-Apple powerpc-apple-darwin8.0 (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python:     [Not Present]
sys-apps/sandbox:    [Not Present]
sys-devel/autoconf:  [Not Present]
sys-devel/automake:  [Not Present]
sys-devel/binutils:  [Not Present]
sys-devel/libtool:   [Not Present]
virtual/os-headers:  7.1
ACCEPT_KEYWORDS="ppc-macos ~ppc-macos"
AUTOCLEAN="yes"
CBUILD="x86-apple-darwin8"
CFLAGS="-O2 -pipe"
CHOST="x86-apple-darwin8"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig collision-protect distlocks sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="ppc audiofile emboss gif ogg opengl png ppc-macos sdl tiff vorbis zlib elibc_Darwin kernel_Darwin userland_Darwin"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
Comment 15 Chris Gianelloni (RETIRED) gentoo-dev 2006-01-05 10:19:36 UTC
So it now works on both amd64 and macosx with 1.2.9-r1?
Comment 16 Aaron 2006-01-05 10:25:06 UTC
yes.
Comment 17 Chris Gianelloni (RETIRED) gentoo-dev 2006-01-05 10:43:22 UTC
Excellent... thanks for the info
Comment 18 Ryan C. Gordon 2006-01-06 04:51:24 UTC
So, wait, is this working with the patch in Comment #8, or something else? The SDL list is of the belief that that patch works because it disables all the MMX blitters, so it's not really a fix.

--ryan.
Comment 19 Aaron 2006-01-06 08:25:45 UTC
This is working with whichever patch is included in libsdl-1.2.9-r1.
Comment 20 SpanKY gentoo-dev 2006-05-22 05:22:19 UTC
this has been fixed properly in libsdl-1.2.10 so ignore this patch