Pcsx2: Tales of Legendia / Tales of the Abyss - Segfaults

Created on 21 Nov 2018  路  21Comments  路  Source: PCSX2/pcsx2

PCSX2 version:
https://github.com/PCSX2/pcsx2/commit/3d6921d9ca05ac0b5a637a6c5163110e3133d0a8

PCSX2 options:
Automatic CRC Level: None or Minimum

Plugins used:
GSdx (GCC 8.2.0 SSE2/AVX) 1.1.0 [libGSdx]

The legacy GSdx is unaffected.
GSdx (GCC 8.2.0, SSE2) 1.0.0 [libGSdx-legacy-1.0.0]

Description of the issue:

When playing Tales of Legendia with CRC level none or minimum pcsx2 will segfault consistently in certain parts of the games. For example:

  • When loading a save to the world map.
  • When opening Config > Video (GS) > Plugin Settings... during emulation of a field map.
  • When stopping emulation.
  • When just running the game for some period of time.

With the first method sometimes this assert will be shown before it proceeds to crash.

/tmp/SBo/pcsx2/common/src/Utilities/Linux/LnxHostSys.cpp(70) : assertion failed:
    Function:  void SysPageFaultSignalFilter(int, siginfo_t*, void*)
    Thread:    MTGS
    Condition: false
    Message:   Unhandled page fault @ 0x000000a7

Stacktrace:
[00] wxSizer::Add(wxWindow*, wxSizerFlags const&)
[01] __kernel_rt_sigreturn                       
[02] 0x0xd79ac67d     

I tried to use GDB, but I am having difficulty actually proceeding into the game and then capturing the crash. Please see issue https://github.com/PCSX2/pcsx2/issues/1806 for further discussion.

How to reproduce the issue:

Here are two methods which seem to reproduce it consistently.

  1. Set the Automatic CRC Level to None.
  2. Start Tales of Legendia.
  3. Proceed to a field map such as the start of the game before the first town.
  4. Open Config > Video (GS) > Plugin Settings...
  5. pcsx2 should segfault.

Or

  1. Set the Automatic CRC Level to None.
  2. Start Tales of Legendia.
  3. Load the a save game to the world map.
  4. It should crash shortly after loading and presenting the world map with very wrong colors.

Here is a memory card containing a save file.
http://0x0.st/sU54.xz

Last known version to work:

I bisected this.

$ git bisect bad
42aee34482d9bf251b4a1f296d5341bab57166db is the first bad commit
commit 42aee34482d9bf251b4a1f296d5341bab57166db
Author: iMineLink <[email protected]>
Date:   Tue Nov 13 19:22:13 2018 +0100

    GSdx-TC: Use PaletteMap also when 8-bit texture is disabled by caching only clut copies. (#2681)

    Enabled caching of clut copies with PaletteMap also in the case 8-bit texture is disabled, which is the default (on #2344 the caching of clut copies and palette textures was done only when 8-bit texture was enabled).
    Brings moderate speedups ~10% in the most concitated parts of the ZoE2 Anubis benchmark, but may improve performance in all the cases when there are many Source objects created with clut copies to be stored.
    The quality of the comments has been improved to better highlight the mechanics of the caching system.

:040000 040000 5a852542b45865779aaf07be2158d3a48337b095 4d5780b97ae675680cac629a2a85493cb29027be M  plugins

42aee34482d9bf251b4a1f296d5341bab57166db

PC specifications:
OS: Slackware64-current
Compiler: gcc-8.2.0
mesa: https://github.com/mesa3d/mesa/commit/9367514524f70faad99c721bac92339c8ff8bad9

Texture Cache High Priority GS Regression

Most helpful comment

@AlessandroVetere I tested three games briefly with and without 8 bits textures, Tales of the Abyss and Tales of Legendia no longer crash or have (new) graphical issues with the CRC level at none. I also tested Guilty Gear X2 which was not affected and still seems to work just fine.

It seems like that PR fixes the issues here, thanks!

All 21 comments

@AlessandroVetere and @lightningterror When you have a chance can you please check out this issue?

This commit is also responsible for a regression in the colors of the menu.

1

GSdump - http://0x0.st/sURd.xz

Note that before this the world map was very blurry with the CRC level at None or Minimum, this seems to be a much older issue and can be investigated in another issue, preferably after this one is fixed.

Disabling Allow 8 bits textures helps with the menu, but now it will crash even before briefly rendering the world map.

With pcsx2_GSReplayLoader I can not reproduce the colors in the menu, but with the CRC level set to None and OpenGL (Hardware) I can reproduce a crash as soon as the dump finishes. The Allow 8 bits textures option does not seem to make a difference here.

Thread 1 "pcsx2_GSReplayL" received signal SIGSEGV, Segmentation fault.
0x00000291 in ?? ()
(gdb) bt
#0  0x00000291 in ?? ()
#1  0xf74237b5 in GSDevice::Recycle (this=<optimized out>, t=<optimized out>) at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSFastList.h:169
#2  0xf742df46 in GSTextureCache::Palette::~Palette (this=0x8ecc8ec, __in_chrg=<optimized out>) at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSTextureCache.cpp:2089
#3  0xf742c017 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x8ecc8e0) at /usr/include/c++/8.2.0/ext/atomicity.h:69
#4  std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x9404940, __in_chrg=<optimized out>) at /usr/include/c++/8.2.0/bits/shared_ptr_base.h:706
#5  std::__shared_ptr<GSTextureCache::Palette, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x940493c, __in_chrg=<optimized out>)
    at /usr/include/c++/8.2.0/bits/shared_ptr_base.h:1145
#6  std::shared_ptr<GSTextureCache::Palette>::~shared_ptr (this=0x940493c, __in_chrg=<optimized out>) at /usr/include/c++/8.2.0/bits/shared_ptr.h:103
#7  std::pair<GSTextureCache::PaletteKey const, std::shared_ptr<GSTextureCache::Palette> >::~pair (this=0x9404934, __in_chrg=<optimized out>)
    at /usr/include/c++/8.2.0/bits/stl_pair.h:198
#8  __gnu_cxx::new_allocator<std::__detail::_Hash_node<std::pair<GSTextureCache::PaletteKey const, std::shared_ptr<GSTextureCache::Palette> >, true> >::destroy<std::pair<GSTextureCache::PaletteKey const, std::shared_ptr<GSTextureCache::Palette> > > (this=<optimized out>, __p=0x9404934) at /usr/include/c++/8.2.0/ext/new_allocator.h:140
#9  std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<GSTextureCache::PaletteKey const, std::shared_ptr<GSTextureCache::Palette> >, true> > >::destroy<std::pair<GSTextureCache::PaletteKey const, std::shared_ptr<GSTextureCache::Palette> > > (__a=..., __p=0x9404934) at /usr/include/c++/8.2.0/bits/alloc_traits.h:487
#10 std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<GSTextureCache::PaletteKey const, std::shared_ptr<GSTextureCache::Palette> >, true> > >::_M_deallocate_node (__n=0x9404930, this=<optimized out>) at /usr/include/c++/8.2.0/bits/hashtable_policy.h:2100
#11 0xf7432497 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<GSTextureCache::PaletteKey const, std::shared_ptr<GSTextureCache::Palette> >, true> > >::_M_deallocate_nodes (this=<optimized out>, __n=0x9012970) at /usr/include/c++/8.2.0/bits/hashtable_policy.h:2107
#12 std::_Hashtable<GSTextureCache::PaletteKey, std::pair<GSTextureCache::PaletteKey const, std::shared_ptr<GSTextureCache::Palette> >, std::allocator<std::pair<GSTextureCache::PaletteKey const, std::shared_ptr<GSTextureCache::Palette> > >, std::__detail::_Select1st, GSTextureCache::PaletteKeyEqual, GSTextureCache::PaletteKeyHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::clear (this=this@entry=0x809312c)
    at /usr/include/c++/8.2.0/bits/hashtable.h:2047
#13 0xf742fd09 in std::unordered_map<GSTextureCache::PaletteKey, std::shared_ptr<GSTextureCache::Palette>, GSTextureCache::PaletteKeyHash, GSTextureCache::PaletteKeyEqual, std::allocator<std::pair<GSTextureCache::PaletteKey const, std::shared_ptr<GSTextureCache::Palette> > > >::clear (this=0x809312c) at /usr/include/c++/8.2.0/bits/unordered_map.h:845
#14 GSTextureCache::PaletteMap::Clear (this=0x8093128) at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSTextureCache.cpp:2219
#15 0xf742fe7c in GSTextureCache::RemoveAll (this=<optimized out>) at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSTextureCache.cpp:100
#16 0xf744ce78 in GSRendererHW::ResetDevice (this=0x80a7000) at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/HW/GSRendererHW.cpp:285
#17 0xf73d559f in GSclose () at /tmp/SBo/pcsx2/plugins/GSdx/GS.cpp:194
#18 0xf73d70f1 in GSReplay (lpszCmdLine=<optimized out>, renderer=<optimized out>) at /tmp/SBo/pcsx2/plugins/GSdx/GS.cpp:1622
#19 0x080491bc in main (argc=<optimized out>, argv=<optimized out>) at /tmp/SBo/pcsx2/plugins/GSdx/linux_replay.cpp:97

Full GDB log - https://pastebin.com/q7b3gGtC

So to recap, the regressions/details regarding texture cache are:

  • With 8-bit textures enabled: Wrong colors in the menu (similar to #2706), segfaults (seems to happen when clearing the GSTextureCache on plugin closing, on Palette destruction, when recycling the inner GSTexture, the reported GDB log shows that).
  • Without 8-bit textures enabled: Crashes before rendering world map.

Can you please confirm/integrate my recap and provide a log with GDB of the crash without 8-bit enabled?

Also, please, can you confirm that all those issues were not present in the build before applying any palette mapping logic to the texture cache?
Link to the before palette cache build:
https://buildbot.orphis.net/pcsx2/index.php?m=dl&rev=v1.5.0-dev-2653-g77a924ee7&platform=windows-x86

First palette cache build:
https://buildbot.orphis.net/pcsx2/index.php?m=dl&rev=v1.5.0-dev-2654-g9fa1b290b&platform=windows-x86

Your recap seems accurate, I would add that the menu colors are not reproducible in the GS dump, but the crashes are.

Here is a crash with 8 bit textures off.

Thread 1 "pcsx2_GSReplayL" received signal SIGSEGV, Segmentation fault.
0x00000291 in ?? ()
(gdb) bt
#0  0x00000291 in ?? ()
#1  0xf74237b5 in GSDevice::Recycle (this=<optimized out>, t=<optimized out>)
    at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSFastList.h:169
#2  0xf742ba7e in GSTextureCache::Surface::~Surface (this=this@entry=0x9c6a2a0, 
    __in_chrg=<optimized out>)
    at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSTextureCache.cpp:1546
#3  0xf7432387 in GSTextureCache::Surface::~Surface (this=0x9c6a2a0, 
    __in_chrg=<optimized out>) at /tmp/SBo/pcsx2/plugins/GSdx/./stdafx.h:323
#4  GSTextureCache::Target::~Target (this=0x9c6a2a0, __in_chrg=<optimized out>)
    at /tmp/SBo/pcsx2/plugins/GSdx/./Renderers/Common/GSTextureCache.h:130
#5  GSTextureCache::Target::~Target (this=0x9c6a2a0, __in_chrg=<optimized out>)
    at /tmp/SBo/pcsx2/plugins/GSdx/./Renderers/Common/GSTextureCache.h:130
#6  0xf742fdf4 in GSTextureCache::RemoveAll (this=0x8093280)
    at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSTextureCache.cpp:95
#7  0xf744ce78 in GSRendererHW::ResetDevice (this=0x80a6f80)
    at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/HW/GSRendererHW.cpp:285
#8  0xf73d559f in GSclose () at /tmp/SBo/pcsx2/plugins/GSdx/GS.cpp:194
#9  0xf73d70f1 in GSReplay (lpszCmdLine=<optimized out>, 
    renderer=<optimized out>) at /tmp/SBo/pcsx2/plugins/GSdx/GS.cpp:1622
#10 0x080491bc in main (argc=<optimized out>, argv=<optimized out>)
    at /tmp/SBo/pcsx2/plugins/GSdx/linux_replay.cpp:97

Full GDB log - https://pastebin.com/34yVt4JA

I am sure the first bad commit is 42aee34482d9bf251b4a1f296d5341bab57166db and that the parent commit ef3802b67a84a69a4137722236e37bd40c530677 is unaffected which I tested manually after the bisect.

Can you confirm that the issue is fixed on latest master ?

Yes, the issue seems to have remained unchanged.

What about the colors ?

The same, it still crashes, the world map still renders with incorrect colors for a moment (Hard to capture) and the menu colors are still wrong.

When loading a save to the world map.

Can you upload a blockdump with a savestate just before loading a save to the world map ?

Block dump - http://0x0.st/s04f.xz
Save state - http://0x0.st/s04p.xz

After loading the save with the block dump and the CRC level at none it should reproduce the issue.

The bad commit also affects Tales of the Abyss. Very easy to reproduce. With the CRC level set at automatic,none,minimal, or partial. Start the game and either let the opening menu finish its animation or click continue before it's done.

/tmp/makepkg/pcsx2-git/src/pcsx2/common/src/Utilities/Linux/LnxHostSys.cpp(70) : assertion failed:
    Function:  void SysPageFaultSignalFilter(int, siginfo_t*, void*)
    Thread:    MTGS
    Condition: false
    Message:   Unhandled page fault @ 0x00000004

Stacktrace:
[00] 0x0x56a33c3d                                
[01] __kernel_rt_sigreturn                       
[02] 0x0xef876d45                                
[03] 0x0xef87f855                                
[04] 0x0xef87f89a                                
[05] 0x0xef8826c5                                
[06] 0x0xef8a0241                                
[07] GSvsync                                     
[08] 0x0x56719cc6                                
[09] 0x0x56a4391a                                
[10] 0x0x56a452e3                                
[11] 0x0x56a45864                                
[12] 0x0xf6d22fc2                                
[13] clone

the terminal will say Trace/breakpoint trap (core dumped). Clicking new game closes the emulator with the terminal saying Segmentation fault (core dumped). 8 bit textures on or off doesn't matter. Although with it on the colors do mess up a bit. Green flash on the textures. Heres a dump for this game http://0x0.st/s052.dump . With CRC level set to full or aggressive, the crash doesn't happen and having 8 bit on doesn't cause a green flash

This is on
OS: Arch Linux
Kernel: 4.19.4
CPU: Intel I7-4770R
GPU: Iris Pro 5200
GCC: 8.2.1 20180831
MESA: 19.0.0_devel.105954.199a0353d6

I can also reproduce this with Tales of the Abyss...

I built a debug PCSX2 with the latest commit (https://github.com/PCSX2/pcsx2/commit/31c2d2a654334ac32862584a1d16ee06145212c1) and followed the advice in comment https://github.com/PCSX2/pcsx2/issues/1806#issuecomment-441703475.

With GDB here is the crash for Tales of the Abyss.

With 8 bits textures.

Thread 8 "MTGS" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xedfc8b40 (LWP 10909)]
0xef638155 in GSDevice::AgePool (this=0xe3b00020) at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSDevice.cpp:199
199         delete m_pool.back();
(gdb) bt
#0  0xef638155 in GSDevice::AgePool (this=0xe3b00020) at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSDevice.cpp:199
#1  0xef641246 in GSRenderer::VSync (this=<optimized out>, this@entry=0xe3aecc80, field=<optimized out>, field@entry=0)
    at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSRenderer.cpp:339
#2  0xef66b8dc in GSRendererHW::VSync (this=0xe3aecc80, field=0) at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/HW/GSRendererHW.cpp:272
#3  0xef5def85 in GSvsync (field=0) at /tmp/SBo/pcsx2/plugins/GSdx/GS.cpp:742
#4  0x080a6457 in SysMtgsThread::ExecuteTaskInThread (this=<optimized out>) at /tmp/SBo/pcsx2/pcsx2/MTGS.cpp:448
#5  0x08388eca in Threading::pxThread::_try_virtual_invoke (this=this@entry=0xa674a20 <mtgsThread>, method=<optimized out>) at /tmp/SBo/pcsx2/common/src/Utilities/ThreadTools.cpp:554
#6  0x0838adaa in Threading::pxThread::_internal_execute (this=this@entry=0xa674a20 <mtgsThread>) at /tmp/SBo/pcsx2/common/src/Utilities/ThreadTools.cpp:650
#7  0x0838adef in Threading::pxThread::_internal_callback (itsme=0xa674a20 <mtgsThread>) at /tmp/SBo/pcsx2/common/src/Utilities/ThreadTools.cpp:691
#8  0xf6727467 in start_thread () from /lib/libpthread.so.0
#9  0xf666e986 in clone () from /lib/libc.so.6

Full GDB log - https://pastebin.com/iYQNwmAw

Without 8 bits textures.

Thread 8 "MTGS" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xedfc8b40 (LWP 11326)]
0xef638155 in GSDevice::AgePool (this=0xe3b00020) at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSDevice.cpp:199
199         delete m_pool.back();
(gdb) bt
#0  0xef638155 in GSDevice::AgePool (this=0xe3b00020) at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSDevice.cpp:199
#1  0xef641246 in GSRenderer::VSync (this=<optimized out>, this@entry=0xe3aecc80, field=<optimized out>, field@entry=0)
    at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSRenderer.cpp:339
#2  0xef66b8dc in GSRendererHW::VSync (this=0xe3aecc80, field=0) at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/HW/GSRendererHW.cpp:272
#3  0xef5def85 in GSvsync (field=0) at /tmp/SBo/pcsx2/plugins/GSdx/GS.cpp:742
#4  0x080a6457 in SysMtgsThread::ExecuteTaskInThread (this=<optimized out>) at /tmp/SBo/pcsx2/pcsx2/MTGS.cpp:448
#5  0x08388eca in Threading::pxThread::_try_virtual_invoke (this=this@entry=0xa674a20 <mtgsThread>, method=<optimized out>) at /tmp/SBo/pcsx2/common/src/Utilities/ThreadTools.cpp:554
#6  0x0838adaa in Threading::pxThread::_internal_execute (this=this@entry=0xa674a20 <mtgsThread>) at /tmp/SBo/pcsx2/common/src/Utilities/ThreadTools.cpp:650
#7  0x0838adef in Threading::pxThread::_internal_callback (itsme=0xa674a20 <mtgsThread>) at /tmp/SBo/pcsx2/common/src/Utilities/ThreadTools.cpp:691
#8  0xf676f467 in start_thread () from /lib/libpthread.so.0
#9  0xf66b6986 in clone () from /lib/libc.so.6

Full GDB log - https://pastebin.com/SsY4gS8W

And here is a backtrace of loading the world map in Tales of Legendia.

With 8 bits textures.

Thread 8 "MTGS" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xedfc8b40 (LWP 23274)]
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0xef637b68 in GSDevice::PrintMemoryUsage (this=0xe3d00020) at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSDevice.cpp:160
#2  0xef66b90b in GSRendererHW::VSync (this=0xe3ced9e0, field=8192) at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/HW/GSRendererHW.cpp:277
#3  0xef5def85 in GSvsync (field=8192) at /tmp/SBo/pcsx2/plugins/GSdx/GS.cpp:742
#4  0x080a6457 in SysMtgsThread::ExecuteTaskInThread (this=<optimized out>) at /tmp/SBo/pcsx2/pcsx2/MTGS.cpp:448
#5  0x08388eca in Threading::pxThread::_try_virtual_invoke (this=this@entry=0xa674a20 <mtgsThread>, method=<optimized out>) at /tmp/SBo/pcsx2/common/src/Utilities/ThreadTools.cpp:554
#6  0x0838adaa in Threading::pxThread::_internal_execute (this=this@entry=0xa674a20 <mtgsThread>) at /tmp/SBo/pcsx2/common/src/Utilities/ThreadTools.cpp:650
#7  0x0838adef in Threading::pxThread::_internal_callback (itsme=0xa674a20 <mtgsThread>) at /tmp/SBo/pcsx2/common/src/Utilities/ThreadTools.cpp:691
#8  0xf6707467 in start_thread () from /lib/libpthread.so.0
#9  0xf664e986 in clone () from /lib/libc.so.6

Full GDB log - https://pastebin.com/jKGbFHiM

Without 8 bits textures.

Thread 8 "MTGS" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xedfc8b40 (LWP 23595)]
0x00000071 in ?? ()
(gdb) bt
#0  0x00000071 in ?? ()
#1  0xef6380d5 in GSDevice::Recycle (this=<optimized out>, t=<optimized out>) at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSFastList.h:169
#2  0xef64236f in GSTextureCache::Surface::~Surface (this=this@entry=0xd2d42d80, __in_chrg=<optimized out>) at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSTextureCache.cpp:1543
#3  0xef6423dd in GSTextureCache::Source::~Source (this=0xd2d42d80, __in_chrg=<optimized out>) at /usr/include/c++/8.2.0/ext/atomicity.h:82
#4  0xef642452 in GSTextureCache::Source::~Source (this=0xd2d42d80, __in_chrg=<optimized out>) at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSTextureCache.cpp:1596
#5  0xef646e49 in GSTextureCache::SourceMap::RemoveAt (this=<optimized out>, this@entry=0xe3af3634, s=<optimized out>, s@entry=0xd2d42d80)
    at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSTextureCache.cpp:2042
#6  0xef647015 in GSTextureCache::InvalidateVideoMem (this=0xe3af35f0, off=0xd3a7be00, rect=..., target=target@entry=false)
    at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/Common/GSTextureCache.cpp:708
#7  0xef669cf8 in GSRendererHW::Draw (this=<optimized out>) at /tmp/SBo/pcsx2/plugins/GSdx/Renderers/HW/GSRendererHW.cpp:1072
#8  0xef60d7f2 in GSState::FlushPrim (this=this@entry=0xe3aed9e0) at /tmp/SBo/pcsx2/plugins/GSdx/GSState.cpp:1645
#9  0xef60d988 in GSState::Flush (this=this@entry=0xe3aed9e0) at /tmp/SBo/pcsx2/plugins/GSdx/GSState.cpp:1518
#10 0xef616413 in GSState::GIFRegHandlerCLAMP<0> (this=0xe3aed9e0, r=0xf4305b70) at /usr/lib64/gcc/x86_64-slackware-linux/8.2.0/include/emmintrin.h:726
#11 0xef628ab7 in GSState::Transfer<3> (this=0xe3aed9e0, mem=0xf4305b70 "w?\002", mem@entry=0xf4305730 "\001", size=<optimized out>, size@entry=134)
    at /tmp/SBo/pcsx2/plugins/GSdx/GS.h:1203
#12 0xef5dee74 in GSgifTransfer (mem=0xf4305730 "\001", size=134) at /tmp/SBo/pcsx2/plugins/GSdx/GS.cpp:681
#13 0x080a6136 in SysMtgsThread::ExecuteTaskInThread (this=<optimized out>) at /tmp/SBo/pcsx2/pcsx2/MTGS.cpp:404
#14 0x08388eca in Threading::pxThread::_try_virtual_invoke (this=this@entry=0xa674a20 <mtgsThread>, method=<optimized out>) at /tmp/SBo/pcsx2/common/src/Utilities/ThreadTools.cpp:554
#15 0x0838adaa in Threading::pxThread::_internal_execute (this=this@entry=0xa674a20 <mtgsThread>) at /tmp/SBo/pcsx2/common/src/Utilities/ThreadTools.cpp:650
#16 0x0838adef in Threading::pxThread::_internal_callback (itsme=0xa674a20 <mtgsThread>) at /tmp/SBo/pcsx2/common/src/Utilities/ThreadTools.cpp:691
#17 0xf6757467 in start_thread () from /lib/libpthread.so.0
#18 0xf669e986 in clone () from /lib/libc.so.6

Full GDB log - https://pastebin.com/mmbKVf5e

Removing these two hacks allows Tales of Legendia and Tales of the Abyss to segfault on any CRC level.

diff --git a/plugins/GSdx/Renderers/HW/GSHwHack.cpp b/plugins/GSdx/Renderers/HW/GSHwHack.cpp
index 4a9e7f3ea..30fb2d015 100644
--- a/plugins/GSdx/Renderers/HW/GSHwHack.cpp
+++ b/plugins/GSdx/Renderers/HW/GSHwHack.cpp
@@ -2124,7 +2124,6 @@ void GSState::SetupCrcHack()
        lut[CRC::Spartan] = GSC_Spartan;
        lut[CRC::StarWarsForceUnleashed] = GSC_StarWarsForceUnleashed;
        lut[CRC::SFEX3] = GSC_SFEX3;
-       lut[CRC::TalesOfLegendia] = GSC_TalesOfLegendia;
        lut[CRC::TalesofSymphonia] = GSC_TalesofSymphonia;
        lut[CRC::TimeSplitters2] = GSC_TimeSplitters2;
        lut[CRC::TombRaiderAnniversary] = GSC_TombRaiderAnniversary;
@@ -2225,7 +2224,6 @@ void GSState::SetupCrcHack()
        lut[CRC::StarWarsBattlefront2] = GSC_StarWarsBattlefront2;

        // Dedicated shader for channel effect
-       lut[CRC::TalesOfAbyss] = GSC_TalesOfAbyss;

        // RW frame buffer. UserHacks_AutoFlush allow to emulate it correctly
        lut[CRC::GTASanAndreas] = GSC_GTASanAndreas;

The Tales of Legendia hack hides a top left corner issue in the title screen, I am not sure what the Tales of the Abyss hack does.

For reference here are the current hacks.

Tales of Legendia
https://github.com/PCSX2/pcsx2/blob/31c2d2a654334ac32862584a1d16ee06145212c1/plugins/GSdx/Renderers/HW/GSHwHack.cpp#L706

Tales of the Abyss
https://github.com/PCSX2/pcsx2/blob/31c2d2a654334ac32862584a1d16ee06145212c1/plugins/GSdx/Renderers/HW/GSHwHack.cpp#L1151

@orbea, @almostalive: Can you please validate that the #2731 PR fixes the issues?
On Discord server there were some positive tests about this, but we need to make sure that also on your side everything is good, thanks.

@AlessandroVetere I tested three games briefly with and without 8 bits textures, Tales of the Abyss and Tales of Legendia no longer crash or have (new) graphical issues with the CRC level at none. I also tested Guilty Gear X2 which was not affected and still seems to work just fine.

It seems like that PR fixes the issues here, thanks!

@AlessandroVetere, the patch is working for me as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Javed-Iqbal-1 picture Javed-Iqbal-1  路  5Comments

XXXBold picture XXXBold  路  4Comments

RinMaru picture RinMaru  路  5Comments

Nezarn picture Nezarn  路  6Comments

mirh picture mirh  路  6Comments