Page 1 of 1

Weird crashes in the core(s)

PostPosted: Wed Jul 26, 2017 1:39 am
by CocoaGeek
Hello,

I'm running into some weird behaviour when I try to use some function from libc and libm. I have been pulling my hair out trying to figure it out and I can't. It probably have something to do with the shared memory usage, but I dunno ... :(

Basically, the following code will work:

Code: Select all
float lValue = expf(1.23f);


this one too:

Code: Select all
float lValue = eRand(&lRSeed);


but this won't:

Code: Select all
real32 lValue = expf(eRand(&lRSeed));


and neither will this:

Code: Select all
float lValue2 = eRand(&lRSeed);
float lValue3 = expf(lValue2);


The eRand function is the following:

Code: Select all
float eRand(uint* aSeed)
{
    return (float)rand_r(aSeed) / (float)RAND_MAX;
}


Any suggestion welcomed :oops:

Re: Weird crashes in the core(s)

PostPosted: Wed Jul 26, 2017 2:15 am
by CocoaGeek
Ok, shifted the location of my shared data to 0x8f000000 and it seems to work now ... I'm an idiot :oops: