Mike Larkin writes:

> On Sun, Dec 04, 2022 at 05:30:47PM -0700, Anthony J. Bentley wrote:
>> Mikolaj Kucharski writes:
>> > I just wanted to see how Nintendo 3DS emulators work on OpenBSD. Never
>> > played with them before.
>> >
>> > $ desmume some-game-decrypted.3ds
>> > mprotect failed: Operation not permitted
>> > Abort trap (core dumped) 
>> >
>> > I tried with few 3DS files and one CIA file, always the same output
>> > like above. Any tips?
>> 
>> desmume is a DS emulator, not a 3DS emulator. It doesn't support 3DS
>> files or CIA files.
>> 
>> (citra is a 3DS emulator and should be able to handle those files.)
>> 
>> That said, desmume shouldn't crash like that. I'll look into it.
>> 
>
> My money's on wxallowed :)
>
> -ml

Here is a diff unbreaking desmume. I am attaching it because it contains
^M being removed from an existing patch.

I came across this same issue with my WIP-port of flycast. It has to be
adapted for immutable userland mappings in 7.2 -current.

Globals are in BSS and are immutable by default. They need to be marked
as mutable in order for mprotect RWX to work.

I took this fix from syzkaller. see:
https://github.com/google/syzkaller/commit/bc009f82ea71c399f19eef28f115ff5cda7be4ba

flycast had to be patched in three places. see:
https://www.namtsui.com/cgi-bin/cvsweb/ports/emulators/flycast/patches/patch-core_hw_aica_dsp_x64_cpp?rev=1.6&content-type=text/x-cvsweb-markup
https://www.namtsui.com/cgi-bin/cvsweb/ports/emulators/flycast/patches/patch-core_hw_arm7_arm7_rec_cpp?rev=1.6&content-type=text/x-cvsweb-markup
https://www.namtsui.com/cgi-bin/cvsweb/ports/emulators/flycast/patches/patch-core_hw_sh4_dyna_driver_cpp?rev=1.6&content-type=text/x-cvsweb-markup

This unbreaks the emulator with my testing of Chrono Trigger.

Feedback and tests are welcome. OK?

Attachment: desmume.diff
Description: desmume.diff

Reply via email to