Giter Site home page Giter Site logo

Comments (8)

heitbaum avatar heitbaum commented on June 26, 2024 1

The issue comes from this atomic member:

std::atomic<double> m_speedFactor;

I think the offset of member m_speedFactor is too off in CGameLoop class because of inherited CThread class and LDRB asm instruction fails. Don't know why iMX6 is not affected. Some different compile options maybe because of armv7a/armv7ve (I see different asm code).

gcc-13, ok
	add	r0, r0, #384
	ldrd	r2, r3, [r0]

gcc-14, not ok
	dmb	ish
	ldrd	r2, r3, [r0, #384]

Looks like this compiles (no run-time tested).

diff --git a/xbmc/cores/RetroPlayer/playback/GameLoop.h b/xbmc/cores/RetroPlayer/playback/GameLoop.h
index 4ed8c87..f4989c7 100644
--- a/xbmc/cores/RetroPlayer/playback/GameLoop.h
+++ b/xbmc/cores/RetroPlayer/playback/GameLoop.h
@@ -33,7 +33,7 @@ public:
   virtual void RewindEvent() = 0;
 };
 
-class CGameLoop : protected CThread
+class CGameLoop : virtual protected CThread
 {
 public:
   CGameLoop(IGameLoopCallback* callback, double fps);

Thanks @vpeter4 for the investigation and tracking it down. It has been identified as a gcc issue https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115153 impacting atomic both in libsanitizer and kodi.

from xbmc.

neo1973 avatar neo1973 commented on June 26, 2024 1

Great to hear that you figured it out πŸ‘ And as the issue is external I'll close the ticket.

from xbmc.

neo1973 avatar neo1973 commented on June 26, 2024

Can you try reverting #20809? And does it work with other versions of GCC or is this a general 32 bit ARM issue?

from xbmc.

heitbaum avatar heitbaum commented on June 26, 2024

Can you try reverting #20809? And does it work with other versions of GCC or is this a general 32 bit ARM issue?

Compile with gcc-13.2 works fine. Also all the LE 64 bit targets are fine. Apart from the required fixes to make gcc-14.1 compile our code base. The only 2 arm32 issues at this time are that libsanitizer doesn’t compile in gcc on the host target (so have this disabled) and that kodi has that linking error. I’ll continue to try and hone in on the issue.

from xbmc.

heitbaum avatar heitbaum commented on June 26, 2024

@neo1973 - that patch does not make a difference either way.

interestingly the build for NXP iMX6 is successful.

here is the successful log at the same place that the Allwinner H3, Rockchip RK3288 and Samsung Exynos fail:

…
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/build/kodi-21.0-Omega/lib/libUPnP/Neptune/Source/Core/NptDataBuffer.cpp:241:44: note: destination object of size 0 allocated by 'operator new []'
  241 |     NPT_Byte* newBuffer = new NPT_Byte[size];
      |                                            ^
In member function '__ct ',
    inlined from '__ct ' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/build/kodi-21.0-Omega/xbmc/interfaces/legacy/Tuple.h:60:64,
    inlined from '__ct ' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/stl_pair.h:882:35,
    inlined from 'construct' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/new_allocator.h:191:4,
    inlined from 'construct' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/alloc_traits.h:534:17,
    inlined from '_M_construct_node' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/stl_tree.h:593:32,
    inlined from '_M_create_node' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/stl_tree.h:610:21,
    inlined from '__ct ' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/stl_tree.h:1633:32,
    inlined from '_M_emplace_hint_unique' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/stl_tree.h:2458:13,
    inlined from 'emplace_hint' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/stl_map.h:640:38,
    inlined from 'emplace' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/stl_map.h:601:22,
    inlined from 'xbmc_XBMCAddon_xbmc_InfoTagVideo_setRatings' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/build/kodi-21.0-Omega/.armv7a-libreelec-linux-gnueabihf/build/swig/AddonModuleXbmc.i.cpp:13432:24:
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/build/kodi-21.0-Omega/xbmc/interfaces/legacy/Tuple.h:42:54: warning: 'MEM[(float &)&value + 4]' may be used uninitialized [-Wmaybe-uninitialized]
   42 |     inline Tuple(const Tuple<T1>& o) : TupleBase(o), v1(o.v1) {}
      |                                                      ^
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/build/kodi-21.0-Omega/.armv7a-libreelec-linux-gnueabihf/build/swig/AddonModuleXbmc.i.cpp: In function 'xbmc_XBMCAddon_xbmc_InfoTagVideo_setRatings':
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/build/kodi-21.0-Omega/.armv7a-libreelec-linux-gnueabihf/build/swig/AddonModuleXbmc.i.cpp:13402:31: note: 'MEM[(float &)&value + 4]' was declared here
13402 |         Tuple< float ,int  >  value;
      |                               ^
In member function '__ct ',
    inlined from '__ct ' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/stl_pair.h:882:35,
    inlined from 'construct' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/new_allocator.h:191:4,
    inlined from 'construct' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/alloc_traits.h:534:17,
    inlined from '_M_construct_node' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/stl_tree.h:593:32,
    inlined from '_M_create_node' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/stl_tree.h:610:21,
    inlined from '__ct ' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/stl_tree.h:1633:32,
    inlined from '_M_emplace_hint_unique' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/stl_tree.h:2458:13,
    inlined from 'emplace_hint' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/stl_map.h:640:38,
    inlined from 'emplace' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/toolchain/armv7a-libreelec-linux-gnueabihf/include/c++/14.1.0/bits/stl_map.h:601:22,
    inlined from 'xbmc_XBMCAddon_xbmc_InfoTagVideo_setRatings' at /var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/build/kodi-21.0-Omega/.armv7a-libreelec-linux-gnueabihf/build/swig/AddonModuleXbmc.i.cpp:13432:24:
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/build/kodi-21.0-Omega/xbmc/interfaces/legacy/Tuple.h:60:57: warning: 'MEM[(int &)&value + 8]' may be used uninitialized [-Wmaybe-uninitialized]
   60 |     inline Tuple(const Tuple<T1,T2>& o) : Tuple<T1>(o), v2(o.v2) {}
      |                                                         ^
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/build/kodi-21.0-Omega/.armv7a-libreelec-linux-gnueabihf/build/swig/AddonModuleXbmc.i.cpp: In function 'xbmc_XBMCAddon_xbmc_InfoTagVideo_setRatings':
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-iMX6.arm-12.0-devel/build/kodi-21.0-Omega/.armv7a-libreelec-linux-gnueabihf/build/swig/AddonModuleXbmc.i.cpp:13402:31: note: 'MEM[(int &)&value + 8]' was declared here
13402 |         Tuple< float ,int  >  value;
      |                               ^

from xbmc.

chewitt avatar chewitt commented on June 26, 2024

@neo1973 LE doesn't build Kodi with internal ffmpeg so that patch won't impact the build process.

from xbmc.

vpeter4 avatar vpeter4 commented on June 26, 2024

The issue comes from this atomic member:

std::atomic<double> m_speedFactor;

I think the offset of member m_speedFactor is too off in CGameLoop class because of inherited CThread class and LDRB asm instruction fails.
Don't know why iMX6 is not affected. Some different compile options maybe because of armv7a/armv7ve (I see different asm code).

gcc-13, ok
	add	r0, r0, #384
	ldrd	r2, r3, [r0]

gcc-14, not ok
	dmb	ish
	ldrd	r2, r3, [r0, #384]

Looks like this compiles (no run-time tested).

diff --git a/xbmc/cores/RetroPlayer/playback/GameLoop.h b/xbmc/cores/RetroPlayer/playback/GameLoop.h
index 4ed8c87..f4989c7 100644
--- a/xbmc/cores/RetroPlayer/playback/GameLoop.h
+++ b/xbmc/cores/RetroPlayer/playback/GameLoop.h
@@ -33,7 +33,7 @@ public:
   virtual void RewindEvent() = 0;
 };
 
-class CGameLoop : protected CThread
+class CGameLoop : virtual protected CThread
 {
 public:
   CGameLoop(IGameLoopCallback* callback, double fps);

from xbmc.

heitbaum avatar heitbaum commented on June 26, 2024

The issue comes from this atomic member:

std::atomic<double> m_speedFactor;

I think the offset of member m_speedFactor is too off in CGameLoop class because of inherited CThread class and LDRB asm instruction fails. Don't know why iMX6 is not affected. Some different compile options maybe because of armv7a/armv7ve (I see different asm code).

gcc-13, ok
	add	r0, r0, #384
	ldrd	r2, r3, [r0]

gcc-14, not ok
	dmb	ish
	ldrd	r2, r3, [r0, #384]

Looks like this compiles (no run-time tested).

diff --git a/xbmc/cores/RetroPlayer/playback/GameLoop.h b/xbmc/cores/RetroPlayer/playback/GameLoop.h
index 4ed8c87..f4989c7 100644
--- a/xbmc/cores/RetroPlayer/playback/GameLoop.h
+++ b/xbmc/cores/RetroPlayer/playback/GameLoop.h
@@ -33,7 +33,7 @@ public:
   virtual void RewindEvent() = 0;
 };
 
-class CGameLoop : protected CThread
+class CGameLoop : virtual protected CThread
 {
 public:
   CGameLoop(IGameLoopCallback* callback, double fps);

I successfully built all arch/device combinations with your patch for kodi:target.

from xbmc.

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.