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

broken natives functions #18

Closed
Pycckue-Bnepeg opened this issue Feb 14, 2020 · 7 comments
Closed

broken natives functions #18

Pycckue-Bnepeg opened this issue Feb 14, 2020 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@Pycckue-Bnepeg
Copy link
Owner

Pycckue-Bnepeg commented Feb 14, 2020

SDK breaks native functions from other modules (like SAMP and plugins) when plugin uses #[native(..., raw)] or samp_sdk::amx::Allocator and its methods (I'm not sure which one).

@bmisiak

@Pycckue-Bnepeg
Copy link
Owner Author

relative issue is bmisiak/samp-precise-timers#7

@bmisiak
Copy link

bmisiak commented Feb 14, 2020

Hey @ZOTTCE, thanks for filing the issue!

Interesting. From a brief look at

https://github.com/Zeex/sampgdk/blob/599a1227f845fc8931059c6c9ee82c0776483a7e/lib/sampgdk/internal/native.c#L67-L68

I thought perhaps it had something to do with native ordering.

@Pycckue-Bnepeg
Copy link
Owner Author

@bmisiak
I don't think that this error has any relationships with sampgdk, because I couldn't successfully call UpdatePlayer3DTextLabelText without GDK plugin.

@Pycckue-Bnepeg Pycckue-Bnepeg added the help wanted Extra attention is needed label Feb 17, 2020
@Southclaws
Copy link
Contributor

I've heard similar reports from users of my Rust plugins: Southclaws/pawn-json#2 (comment)

@Southclaws
Copy link
Contributor

I removed all native(raw, ... from my code and the issue still occurred.

@Pycckue-Bnepeg
Copy link
Owner Author

@Southclaws could you help me to test bugfix?
I guess this commit (2e91927) in potential-fix branch should fix this annoying bug.

@Pycckue-Bnepeg
Copy link
Owner Author

Pycckue-Bnepeg commented Jun 25, 2020

That branch should be a fix, I've tested it on Windows and didn't get warnings. On ubuntu 20.04 I couldn't reproduce this bug maybe because of different memory management (Windows could reuse this regions while Ubuntu isn't). sampgdk saves pointers to natives names in the amx_Register hook (but samp implementation of AMX doesn't do that). Currently in the master branch I free memory containing strings with names that decision is based on original AMX.

@bmisiak @Southclaws @Sreyas-Sreelal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants