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

Symbol clean up and strlen fixes #37149

Merged
merged 1 commit into from
Aug 25, 2020
Merged

Symbol clean up and strlen fixes #37149

merged 1 commit into from
Aug 25, 2020

Conversation

yuyichao
Copy link
Contributor

  • Require the symbol to fit in ssize_t

    This is the limit we have on arrays and I don't think anyone is using
    symbols that is as long as half the full address space.

  • Remove some unnecessary embeded NUL byte checks when constructing symbols

    Almost all use of jl_symbol_n have the caller checked for embedded NUL byte already.
    This technically introduces a C API/ABI breakage but it shouldn't matter on all platforms we support.

  • Fix ccall of strlen.


The change to base/secretbuffer.jl should be backported. None of the others should. It's funny that the only bug that can cause silent error that I found is in security related code = = ...........

@yuyichao
Copy link
Contributor Author

Actually the change to base/gcutils.jl is also fixing an wrong return type for strlen in the doc and it should probably also be backported...

* Require the symbol to fit in ssize_t

  This is the limit we have on arrays and I don't think anyone is using
  symbols that is as long as half the full address space.

* Remove some unnecessary embeded NUL byte checks when constructing symbols

  Almost all use of `jl_symbol_n` have the caller checked for embedded NUL byte already.
  This technically introduces a C API/ABI breakage but it shouldn't matter on all platforms we support.

* Fix ccall of `strlen`.
@yuyichao yuyichao merged commit 98c68a2 into master Aug 25, 2020
@yuyichao yuyichao deleted the yyc/symbol branch August 25, 2020 05:36
KristofferC pushed a commit that referenced this pull request Aug 26, 2020
* Require the symbol to fit in ssize_t

  This is the limit we have on arrays and I don't think anyone is using
  symbols that is as long as half the full address space.

* Remove some unnecessary embeded NUL byte checks when constructing symbols

  Almost all use of `jl_symbol_n` have the caller checked for embedded NUL byte already.
  This technically introduces a C API/ABI breakage but it shouldn't matter on all platforms we support.

* Fix ccall of `strlen`.

(cherry picked from commit 98c68a2)
@KristofferC KristofferC mentioned this pull request Aug 26, 2020
29 tasks
@KristofferC
Copy link
Member

@yuyichao 9f1cc7e

simeonschaub pushed a commit to simeonschaub/julia that referenced this pull request Aug 29, 2020
* Require the symbol to fit in ssize_t

  This is the limit we have on arrays and I don't think anyone is using
  symbols that is as long as half the full address space.

* Remove some unnecessary embeded NUL byte checks when constructing symbols

  Almost all use of `jl_symbol_n` have the caller checked for embedded NUL byte already.
  This technically introduces a C API/ABI breakage but it shouldn't matter on all platforms we support.

* Fix ccall of `strlen`.
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

Successfully merging this pull request may close these issues.

2 participants