diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2021-05-11 23:54:44 +0100 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2021-05-11 23:57:23 +0100 |
commit | 8b2eebf5117453efbe1e62e6314ad58614c0d587 (patch) | |
tree | 2cfa9d6a280c1b74bee382136c996d71c104081e /games-emulation/zsnes/files | |
parent | dev-perl/Crypt-Rijndael: Stabilize 1.150.0 sparc, #789516 (diff) | |
download | gentoo-8b2eebf5117453efbe1e62e6314ad58614c0d587.tar.gz gentoo-8b2eebf5117453efbe1e62e6314ad58614c0d587.tar.bz2 gentoo-8b2eebf5117453efbe1e62e6314ad58614c0d587.zip |
games-emulation/zsnes: fix more ao and stack alignment crashes
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'games-emulation/zsnes/files')
-rw-r--r-- | games-emulation/zsnes/files/zsnes-1.51-ao-crash.patch | 30 | ||||
-rw-r--r-- | games-emulation/zsnes/files/zsnes-1.51-stack-align-v3.patch | 40 |
2 files changed, 70 insertions, 0 deletions
diff --git a/games-emulation/zsnes/files/zsnes-1.51-ao-crash.patch b/games-emulation/zsnes/files/zsnes-1.51-ao-crash.patch new file mode 100644 index 000000000000..6ce142d9c27c --- /dev/null +++ b/games-emulation/zsnes/files/zsnes-1.51-ao-crash.patch @@ -0,0 +1,30 @@ +Fix frash in uninitialized driver_format.matrix. + +Thread 1 "zsnes" received signal SIGSEGV, Segmentation fault. +__strlen_sse2_bsf () at ../sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S:50 +50 ../sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S: Нет такого файла или каталога. +(gdb) bt +#0 __strlen_sse2_bsf () at ../sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S:50 +#1 0xf7e3c491 in _sanitize_matrix (maxchannels=2, matrix=0x1c00200 <error: Cannot access memory at address 0x1c00200>, device=device@entry=0x57057100) + at ../../libao-1.2.2/src/audio_out.c:634 +#2 0xf7e3e9bc in _open_device (driver_id=<optimized out>, format=format@entry=0xffffc638, options=options@entry=0x0, file=0x0) at ../../libao-1.2.2/src/audio_out.c:991 +#3 0xf7e3f579 in ao_open_live (driver_id=<optimized out>, format=0xffffc638, options=0x0) at ../../libao-1.2.2/src/audio_out.c:1337 +#4 0x5699fbb5 in SoundInit_ao () at linux/audio.c:197 +#5 InitSound () at linux/audio.c:338 +#6 0x569a2f7f in initwinvideo () at linux/sdllink.c:1080 +#7 0x569a07d3 in initvideo () +#8 0x56ad59bc in regptwa () +#9 0x56a3c490 in SA1tableG () +#10 0xffffc808 in ?? () +#11 0xf78619b5 in __libc_start_main (main=0x1, argc=1450015920, argv=0x0, init=0x566d7ce1 <_start+49>, fini=0x566d7c00 <main>, rtld_fini=0x1, stack_end=0xffffc8c4) at ../csu/libc-start.c:332 +#12 0x569cd000 in ?? () +--- a/linux/audio.c ++++ b/linux/audio.c +@@ -166,6 +166,7 @@ static int SoundInit_ao() + if (driver_id < 0) { driver_id = ao_default_driver_id(); } + + ao_sample_format driver_format; ++ memset(&driver_format, 0, sizeof(driver_format)); + driver_format.bits = 16; + driver_format.channels = StereoSound+1; + driver_format.rate = freqtab[SoundQuality = ((SoundQuality > 6) ? 1 : SoundQuality)]; diff --git a/games-emulation/zsnes/files/zsnes-1.51-stack-align-v3.patch b/games-emulation/zsnes/files/zsnes-1.51-stack-align-v3.patch new file mode 100644 index 000000000000..914c9afc4495 --- /dev/null +++ b/games-emulation/zsnes/files/zsnes-1.51-stack-align-v3.patch @@ -0,0 +1,40 @@ +--- a/linux/sdllink.c ++++ b/linux/sdllink.c +@@ -133,7 +133,7 @@ extern unsigned char romispal; + + /* FUNCTION DECLARATIONS */ + void clearwin (void); +-void drawscreenwin(void); ++void __attribute__((force_align_arg_pointer)) drawscreenwin(void); + void initwinvideo(); + unsigned int sdl_keysym_to_pc_scancode(int); + void ProcessKeyBuf(int); +--- a/ztimec.c ++++ b/ztimec.c +@@ -25,7 +25,7 @@ short SystemTimewHour; + short SystemTimewMinute; + short SystemTimewSecond; + +-void GetLocalTime() ++void __attribute__((force_align_arg_pointer)) GetLocalTime() + { + time_t current; + struct tm *timeptr; +@@ -37,7 +37,7 @@ void GetLocalTime() + SystemTimewSecond = timeptr->tm_sec; + } + +-unsigned int GetTime() ++unsigned __attribute__((force_align_arg_pointer)) int GetTime() + { + unsigned int value; + struct tm *newtime; +@@ -52,7 +52,7 @@ unsigned int GetTime() + return(value); + } + +-unsigned int GetDate() ++unsigned __attribute__((force_align_arg_pointer)) int GetDate() + { + unsigned int value; + struct tm *newtime; |