Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 84db3c6

Browse files
kinkedlang-bot
authored andcommitted
core.internal.backtrace.dwarf: Fix segfault regression in case executable cannot be opened
Introduced by #3322. `image.baseAddress()` must not be called if `!image.isValid()`, otherwise a segfault occurs if the executable file/image could not be opened (e.g., because of the process changing the initial working dir and https://issues.dlang.org/show_bug.cgi?id=21656).
1 parent b2b7732 commit 84db3c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/internal/backtrace/dwarf.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ int traceHandlerOpApplyImpl(size_t numFrames,
187187

188188

189189
if (!image.isValid())
190-
return locations[startIdx .. $].processCallstack(null, image.baseAddress, dg);
190+
return locations[startIdx .. $].processCallstack(null, 0, dg);
191191

192192
// find address -> file, line mapping using dwarf debug_line
193193
return image.processDebugLineSectionData(

0 commit comments

Comments
 (0)