Code Monkey home page Code Monkey logo

Comments (27)

edemirkan avatar edemirkan commented on July 18, 2024 2

Good news on my end too. I was able to do a full 4 laps on Mediterranean track, and no crashes. Thank you so much for your help.

Need For Speed II SE
  Wrapper v1.3.8
  Game    v1.1.4-cpp_r2
  OpenGL  ES 2
arm_release_ver: g13p0-01eac0, rk_so_ver: 3
Joystick "retrogame_joypad" opened at system index: 0 at index: 0 at: /dev/input/event3

I'll continue testing, and update this issue if anything changes. Have a wonderful night!

from nfsiise.

zaps166 avatar zaps166 commented on July 18, 2024 1

Ok, I'll check if I can align floats/doubles, but tomorrow!

from nfsiise.

zaps166 avatar zaps166 commented on July 18, 2024 1

@edemirkan @porschemad911 Could you check align branch? Please do not forget to update git submodule! The version is 1.1.4-cpp_r2.

from nfsiise.

zaps166 avatar zaps166 commented on July 18, 2024 1

The bus error comes from (compile with -O0):

int main()
{
    char data[16] = {}; // address of `data` is dividible at least by `4` on stach (compiler must ensure it)
    auto &f = *(float *)&data[1]; // `f` is a reference, address of `f` is not dividible by `4` which is needed here
    f = 123.0f; // bus error
    return 0;
}

from nfsiise.

zaps166 avatar zaps166 commented on July 18, 2024 1

@porschemad911 Added as Joystick0DPadButtons and Joystick1DPadButtons!

from nfsiise.

zaps166 avatar zaps166 commented on July 18, 2024

Any ideas what might be the issue ? Any suggestions what can I check further?

Could you upload the "release" binary?

from nfsiise.

zaps166 avatar zaps166 commented on July 18, 2024

Ah and second thing, try compile in debug with flags: FLAGS="-Og -g" - if it crashes, upload it, too.

from nfsiise.

edemirkan avatar edemirkan commented on July 18, 2024

Please find release attached

Need For Speed II SE
  Wrapper v1.3.8
  Game    v1.1.4-cpp_r1
  OpenGL  ES 2
arm_release_ver: g13p0-01eac0, rk_so_ver: 3
Joystick "retrogame_joypad" opened at system index: 0 at index: 0 at: /dev/input/event3
Application closed with a signal: 7
/storage/roms/ports/Need For Speed II SE.sh: line 59:  8024 Bus error               $GAMEDIR/nfs2se

nfs2se.zip

I'll check debug now...

from nfsiise.

edemirkan avatar edemirkan commented on July 18, 2024

Debug crashed too with FLAGS="-Og -g" . Please find attached the binary.

Need For Speed II SE
  Wrapper v1.3.8
  Game    v1.1.4-cpp_r1
  OpenGL  ES 2
arm_release_ver: g13p0-01eac0, rk_so_ver: 3
Joystick "retrogame_joypad" opened at system index: 0 at index: 0 at: /dev/input/event3
Application closed with a signal: 7
/storage/roms/ports/Need For Speed II SE.sh: line 59:  9813 Bus error               $GAMEDIR/nfs2se

nfs2se.debug.zip

FLAGS="-O0 -g" is still working, but super slow.

from nfsiise.

zaps166 avatar zaps166 commented on July 18, 2024

Hmm, I used your binary and completed one race on R-Pi 4 without problems. What should I do to reproduce? Any settings, gamepads, wheels?

from nfsiise.

zaps166 avatar zaps166 commented on July 18, 2024

Completed another race with gamepad.

from nfsiise.

zaps166 avatar zaps166 commented on July 18, 2024

Also tried on very old HTC Sensation Android phone - runs stable.

from nfsiise.

zaps166 avatar zaps166 commented on July 18, 2024

If you can crash -Og -g, try running through gdb and check bt and disassemble on crash.

from nfsiise.

edemirkan avatar edemirkan commented on July 18, 2024

I see. I'm running this on a device called RGB30, which is based on a RK3566 SoC and running an OS called JELOS This port is installed through a tool called PortMaster There might all sorts of issues, my cpu/gpu acting weird, or buggy lib32 libs. Thanks for your help on testing this so far, and at least we were able set a baseline with rpi4 and verified this was a problem on my end. I'll try the gdb method you suggested and let you know of my findings.

from nfsiise.

zaps166 avatar zaps166 commented on July 18, 2024

Ok, I see.
Bus error is by misalignment of game data in this wrapper. Float numbers must have address divisible by 4 for ARM's VFP, but here it's not, that's why I copy them to aligned stack and use them there (volatile is doing the job, prevents compiler optimizing this part). But in your case there must be still an unaligned access somewhere. Maybe this CPU is more sensible to this?

from nfsiise.

zaps166 avatar zaps166 commented on July 18, 2024

When do you have crash? Just after loading a race?

from nfsiise.

edemirkan avatar edemirkan commented on July 18, 2024

If I use the binary provided by Portmaster as is, I get a crash during the game, not on startup - after 30-40sec e.g the first downhill in Mediterranean track.
Here's the link to that binary. https://github.com/PortsMaster/PortMaster-New/blob/main/ports/nfs2se/nfs2se/nfs2se
Now I'm not sure how that's compiled, but I know it's using an older version of your code.

If I use the latest from the master and compile myself, as I posted the binaries above - the crash just happens on game startup - just black screen, and then nothing.

Referring to a previous issue I was able to run it, but getting a crash in the game during a race. Again using an older version of your game.

  Wrapper v1.3.0
  Game    v1.1.2-cpp_r5
  OpenGL  ES 2

from nfsiise.

porschemad911 avatar porschemad911 commented on July 18, 2024

I'm not sure if this information is useful, but every bit might help.

@edemirkan is using a Rockchip BSP 4.19 kernel plus Mali GPU drivers and KMS/DRM with their Powkiddy RGB30 on JELOS.

I am using a 6.7 mainline Linux kernel plus Panfrost GPU drivers and Weston / Wayland with my Odroid Go Ultra on JELOS.

Using the same binary (older version plus texturing and GLES2 renderer fix cherry-picked) here: #112 (comment)

I do not have any crashes, runs perfectly, while @edemirkan gets crashes in-race.

from nfsiise.

edemirkan avatar edemirkan commented on July 18, 2024

I'll check your branch shortly. This following was what I got from debug -Og -g you previously asked.

(gdb) file ./nfs2se
Reading symbols from ./nfs2se...
(gdb) run
Starting program: /storage/roms/ports/nfs2se/nfs2se 
warning: Unable to determine the number of hardware watchpoints available.
warning: Unable to determine the number of hardware breakpoints available.
warning: Loadable section "" outside of ELF segments
  in /usr/lib32/libGLESv2.so.2
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Need For Speed II SE
  Wrapper v1.3.8
  Game    v1.1.4-cpp_r1
  OpenGL  ES 2
[New Thread 0xf10441a0 (LWP 10425)]
[New Thread 0xec71b1a0 (LWP 10426)]
[New Thread 0xeb9fd1a0 (LWP 10431)]
arm_release_ver: g13p0-01eac0, rk_so_ver: 3
[New Thread 0xeafff1a0 (LWP 10435)]
[New Thread 0xea7fe1a0 (LWP 10437)]
[New Thread 0xe9ffd1a0 (LWP 10438)]
[New Thread 0xe97fc1a0 (LWP 10439)]
[New Thread 0xe8ffb1a0 (LWP 10440)]
[New Thread 0xe87fa1a0 (LWP 10441)]
[New Thread 0xe7eb11a0 (LWP 10443)]
[New Thread 0xe75271a0 (LWP 10444)]
[New Thread 0xe6c251a0 (LWP 10445)]
[New Thread 0xe63231a0 (LWP 10446)]
Joystick "retrogame_joypad" opened at system index: 0 at index: 0 at: /dev/input/event3

Thread 4 "nfs2se" received signal SIGBUS, Bus error.
[Switching to Thread 0xeb9fd1a0 (LWP 10431)]
Application::get64f<signed char*> (addr=0x7189d6 <_data+16478> "") at Cpp/NFS2SE.cpp:291
291	Cpp/NFS2SE.cpp: No such file or directory.
(gdb) 

from nfsiise.

zaps166 avatar zaps166 commented on July 18, 2024

This following was what I got from -Og -g

Bus error in get64f - hmm. Could you use execute bt and disassemble commands? Just for curiosity (I hope align branch will work...)

Edit: I removed get64f in align branch anyway 😄

from nfsiise.

edemirkan avatar edemirkan commented on July 18, 2024
(gdb) bt
#0  Application::get64f<signed char*> (addr=0x7189d6 <_data+16478> "") at Cpp/NFS2SE.cpp:291
#1  0x006d40a0 in Game::_sub_4BC250 (this=this@entry=0x14951a8) at Cpp/NFS2SE.cpp:241721
#2  0x006be100 in Game::_sub_4B77E0 (this=this@entry=0x14951a8) at Cpp/NFS2SE.cpp:240662
#3  0x00673bf0 in Game::_sub_4A7028 (this=this@entry=0x14951a8) at Cpp/NFS2SE.cpp:228718
#4  0x00673914 in Game::_sub_488928 (this=0x14951a8) at Cpp/NFS2SE.cpp:197744
#5  0x006ee0f0 in Application::call<int> (this=this@entry=0x14951a8, addr=16478) at Cpp/NFS2SE.cpp:360
#6  0x00659f34 in Game::_sub_481590 (this=0x14951a8) at Cpp/NFS2SE.cpp:188494
#7  0x006ed23c in wrap_stdcall4 (game=..., func=0x659af4 <sub_481590(Game*)>, arg0=<optimized out>, arg1=<optimized out>, arg2=0, arg3=0) at Cpp/NFS2SE.cpp:248901
#8  0x006f059c in DispatchMessageA_wrap (this=0x7189d6 <_data+16478>, msg=<optimized out>) at User32.c:357
#9  0x006593a4 in Game::_sub_481080 (this=0x14951a8) at Cpp/NFS2SE.cpp:188402
#10 0x0041cca8 in threadFunction (data=0x1483d90) at Kernel32.c:230
#11 0xf7ee66e4 in ?? () from /usr/lib32/libSDL2-2.0.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) disassemble
Dump of assembler code for function _ZN11Application6get64fIPaEEdT_:
   0x006edf14 <+0>:	sub	sp, sp, #8
=> 0x006edf18 <+4>:	ldrd	r0, [r0]
   0x006edf1c <+8>:	strd	r0, [sp]
   0x006edf20 <+12>:	vldr	d0, [sp]
   0x006edf24 <+16>:	add	sp, sp, #8
   0x006edf28 <+20>:	bx	lr
End of assembler dump.

from nfsiise.

zaps166 avatar zaps166 commented on July 18, 2024

So you have bus error on ldrd when copying from unaligned to aligned place 😅 I didn't expect that. It can be workarounded for sure, but let's try align branch and fix everything there (if it'll still crash somewhere e.g. on loading integers).

Edit: Maybe I shouldn't use union, but use volatile on byte array and copy it byte-by-byte 😄

from nfsiise.

porschemad911 avatar porschemad911 commented on July 18, 2024

Attached binary recompiled from align branch works fine, no crashes for me.

Log:

ogu_panfrost:~/roms/ports/nfs2se # cat ./log.txt 
'/storage/.nfs2se' -> '/roms/ports/nfs2se/conf/.nfs2se'
Need For Speed II SE
  Wrapper v1.3.8
  Game    v1.1.4-cpp_r2
  OpenGL  2
Joystick "GO-Ultra Gamepad" opened at system index: 0 at index: 0 at: /dev/input/event2

nfs2se.zip

@edemirkan how is it for you?

from nfsiise.

zaps166 avatar zaps166 commented on July 18, 2024

@porschemad911 Nice!
@edemirkan If it will crash in FnInl(void) fild(const T &val) function let me know with bt and disassmeble, so I'll do byte-by-byte copy tomorrow!

from nfsiise.

porschemad911 avatar porschemad911 commented on July 18, 2024

@zaps166 As an aside, I notice you've removed the Joystick0Buttons setting in nfs2se.conf. Any particular reason for this? I was using it to disable d-pad buttons, ie 8 - 11 on my device:

Joystick0Buttons=0,1,2,3,4,5,6,7,-1,-1,-1,-1,12,13,14

I then assigned these d-pad buttons to keyboard arrow keys via the gptokeyb keyboard mapper. This just made it easy to navigate menus with the d-pad but use the analogue stick for steering via in-game axis mapping. The stick does work fine for menu navigation, but it's a bit clunky vs the d-pad.

Not a big deal of course, just wondering ... and thank you for all your work!

from nfsiise.

zaps166 avatar zaps166 commented on July 18, 2024

@porschemad911

As an aside, I notice you've removed the Joystick0Buttons setting in nfs2se.conf. Any particular reason for this? I was using it to disable d-pad buttons, ie 8 - 11 on my device:

I removed it when introduced 32 buttons fix (see #104). I thought it's no longer needed to map buttons, because 32 is enough, but I forgot it might be used to disable buttons 😅

I can restore it as Joystick0ButtonsEnabled=1,1,1,1,.... or provide something else like Joystick0DPad=1,4,6,8?


@edemirkan

Good to hear, thanks for testing!

from nfsiise.

porschemad911 avatar porschemad911 commented on July 18, 2024

@zaps166 Something like Joystick0DPad=1,4,6,8 would be perfect. From the name I'm guessing it would be automatically map these buttons to directional inputs in-game?

from nfsiise.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.