D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21371 - core.stdcpp.allocator: _Adjust_manually_vector_aligned checks for sentinel unconditionally (Windows only)
Summary: core.stdcpp.allocator: _Adjust_manually_vector_aligned checks for sentinel un...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: All Windows
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-11-09 05:34 UTC by Nathan S.
Modified: 2021-04-18 14:24 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Nathan S. 2020-11-09 05:34:06 UTC
This bug resulted in assertion failures when deleting large blocks of memory using core.stdcpp.allocator on Microsoft Windows. _Allocate_manually_vector_aligned sets a sentinel when version(_DEBUG). _Adjust_manually_vector_aligned checks for this sentinel when assertions are enabled without checking version(_DEBUG).
Comment 1 Dlang Bot 2020-11-09 05:42:00 UTC
@n8sh created dlang/druntime pull request #3265 "core.stdcpp.allocator: _Adjust_manually_vector_aligned checks for sentinel unconditionally (Windows only)" fixing this issue:

- Fix Issue 21371 - core.stdcpp.allocator: _Adjust_manually_vector_aligned checks for sentinel unconditionally (Windows only)
  
  This bug resulted in assertion failures when deleting large blocks of memory using core.stdcpp.allocator on Windows. _Allocate_manually_vector_aligned
  only sets a sentinel when version(_DEBUG) so _Adjust_manually_vector_aligned
  should only check for this sentinel when version(_DEBUG).
  
  Additionally change the linkage of those functions from C++ to D to avoid
  possible linker confusion.

https://github.com/dlang/druntime/pull/3265
Comment 2 Dlang Bot 2021-03-18 13:55:57 UTC
dlang/druntime pull request #3265 "core.stdcpp.allocator: _Adjust_manually_vector_aligned checks for sentinel unconditionally (Windows only)" was merged into stable:

- c97b571c084ecd097a2d19f86a175085efec95a7 by Nathan Sashihara:
  Fix Issue 21371 - core.stdcpp.allocator: _Adjust_manually_vector_aligned checks for sentinel unconditionally (Windows only)
  
  This bug resulted in assertion failures when deleting large blocks of memory using core.stdcpp.allocator on Windows. _Allocate_manually_vector_aligned
  only sets a sentinel when version(_DEBUG) so _Adjust_manually_vector_aligned
  should only check for this sentinel when version(_DEBUG).
  
  Additionally change the linkage of those functions from C++ to D to avoid
  possible linker confusion.
  
  Also changed the logic by which allocator.d infers _DEBUG to resemble the
  the logic for _ITERATOR_DEBUG_LEVEL in utility.d.

https://github.com/dlang/druntime/pull/3265
Comment 3 Dlang Bot 2021-04-18 14:24:29 UTC
dlang/druntime pull request #3434 "merge stable" was merged into master:

- 74287fbe7867896b23eeb01f5663ade8ea0d49e0 by Nathan Sashihara:
  Fix Issue 21371 - core.stdcpp.allocator: _Adjust_manually_vector_aligned checks for sentinel unconditionally (Windows only)
  
  This bug resulted in assertion failures when deleting large blocks of memory using core.stdcpp.allocator on Windows. _Allocate_manually_vector_aligned
  only sets a sentinel when version(_DEBUG) so _Adjust_manually_vector_aligned
  should only check for this sentinel when version(_DEBUG).
  
  Additionally change the linkage of those functions from C++ to D to avoid
  possible linker confusion.
  
  Also changed the logic by which allocator.d infers _DEBUG to resemble the
  the logic for _ITERATOR_DEBUG_LEVEL in utility.d.

https://github.com/dlang/druntime/pull/3434