Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Galaxy s7 edge crash
03-22-2016, 11:45 PM (This post was last modified: 03-22-2016 11:47 PM by [Unknown].)
Post: #25
RE: Galaxy s7 edge crash
(03-22-2016 07:49 PM)cha0tic Wrote:  If you can give me some steps I'll be glad to do it. I'm a tech savvy person currently majoring in computer science.

Awesome. So first, you'll need to get going with an Android build setup.

If you're on Linux, make sure you have ant and java and stuff installed. If you're on Windows, you can install WinAnt ( https://code.google.com/archive/p/winant/ ).

Then get the Android SDK, and install it:
https://developer.android.com/sdk/index.html (you can use the "Other options" if you want too.)

And also the NDK:
http://developer.android.com/ndk/downloads/index.html

On Windows, you can also just get e.g. NVPACK, which basically has everything you'll need:
https://developer.nvidia.com/codeworks-android

Once you've got that installed, the next step is to grab PPSSPP. If you don't have it already, you also need Git.
https://git-scm.com/downloads

Then run in a terminal / command prompt:

git clone --recursive https://github.com/hrydgard/ppsspp.git
cd ppsspp/android

If on Windows, use (insert your NDK path):
set NDK=C:\AndroidNDK

On Linux/Mac:
export NDK=/path/to/ndk

Now just type:

ant debug

This will make it compile. It could take 20 minutes, but once it's done, you can run this to install it on your device (make sure it's plugged in, and you've activated debugging by tapping the build identifier 7 times in Android settings):

adb install -r bin/PPSSPP-debug.apk

---

Once you've done all of the above, and you've made sure you can compile and run the app... it's time to actually make changes.

Edit ppsspp/Common/Arm64Emitter.cpp, and look for this:
Code:
void ARM64XEmitter::FlushIcacheSection(u8* start, u8* end)
{
#if defined(IOS)
    // Header file says this is equivalent to: sys_icache_invalidate(start, end - start);
    sys_cache_control(kCacheFunctionPrepareForExecution, start, end - start);
#else
#if defined(__clang__) && !defined(_M_IX86) && !defined(_M_X64)
    __clear_cache(start, end);
#else
#if !defined(_M_IX86) && !defined(_M_X64)
    __builtin___clear_cache(start, end);
#endif
#endif
#endif
}

This is the part that does cache invalidation. Just in case it is not invalidating incorrectly, what I want to try is increasing the size of the invalidation. There's some suspicion that the OS is calculating the wrong instruction cache line size.

So replace the above with this:
Code:
void ARM64XEmitter::FlushIcacheSection(u8* start, u8* end)
{
    start = m_startcode + 4096 < start ? start - 4096 : m_startcode;
    end += 4096;
#if defined(IOS)
    // Header file says this is equivalent to: sys_icache_invalidate(start, end - start);
    sys_cache_control(kCacheFunctionPrepareForExecution, start, end - start);
#else
#if defined(__clang__) && !defined(_M_IX86) && !defined(_M_X64)
    __clear_cache(start, end);
#else
#if !defined(_M_IX86) && !defined(_M_X64)
    __builtin___clear_cache(start, end);
#endif
#endif
#endif
}

If that doesn't work, which it may not, we can try this one instead:
Code:
void ARM64XEmitter::FlushIcacheSection(u8* realStart, u8* realEnd)
{
    for (u8 *start = realStart; start < realEnd; start += 64)
    {
        u8 *end = start + 64;

#if defined(IOS)
    // Header file says this is equivalent to: sys_icache_invalidate(start, end - start);
    sys_cache_control(kCacheFunctionPrepareForExecution, start, end - start);
#else
#if defined(__clang__) && !defined(_M_IX86) && !defined(_M_X64)
    __clear_cache(start, end);
#else
#if !defined(_M_IX86) && !defined(_M_X64)
    __builtin___clear_cache(start, end);
#endif
#endif
#endif
    }
}

Another thing we can try, although it's silly, it could work - flushing twice:
Code:
void ARM64XEmitter::FlushIcacheSection(u8* realStart, u8* realEnd)
{
#if defined(IOS)
    // Header file says this is equivalent to: sys_icache_invalidate(start, end - start);
    sys_cache_control(kCacheFunctionPrepareForExecution, start, end - start);
    sys_cache_control(kCacheFunctionPrepareForExecution, start, end - start);
#else
#if defined(__clang__) && !defined(_M_IX86) && !defined(_M_X64)
    __clear_cache(start, end);
    __clear_cache(start, end);
#else
#if !defined(_M_IX86) && !defined(_M_X64)
    __builtin___clear_cache(start, end);
    __builtin___clear_cache(start, end);
#endif
#endif
#endif
}

If all else fails, we can try flushing *everything*, to try to confirm if it really is this or not (this could be not great for performance...):
Code:
void ARM64XEmitter::FlushIcacheSection(u8* realStart, u8* realEnd)
{
#if defined(IOS)
    // Header file says this is equivalent to: sys_icache_invalidate(start, end - start);
    sys_cache_control(kCacheFunctionPrepareForExecution, m_startcode, end - m_startcode);
#else
#if defined(__clang__) && !defined(_M_IX86) && !defined(_M_X64)
    __clear_cache(m_startcode, end);
#else
#if !defined(_M_IX86) && !defined(_M_X64)
    __builtin___clear_cache(m_startcode, end);
#endif
#endif
#endif
}

After making each change, you can run "ant debug" to compile again, and the "adb install -r bin/PPSSPP-debug.apk" command again to reinstall on your device. It will be much quicker to compile the second time, since it only recompiles things you changed.

If none of those things help, it probably isn't actually icache related. But that will be very interesting, if so.

-[Unknown]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Galaxy s7 edge crash - cha0tic - 03-12-2016, 02:34 PM
RE: Galaxy s7 edge crash - KingPepper - 03-12-2016, 04:55 PM
RE: Galaxy s7 edge crash - cha0tic - 03-12-2016, 07:08 PM
RE: Galaxy s7 edge crash - Henrik - 03-12-2016, 07:20 PM
RE: Galaxy s7 edge crash - cha0tic - 03-12-2016, 07:23 PM
RE: Galaxy s7 edge crash - cha0tic - 03-13-2016, 05:31 PM
RE: Galaxy s7 edge crash - thienbaont - 03-14-2016, 03:40 AM
RE: Galaxy s7 edge crash - cha0tic - 03-14-2016, 04:02 AM
RE: Galaxy s7 edge crash - jajabinx35 - 03-15-2016, 08:30 PM
RE: Galaxy s7 edge crash - cha0tic - 03-16-2016, 11:14 PM
RE: Galaxy s7 edge crash - nex86 - 03-17-2016, 04:05 AM
RE: Galaxy s7 edge crash - thienbaont - 03-17-2016, 04:12 AM
RE: Galaxy s7 edge crash - nex86 - 03-17-2016, 04:14 AM
RE: Galaxy s7 edge crash - cha0tic - 03-17-2016, 08:09 AM
RE: Galaxy s7 edge crash - heneli627 - 03-17-2016, 02:46 PM
RE: Galaxy s7 edge crash - nex86 - 03-17-2016, 03:24 PM
RE: Galaxy s7 edge crash - Ifoozle - 03-18-2016, 04:32 AM
RE: Galaxy s7 edge crash - jajabinx35 - 03-18-2016, 09:30 AM
RE: Galaxy s7 edge crash - cha0tic - 03-20-2016, 06:09 AM
RE: Galaxy s7 edge crash - Bronxc - 03-20-2016, 04:50 PM
RE: Galaxy s7 edge crash - Ifoozle - 03-20-2016, 07:46 PM
RE: Galaxy s7 edge crash - [Unknown] - 03-22-2016, 03:01 AM
RE: Galaxy s7 edge crash - cha0tic - 03-22-2016, 07:49 PM
RE: Galaxy s7 edge crash - [Unknown] - 03-22-2016 11:45 PM
RE: Galaxy s7 edge crash - chdcchris - 03-22-2016, 10:15 PM
RE: Galaxy s7 edge crash - nex86 - 03-23-2016, 01:53 AM
RE: Galaxy s7 edge crash - Warmachine02 - 04-04-2016, 06:07 PM
RE: Galaxy s7 edge crash - heneli627 - 04-06-2016, 07:19 PM
RE: Galaxy s7 edge crash - jajabinx35 - 04-07-2016, 08:56 AM
RE: Galaxy s7 edge crash - TkSilver - 04-07-2016, 01:33 PM
RE: Galaxy s7 edge crash - jajabinx35 - 04-09-2016, 03:47 PM
RE: Galaxy s7 edge crash - Henrik - 04-09-2016, 05:32 PM
RE: Galaxy s7 edge crash - Warmachine02 - 04-09-2016, 05:49 PM
RE: Galaxy s7 edge crash - jajabinx35 - 04-09-2016, 06:40 PM
RE: Galaxy s7 edge crash - solid89 - 04-12-2016, 08:05 AM
RE: Galaxy s7 edge crash - LoAndEvolve - 04-12-2016, 10:05 AM
RE: Galaxy s7 edge crash - [Unknown] - 04-12-2016, 12:41 PM
RE: Galaxy s7 edge crash - brujo55 - 04-12-2016, 03:51 PM
RE: Galaxy s7 edge crash - [Unknown] - 04-12-2016, 06:08 PM
RE: Galaxy s7 edge crash - hitori - 04-13-2016, 04:58 PM
RE: Galaxy s7 edge crash - nex86 - 04-15-2016, 06:05 AM
RE: Galaxy s7 edge crash - hitori - 04-15-2016, 05:58 PM
RE: Galaxy s7 edge crash - destinyfates - 04-21-2016, 12:35 PM
RE: Galaxy s7 edge crash - jajabinx35 - 04-21-2016, 01:49 PM
RE: Galaxy s7 edge crash - TkSilver - 04-21-2016, 03:40 PM
RE: Galaxy s7 edge crash - fredwu - 04-27-2016, 03:17 PM
RE: Galaxy s7 edge crash - dazemu - 04-30-2016, 10:48 AM
RE: Galaxy s7 edge crash - jajabinx35 - 05-03-2016, 11:15 AM
RE: Galaxy s7 edge crash - Warmachine02 - 05-04-2016, 10:10 PM
RE: Galaxy s7 edge crash - jajabinx35 - 05-05-2016, 08:19 AM
RE: Galaxy s7 edge crash - Bobby_Flamingo - 05-15-2016, 06:24 AM
RE: Galaxy s7 edge crash - [Unknown] - 05-15-2016, 08:19 PM
RE: Galaxy s7 edge crash - Jaaan - 05-16-2016, 11:30 AM
RE: Galaxy s7 edge crash - Henrik - 05-16-2016, 01:11 PM
RE: Galaxy s7 edge crash - Jaaan - 05-16-2016, 01:35 PM
RE: Galaxy s7 edge crash - [Unknown] - 05-16-2016, 03:54 PM
RE: Galaxy s7 edge crash - Jaaan - 05-16-2016, 04:14 PM
RE: Galaxy s7 edge crash - [Unknown] - 05-16-2016, 04:27 PM
RE: Galaxy s7 edge crash - Jaaan - 05-16-2016, 04:53 PM
RE: Galaxy s7 edge crash - [Unknown] - 05-16-2016, 05:57 PM
RE: Galaxy s7 edge crash - Jaaan - 05-16-2016, 06:49 PM
RE: Galaxy s7 edge crash - [Unknown] - 05-17-2016, 12:45 AM
RE: Galaxy s7 edge crash - Jaaan - 05-17-2016, 11:07 AM
RE: Galaxy s7 edge crash - [Unknown] - 05-17-2016, 05:17 PM
RE: Galaxy s7 edge crash - Jaaan - 05-17-2016, 06:59 PM
RE: Galaxy s7 edge crash - [Unknown] - 05-18-2016, 04:35 AM
RE: Galaxy s7 edge crash - Jaaan - 05-18-2016, 10:59 AM
RE: Galaxy s7 edge crash - Bobby_Flamingo - 05-18-2016, 11:58 PM
RE: Galaxy s7 edge crash - [Unknown] - 05-22-2016, 01:40 AM
RE: Galaxy s7 edge crash - jakal7x - 05-22-2016, 08:21 AM
RE: Galaxy s7 edge crash - [Unknown] - 05-22-2016, 03:13 PM
RE: Galaxy s7 edge crash - jakal7x - 05-23-2016, 12:15 PM
RE: Galaxy s7 edge crash - cha0tic - 05-23-2016, 03:58 AM
RE: Galaxy s7 edge crash - [Unknown] - 05-24-2016, 03:49 AM
RE: Galaxy s7 edge crash - Henrik - 05-24-2016, 06:58 AM
RE: Galaxy s7 edge crash - jakal7x - 05-25-2016, 01:20 AM
RE: Galaxy s7 edge crash - jajabinx35 - 05-25-2016, 05:53 PM
RE: Galaxy s7 edge crash - jajabinx35 - 05-28-2016, 12:36 PM
RE: Galaxy s7 edge crash - HANZ64 - 07-19-2016, 09:22 PM
RE: Galaxy s7 edge crash - PsyEd - 08-18-2016, 06:03 AM
RE: Galaxy s7 edge crash - n1kokpo12 - 08-26-2016, 02:36 AM
RE: Galaxy s7 edge crash - n1kokpo12 - 08-27-2016, 12:13 AM
RE: Galaxy s7 edge crash - TkSilver - 08-27-2016, 02:51 AM
RE: Galaxy s7 edge crash - [Unknown] - 09-10-2016, 05:47 PM
RE: Galaxy s7 edge crash - PsyEd - 09-21-2016, 11:20 PM
RE: Galaxy s7 edge crash - HANZ64 - 09-22-2016, 04:18 AM
RE: Galaxy s7 edge crash - RoronoARK - 09-23-2016, 03:10 PM

Forum Jump: