Crash on Core2Duos, fine on G5

So I just ran into a weird problem. I’m working with Thomas on the dice roller. We have a splash screen that loads up before anything else, and while the splash screen is displayed, there is no GUI. I implemented this via a variable called OnSplashScreen that gets set to false once the user clicks on something.

This value gets checked in two places:

  1. Update checks for it and a mouse click, and if the user clicks on the mouse, it changes the background and adds three dice as an example.
  2. OnGUI verifies if we are showing the splash screen. If so, no GUI elements are displayed.
// First thing we do is show the splash screen
private bool OnSplashScreen = true;

void Update()
{
    if (OnSplashScreen  Input.GetMouseButtonDown(0))
    {
        OnSplashScreen = false;
        // For some reason this line crashes it on my machine
        AddDice(3, 6); // Add 3d6
        RandomizeBackground();
    }
}

void OnGUI () {
    if (OnSplashScreen)
    {
        return;
    }

    // [...]
    // Build GUI
}

Here’s the problem:

  • The initial call to AddDice makes the application crash on two different Core 2 Duo from the standalone application.
  • It works in my Core 2 Duo fine if running from within the Unity environment.
  • On a second Core 2 Duo that neither has Unity nor has run the application before, the standalone crashes.
  • Both standalone and environment run perfectly from Thomas’ G5.

Things we have tried:

  • Building on Thomas’ installation, running on mine (just in case my Unity was borked).
  • Changing the standalone quality to Good, to match the editor quality.
  • Changing the editor quality to Fantastic, to match the standalone player quality.
  • Removing the application preferences file on my machine.
  • Removing the unity preferences file, rebuilding.
  • Cleaning the /tmp directory (just in case).

The behavior is the same.

The AddDice call of course works as expected in other areas of the application (or, like I said, on other machines).

Does anyone have suggestion or has seen similar behavior?

PS: Web player version works just fine, even on Fantastic quality. It’s just the standalone in both Core2Duos I’ve tested it on.

What is crashing is the call to instantiate:

public Transform[] diceModels;

// [...]

for(int i = 0; i < count; i++)
{
	Transform die = (Transform)Instantiate(dieModel, transform.position, Quaternion.identity);
    die.parent = transform;
	die.gameObject.name = "D"+faces;
	SpawnDie(die);
}

Thinking it might be that we’re supposed to work over GameObjects I changed the array and all references, but it still crashes on the two Intel machines we have tried. Like I said, that code works, just not when I call if from the “if (OnSplashScreen)” from the previous post.

could you put your whole scripts here.
potentially you mess something in the communication or setup that causes that.

there theoretically shouldn’t be a difference but a G5 is just significantly slower than a G5 so you perhaps get the problem due to the higher speed and some assumption of you / side effects or at worst because you missuse threads to do work which run in parallel on a c2d, unlike a G5 where they run each after the other.

Almost all G5 Power Macs have either dual CPUs or dual-core CPUs.

–Eric

Hi,

Indeed, the G5 is dual-cpu one.

Slower speed on the G5 is likely not the reason why it works - I just got someone to try them on a more recent iMac Core 2 Duo, faster than either of these, and it works well. From the beginning of the crash report:

Exception Type:  EXC_BAD_ACCESS (SIGABRT)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
Crashed Thread:  0

Thread 0 Crashed:
0   libSystem.B.dylib             	0x96e63b9e __kill + 10
1   libSystem.B.dylib             	0x96edaec2 raise + 26
2   libSystem.B.dylib             	0x96eea47f abort + 73
3   ...y.tom3d@mac.com.Rock'n'Roll	0x00143ff3 0x1000 + 1322995
4   libmono.0.dylib               	0x0077a7e8 mono_handle_native_sigsegv + 278
5   libmono.0.dylib               	0x0073f61a mono_create_jump_trampoline + 2096
6   libSystem.B.dylib             	0x96e6209b _sigtramp + 43
7   ???                           	0xffffffff 0 + 4294967295
8   ...pple.ATIRadeonX1000GLDriver	0x184ed6c2 gldGetString + 562530
9   ...pple.ATIRadeonX1000GLDriver	0x18468ddc gldGetString + 19580
10  ...pple.ATIRadeonX1000GLDriver	0x18468d2b gldGetString + 19403
11  ...pple.ATIRadeonX1000GLDriver	0x184f4ef2 gldGetString + 593298
12  ...pple.ATIRadeonX1000GLDriver	0x18448dff gldUpdateDispatch + 3199
13  GLEngine                      	0x18296b6e glClear_Exec + 382
14  libGL.dylib                   	0x91bb805b glClear + 27

It might be something specific to the video card family, since the ones where it crashes have Radeon X1600s while the iMac my friend tested on has an HD 2600.

I’ve filed a player bug report, with the sample app and the crash report.

Sounds like a driver problem

perhaps you try to enforce some shader usage thats not possible on that card or the users in question don’t have their OSX up to date (10.5.4+)

Hi Dreamora,

Thanks for the pointers. I’ve double checked, and we’re only using the standard shaders. Moreover, creating the objects later in the app does work - it’s only if I instantiate them right then that it fails. Both machines with the Radeons are using OSX 10.5.5.

I’m sure this discussion will prove helpful for the Unity folks if it is indeed a bug.

I have a build that is working on some macs, and crashing at start up on others as well. My crash log looks the same as the one in this thread. Mine is working well on an intel imac, crashing on 2 newer mac pro’s, and crashing on a G5.
Here is the crash log from mine:

Thread 0 Crashed:
0 libSystem.B.dylib 0x9241fe42 __kill + 10
1 libSystem.B.dylib 0x9249223a raise + 26
2 libSystem.B.dylib 0x9249e679 abort + 73
3 libmono.0.dylib 0x00bae926 mono_handle_native_sigsegv + 327
4 libSystem.B.dylib 0x9241e2bb _sigtramp + 43
5 ??? 0xffffffff 0 + 4294967295
6 libSystem.B.dylib 0x9249223a raise + 26
7 libSystem.B.dylib 0x9249e679 abort + 73
8 …nterlock Games.Track Attack 0x002fdee5 DataStructures::ListRakNet::RakString::SharedString*::List() + 3045577
9 libmono.0.dylib 0x00bee64a mono_chain_signal + 76
10 libmono.0.dylib 0x00b28c0e mono_sigsegv_signal_handler + 263
11 libSystem.B.dylib 0x9241e2bb _sigtramp + 43
12 ??? 0xffffffff 0 + 4294967295

I don’t know how to interpret this at all though, but am noticing that the ??? on line 12 on mine, has something about the graphics card on the one earlier in the thread. I’ll start checking what graphics setting I may have enabled…

432087–14974–$002.pdf (7.64 KB)

This part of the crash log was also the same as Arges:

Exception Type: EXC_BAD_ACCESS (SIGABRT)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
Crashed Thread: 0

send a bugreport )

My issue has mysteriously resolved itself, so nevermind :slight_smile: