xyproto / zsnes

A maintained fork of ZSNES, a Super Nintendo emulator. The original project needs patches to build and is not maintained anymore: https://sourceforge.net/projects/zsnes/
https://zsnes.com
GNU General Public License v2.0
131 stars 16 forks source link

buffer overflow when built with D_FORTIFY_SOURCE=2 #5

Closed Proscritt09 closed 2 years ago

Proscritt09 commented 2 years ago

Hi Zsnes team. I'm using Zsnes in EndeavourOS, a Arch Linux based distro. Using Zsnes version 2.0.9-1 runs fine without errors, but after last upgrade (using pacman) to version 2.0.9-2, when I click run or enter in a terminal for any rom (this example using Actraiser 2 rom):

zsnes -s -r 3 ActRaiser\ 2\ \(U\)\ \[\!\].zip

It returns: *** buffer overflow detected ***: terminated Aborted (core dumped)

Any hints to solve this problem? Thanks in advance! My specs: https://clbin.com/Z8XID

xyproto commented 2 years ago

Thanks for reporting. This might be a packaging bug in Arch Linux, and not an issue with Zsnes.

Please add a comment to this bug report https://bugs.archlinux.org/task/75031, describing the steps that Arch Linux packagers can take to reproduce the issue, in order to be able to find a solution.

If you should wish to help out further to get to the bottom of this, then extracting the rom file from ActRaiser\ 2\ \(U\)\ \[\!\].zip and then moving it and renaming it to roms/snes/example.sfc in your home directory, and then running make clean debug in a clone of this zsnes repository would be a help. If you can then make it crash the bt full command will list very useful debug info.

Thanks!

xyproto commented 2 years ago

This is likely to be an old bug that is exposed by compiling with a newer version of gcc.

xyproto commented 2 years ago

What are the steps to reproduce the issue?

Proscritt09 commented 2 years ago

Hello Alexander F. R.

I cant manage to login in Arch Linux bug report, so I'm sending how to reproduce the bug.

The steps to reproduce the bug:

[Using Zsnes Gui in XFCE]: Go to the Games folder, click on the Zsnes icon -> it wont open

OR

In a terminal, try to load a rom using (in this example, I use Actraiser 2 rom): [zipped Rom] $ zsnes -s -r 3 ActRaiser\ 2\ (U)\ [!].zip Or $ zsnes -s -r 3 Unzips/ActRaiser\ 2\ (U)\ [!].smc Zsnes will show the message to both cases:

buffer overflow detected : terminated Aborted (core dumped)

That's all. Zsnes wont start anyway and returns the error message above.

Thanks in advance!


De: Alexander F. Rødseth @.> Enviado: domingo, 12 de junho de 2022 12:11 Para: xyproto/zsnes @.> Cc: Proscritt09 @.>; Author @.> Assunto: Re: [xyproto/zsnes] buffer overflow after "export CXXFLAGS=${CXXFLAGS/-fcf-protection/}" was added to the Arch Linux zsnes package and/or gcc was upgraded (Issue #5)

What are the steps to reproduce the issue?

— Reply to this email directly, view it on GitHubhttps://github.com/xyproto/zsnes/issues/5#issuecomment-1153145383, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZSRXITTV6BYI4R5ZXJ62X3VOXHVXANCNFSM5YPK643A. You are receiving this because you authored the thread.Message ID: @.***>

xyproto commented 2 years ago

Thanks for the info! When building zsnes myself, Act Raiser 2 works fine here, both with the regular and the debug version of zsnes. I believe that this must be a packaging issue in Arch Linux.

(I maintain the zsnes package as well, but I'm not the one that last packaged it, and I currently don't have cryptographic keys to sign packages with, but I will have them not too far into the future).