Bug 15622 – Order of execution of module destructors is not always correct

Status
NEW
Severity
normal
Priority
P3
Component
druntime
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2016-01-29T11:50:30Z
Last change time
2024-12-07T13:36:20Z
Assigned to
No Owner
Creator
yazan.dabain
Moved to GitHub: dmd#17149 →

Comments

Comment #0 by yazan.dabain — 2016-01-29T11:50:30Z
import core.stdc.stdio; import std.parallelism; static ~this() { printf("%.*s\n", __FUNCTION__.length, __FUNCTION__.ptr); } shared static ~this() { printf("%.*s\n", __FUNCTION__.length, __FUNCTION__.ptr); } void main() { auto t = new TaskPool(); t.isDaemon = true; } ------------------ The previous code prints: main._staticDtor1 main._sharedStaticDtor2 main._staticDtor1 main._staticDtor1 main._staticDtor1 ------------------ Per http://dlang.org/spec/module.html#staticorder, shared static destructors are defined to run after all other static destructors but in this case that is not happening. Original bug report: https://github.com/rejectedsoftware/vibe.d/issues/1374
Comment #1 by robert.schadek — 2024-12-07T13:36:20Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17149 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB