Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix for 1693 bug access to deleted memory in array proxy index#3600

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
christophe-murphy wants to merge10 commits intomaster
base:master
Choose a base branch
Loading
from1693-bug-access-to-deleted-memory-in-array_proxy-index

Conversation

christophe-murphy
Copy link
Contributor

Arrays can now be used as an index for creating an array proxy without failure.

Description

When using an array as an index when creating an array proxy a temporary index object is created and passed to the constructor for the array proxy. However the array underlying the index was not being kept after the temporary index was destroyed, resulting in undefined behavior. This fix ensures that the array is retained until the array proxy is destroyed. Users can now use an array as an index when creating an array proxy without needing to explicitly define an index object.

Fixes:#1693

Checklist

  • Rebased on latest master
  • Code compiles
  • Tests pass

@christophe-murphychristophe-murphy linked an issueSep 5, 2024 that may beclosed by this pull request
@melonakosmelonakos added this to the3.10 milestoneFeb 5, 2025
@christophe-murphy
Copy link
ContributorAuthor

OK, I reran address sanitizer on the CUDA backend with the following options and it ran without any issues reported:protect_shadow_gap=0:replace_intrin=0:detect_stack_use_after_return=0

@christophe-murphy
Copy link
ContributorAuthor

I have done some more testing, see latest commit. I ran these through the leak sanitizer for all back ends and, aside from an unrelated memory leak in the random number generator engine, there are no issues.

The copy constructors for array_proxy have been made private. This will prevent you from assigning an array proxy to an auto variable accidently. Array proxies should only be assigned to variables of type array. Assigning to an auto will now lead to a compilation error.
edwinsolisf
edwinsolisf previously approved these changesMar 14, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@umar456umar456umar456 left review comments

@edwinsolisfedwinsolisfedwinsolisf left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
3.10
Development

Successfully merging this pull request may close these issues.

BUG: access to deleted memory in array_proxy index
4 participants
@christophe-murphy@umar456@edwinsolisf@melonakos

[8]ページ先頭

©2009-2025 Movatter.jp