-
Enhancement
-
Resolution: Fixed
-
P4
-
17, 21, 25, 26
-
b12
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8368969 | 25.0.2 | Aleksey Shipilev | P4 | Resolved | Fixed | b01 |
We sometimes have a lifecycle problem with C-heap allocated objects. The most recent I dealt with is JDK-8364501. It would be convenient to have the base delete operators for e.g. CHeapObjBase to zap the contents of the deleted objects to catch these errors.
Is this even possible in a compatible manner? Are the performance overheads reasonable?
Is this even a good idea, or should we instead rely on underlying C heap allocators to do this zapping for us? glibc malloc seems to have a tunable, `MALLOC_PERTURB_`/`glibc.malloc.perturb` that might serve our needs. It would be interesting to opt-in to that for debug builds.
Is this even possible in a compatible manner? Are the performance overheads reasonable?
Is this even a good idea, or should we instead rely on underlying C heap allocators to do this zapping for us? glibc malloc seems to have a tunable, `MALLOC_PERTURB_`/`glibc.malloc.perturb` that might serve our needs. It would be interesting to opt-in to that for debug builds.
- backported by
-
JDK-8368969 Zap C-heap memory at delete/free
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk25u/86803cc5
-
Commit(master) openjdk/jdk/ca753eba
-
Review(master) openjdk/jdk25u/247
-
Review(master) openjdk/jdk/26775