-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Saigo-built arm nexe crashes #3297
Comments
We may also try a newer nacl loader, the one we use is very old. |
I currently host Saigo-built cgames on Bunker should anybody wish to test this in an "authentic" environment. All three supported architectures are available. |
If I write this: static void BG_InitWeaponAttributes()
{
const weaponData_t *wd;
weaponAttributes_t *wa;
for ( unsigned i = 0; i < bg_numWeapons; i++ )
{
wd = &bg_weaponsData[i];
wa = &bg_weapons[i];
*wa = {};
wa->number = wd->number;
wa->name = wd->name;
Log::Warn("===========%s====", wd->name);
Log::Warn("===========%s====", wa->name);
Log::Warn("===========%s====", va("%s", wa->name));
// set default values for optional fields
wa->knockbackScale = 1.0f;
BG_ParseWeaponAttributeFile( va( "configs/weapon/%s.attr.cfg", wa->name ), wa );
}
} I get this being printed:
And the errors like that disappear (but it still crashes later):
But if I do that: static void BG_InitWeaponAttributes()
{
const weaponData_t *wd;
weaponAttributes_t *wa;
for ( unsigned i = 0; i < bg_numWeapons; i++ )
{
wd = &bg_weaponsData[i];
wa = &bg_weapons[i];
*wa = {};
wa->number = wd->number;
wa->name = wd->name;
// Log::Warn("===========%s====", wd->name);
// Log::Warn("===========%s====", wa->name);
Log::Warn("===========%s====", va("%s", wa->name));
// set default values for optional fields
wa->knockbackScale = 1.0f;
BG_ParseWeaponAttributeFile( va( "configs/weapon/%s.attr.cfg", wa->name ), wa );
}
} I get that:
|
If I modify char *PRINTF_LIKE(1) va( const char *format, ... )
{
va_list argptr;
const int MAX_VA_STRING = 32000;
static char temp_buffer[ MAX_VA_STRING + 1 ];
static char string[ MAX_VA_STRING ]; // in case va is called by nested functions
static int index = 0;
char *buf;
int len;
va_start( argptr, format );
Q_vsnprintf( temp_buffer, sizeof( temp_buffer ), format, argptr );
temp_buffer[ MAX_VA_STRING ] = 0;
Log::Warn( "---%s---", temp_buffer );
// …
} I get this:
|
Using a newer loader and a newer irt doesn't avoid the crash. |
To log more extensively what's happening and experiment with the NaCl implementation of int PRINTF_LIKE(3) Q_vsnprintf( char *str, size_t size, const char *format, ... )
{
va_list argptr;
va_start( argptr, format );
int len = vsnprintf( str, size, format, argptr );
va_end( argptr );
return len;
} But this produces garbage and even crashes the amd64 nexe. I wanted to first do that to intercept all the calls then add some logging around… but even that doesn't work. What is my mistake? |
Well, I'm probably losing my time, the bug is likely in |
…or in |
With a Debug build it works, so that's likely a compiler optimization bug. |
It crashes with |
So, even if it's kinda annoying to require a non-optimized build on arm, having the ability to make it run means we're not prevented to migrate to Saigo. |
For now this does the job: diff --git a/cmake/DaemonFlags.cmake b/cmake/DaemonFlags.cmake
index e8da09c00..052d86646 100644
--- a/cmake/DaemonFlags.cmake
+++ b/cmake/DaemonFlags.cmake
@@ -231,6 +231,12 @@ else()
endif()
endif()
+ if (NACL AND USE_NACL_SAIGO AND SAIGO_ARCH STREQUAL "arm")
+ set_c_cxx_flag("-O0" RELEASE)
+ set_c_cxx_flag("-O0" RELWITHDEBINFO)
+ set_c_cxx_flag("-O0" MINSIZEREL)
+ endif()
+
# Extra debug flags.
set_c_cxx_flag("-g3" RELWITHDEBINFO)
set_c_cxx_flag("-g3" DEBUG) |
It prints some garbage then crashes:
Fortunately when enabling the minidump:
it dumps something (attached):
The text was updated successfully, but these errors were encountered: