NFSIISE: Bus error with release version

Hi, Following up your advice here I compiled using latest code from master for my arm32v7 platform but getting the following error on startup;

Need For Speed II SE
  Wrapper v1.3.7
  Game    v1.1.4-cpp_r1
  OpenGL  ES 2
Application closed with a signal: 7
/storage/roms/ports/Need For Speed II SE.sh: line 59: 10846 Bus error               $GAMEDIR/nfs2se

Debug does not crash, runs - I haven’t played much but looks stable, however super slow…

Need For Speed II SE
  Wrapper v1.3.7
  Game    v1.1.4-cpp_r1
  OpenGL  ES 2
arm_release_ver: g13p0-01eac0, rk_so_ver: 3

The only difference I see between release and debug is optimization flags and binary stripping.

	if [[ $BUILD_TYPE == "debug" ]]; then
		FLAGS="-O0 -g"
		CPP_LTO=""
		echo "Debug"
	else
		FLAGS="-O3 -DNDEBUG"
		echo "Release"

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

More info on my build environment;

[root@fe6716181bd6 workspace]# clang -v
clang version 16.0.6
Target: armv7l-unknown-linux-gnueabihf
Thread model: posix
InstalledDir: /usr/sbin
Found candidate GCC installation: /usr/sbin/../lib/gcc/armv7l-unknown-linux-gnueabihf/12.1.0
Selected GCC installation: /usr/sbin/../lib/gcc/armv7l-unknown-linux-gnueabihf/12.1.0
Candidate multilib: .;@m32
Selected multilib: .;@m32
[root@fe6716181bd6 workspace]# ld.lld -v
LLD 16.0.6 (compatible with GNU linkers)

I also attached a readelf dump of the release binary I compiled.

readelf.txt

About this issue

  • Original URL
  • State: closed
  • Created 4 months ago
  • Comments: 27 (16 by maintainers)

Commits related to this issue

Most upvoted comments

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!

@porschemad911 Added as Joystick0DPadButtons and Joystick1DPadButtons!

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;
}

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

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