1180 – the GC failes to handle large allocation requests propperly

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1180 - the GC failes to handle large allocation requests propperly
Summary: the GC failes to handle large allocation requests propperly
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: x86_64 Linux
: P3 regression
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
Reported: 2007年04月23日 13:01 UTC by Thomas Kühne
Modified: 2018年01月05日 13:27 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Thomas Kühne 2007年04月23日 13:01:28 UTC
Due to the size calculation used in all array length related GC functions 
excessive allocation requests like
long[] l = new long[size_t.max];
allocate "(element_size * element_count) & 0xFFFF_FFFF" bytes and not 
"element_size * element_count" bytes.
Even non-excessive requests like
byte[] b = new byte[size_t.max / 3];
fail with a segfault because bigAlloc uses "assert (0)" instead of 
"_d_OutOfMemory".
Comment 1 Walter Bright 2007年04月27日 14:58:54 UTC
Fixed DMD 1.014
Comment 2 anonymous4 2016年02月20日 16:49:14 UTC
int main()
{
	size_t len = size_t.max-100;
	ubyte[] arr = new ubyte[len];
	return 0;
}
Return code: 11 (Segmentation fault)
Tried only on dpaste.
Comment 3 Rainer Schuetze 2016年03月30日 21:00:00 UTC
This is unlikely a recent regression, it's already in dmd 2.067.
https://github.com/D-Programming-Language/druntime/pull/1528 
Comment 4 github-bugzilla 2016年04月08日 22:57:28 UTC
Commit pushed to master at https://github.com/D-Programming-Language/druntime
https://github.com/D-Programming-Language/druntime/commit/6dbe4d82c074561ddb23525b23cd9cf599e4a5ce
Merge pull request #1528 from rainers/fix_1180
Fix Issue 1180 - the GC failes to handle large allocation requests propperly
Comment 5 github-bugzilla 2016年10月01日 11:44:41 UTC
Commit pushed to stable at https://github.com/dlang/druntime
https://github.com/dlang/druntime/commit/6dbe4d82c074561ddb23525b23cd9cf599e4a5ce
Merge pull request #1528 from rainers/fix_1180
Comment 6 github-bugzilla 2018年01月05日 13:27:34 UTC
Commit pushed to dmd-cxx at https://github.com/dlang/druntime
https://github.com/dlang/druntime/commit/6dbe4d82c074561ddb23525b23cd9cf599e4a5ce
Merge pull request #1528 from rainers/fix_1180


AltStyle によって変換されたページ (->オリジナル) /