Bug 15822 – InvalidMemoryOperationError when calling GC.removeRange/Root from a finalizer

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-03-23T07:27:21Z
Last change time
2018-01-05T13:27:23Z
Keywords
pull
Assigned to
No Owner
Creator
Martin Nowak

Comments

Comment #0 by code — 2016-03-23T07:27:21Z
Comment #1 by code — 2016-03-23T08:29:17Z
Comment #2 by code — 2016-03-23T08:29:49Z
*** Issue 15809 has been marked as a duplicate of this issue. ***
Comment #3 by code — 2016-03-23T08:32:31Z
*** Issue 15821 has been marked as a duplicate of this issue. ***
Comment #4 by code — 2016-03-23T08:33:30Z
*** Issue 15808 has been marked as a duplicate of this issue. ***
Comment #5 by github-bugzilla — 2016-03-23T11:43:12Z
Commits pushed to stable at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/d23d7efb3649cd543e8d0b10b9a32ab3325f5cd0 fix Issue 15822 - InvalidMemoryOperationError when calling GC.removeRange/Root from a finalizer - use separate locks for GC.add/removeRange/Root - avoids GC.lock contention for manual memory management https://github.com/D-Programming-Language/druntime/commit/c6ac077a8d544fab65b1973b385c6f479697fb0e Merge pull request #1519 from MartinNowak/fix15822 fix Issue 15822 - InvalidMemoryOperationError when calling GC.removeRange/Root from a finalizer
Comment #6 by hsteoh — 2016-03-23T19:16:18Z
This bug has not yet been (fully) fixed: ------ import std.stdio; class Wrapper { typeof(stdin.byLine()) src; } void main() { auto x = new Wrapper(); x.src = stdin.byLine(); } ------ Run as 'echo | ./program'. Output: ------ core.exception.InvalidMemoryOperationError@src/core/exception.d(693): Invalid memory operation ------
Comment #7 by ag0aep6g — 2016-03-23T19:23:40Z
(In reply to hsteoh from comment #6) > This bug has not yet been (fully) fixed: > > ------ > import std.stdio; > class Wrapper > { > typeof(stdin.byLine()) src; > } > void main() > { > auto x = new Wrapper(); > x.src = stdin.byLine(); > } > ------ > > Run as 'echo | ./program'. Output: > > ------ > core.exception.InvalidMemoryOperationError@src/core/exception.d(693): > Invalid memory operation > ------ Works for me. Are you testing with stable?
Comment #8 by hsteoh — 2016-03-23T19:28:59Z
Oh, was this only fixed in stable? I'm testing with latest git HEAD.
Comment #9 by ag0aep6g — 2016-03-23T20:00:12Z
(In reply to hsteoh from comment #8) > Oh, was this only fixed in stable? Yup. > I'm testing with latest git HEAD. I'm closing as fixed again, assuming it works for you with stable.
Comment #10 by hsteoh — 2016-03-24T02:33:21Z
Why aren't we fixing this in git HEAD?!
Comment #11 by ag0aep6g — 2016-03-24T05:40:10Z
(In reply to hsteoh from comment #10) > Why aren't we fixing this in git HEAD?! It's a regression. Those are fixed against stable, from which point releases are built. As far as I understand, stable is merged back into master from time to time (don't know if there are any rules about it). So the fix should reach master eventually.
Comment #12 by github-bugzilla — 2016-03-24T07:09:54Z
Commits pushed to master at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/d23d7efb3649cd543e8d0b10b9a32ab3325f5cd0 fix Issue 15822 - InvalidMemoryOperationError when calling GC.removeRange/Root from a finalizer https://github.com/D-Programming-Language/druntime/commit/c6ac077a8d544fab65b1973b385c6f479697fb0e Merge pull request #1519 from MartinNowak/fix15822
Comment #13 by hsteoh — 2016-03-24T15:15:17Z
Thanks!!
Comment #14 by github-bugzilla — 2018-01-05T13:27:23Z
Commits pushed to dmd-cxx at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/d23d7efb3649cd543e8d0b10b9a32ab3325f5cd0 fix Issue 15822 - InvalidMemoryOperationError when calling GC.removeRange/Root from a finalizer https://github.com/dlang/druntime/commit/c6ac077a8d544fab65b1973b385c6f479697fb0e Merge pull request #1519 from MartinNowak/fix15822