Skip to content
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

CA_RayCastLineID crash #20

Closed
NexiusTailer opened this issue Jul 1, 2016 · 4 comments
Closed

CA_RayCastLineID crash #20

NexiusTailer opened this issue Jul 1, 2016 · 4 comments

Comments

@NexiusTailer
Copy link
Contributor

So, after a long test I get the crash: if you use CA_RayCastLineID at water (20000), then instead of return that number you will see this:

[22:22:30] [debug] Server crashed while executing creator.amx
[22:22:31] [debug] AMX backtrace:
[22:22:31] [debug] #0 native CA_RayCastLineID () from Colandreas.DLL
[22:22:31] [debug] #1 00005aac in public OnPlayerUpdate (0) from creator.amx
[22:22:31] [debug] Native backtrace:
[22:22:31] [debug] #0 611c74cd in ?? () from plugins\Colandreas.DLL
[22:22:31] [debug] #1 611c8b08 in ?? () from plugins\Colandreas.DLL
[22:22:31] [debug] #2 004010b6 in ?? () from samp-server.exe
[22:22:31] [debug] #3 6b5262ca in ?? () from plugins\crashdetect.DLL
[22:22:31] [debug] #4 6b528b28 in ?? () from plugins\crashdetect.DLL
[22:22:31] [debug] #5 6b5209c7 in ?? () from plugins\crashdetect.DLL
[22:22:31] [debug] #6 6b52631a in ?? () from plugins\crashdetect.DLL
[22:22:31] [debug] #7 69f24509 in ?? () from plugins\streamer.DLL
[22:22:31] [debug] #8 0046bdaf in ?? () from samp-server.exe
[22:22:31] [debug] #9 0048fb34 in ?? () from samp-server.exe
[22:22:31] [debug] #10 773fd8ea in ?? () from C:\Windows\SYSTEM32\ntdll.dll

@NexiusTailer
Copy link
Contributor Author

NexiusTailer commented Jul 1, 2016

P.s. CA_RayCastLineID also return 0 if collision not found, but objects which added by CA_CreateObject also can have id (index) 0..

@Crayder
Copy link
Collaborator

Crayder commented Jul 1, 2016

P.s. CA_RayCastLineID also return 0 if collision not found, but objects which added by CA_CreateObject also can have id (index) 0..

Totally correct. I'll fix that when I get home in a few weeks or so unless someone wants to do it for me, it's pretty simple. (@Pottus?)

But about the crash, I'm not sure. Perhaps you could do some more tests. Like cast rays on _SC objects?

@NexiusTailer
Copy link
Contributor Author

NexiusTailer commented Jul 1, 2016

Any created objects didn't exist.
Unfortunately I not fully understand the problem.
With -d3 crashdetect only confirmed that the problem in this function

However, this code must crash your server:

public OnPlayerUpdate(playerid)
{
new Float:tmp;
CA_RayCastLineID(1983.875366, 555.897338, 11.122355, 2028.804321, 567.251770, -7.651627, tmp, tmp, tmp); //even without any checks, just use function
return 1;
}

I do not know, but the crash occurs precisely around these coordinates

@codectile
Copy link
Contributor

Try this.
https://github.com/Pottus/ColAndreas/blob/master/src/DynamicWorld.cpp#L115

index = -1;
ColAndreasObjectTracker* tracker = NULL;
tracker = (ColAndreasObjectTracker*)RayCallback.m_collisionObject->getUserPointer();
if(tracker) //always be safe while manipulating pointer
    index = tracker->realIndex;

Crayder pushed a commit that referenced this issue Feb 22, 2018
Repository owner deleted a comment from Romz24 Oct 18, 2018
Repository owner deleted a comment from NexiusTailer Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants