Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing test causes stack trace to print infinitely #2151

Closed
hryx opened this issue Mar 31, 2019 · 1 comment
Closed

Failing test causes stack trace to print infinitely #2151

hryx opened this issue Mar 31, 2019 · 1 comment
Labels
bug Observed behavior contradicts documented or intended behavior standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@hryx
Copy link
Contributor

hryx commented Mar 31, 2019

See for example:

Also confirmed locally on macOS and Linux. It can be easily reproduced by changing one of the strings instd/zig/parser_test.zig to make the test fail.

@andrewrk andrewrk added the bug Observed behavior contradicts documented or intended behavior label Mar 31, 2019
@andrewrk andrewrk added this to the 0.5.0 milestone Mar 31, 2019
@andrewrk andrewrk added the standard library This issue involves writing Zig code for the standard library. label Mar 31, 2019
@andrewrk
Copy link
Member

andrewrk commented Mar 31, 2019

It's probably this logic:

zig/std/debug.zig

Lines 216 to 225 in aa794eb

var frame_index: usize = 0;
var frames_left: usize = stack_trace.index;
while (frames_left != 0) : ({
frames_left -= 1;
frame_index = (frame_index + 1) % stack_trace.instruction_addresses.len;
}) {
const return_address = stack_trace.instruction_addresses[frame_index];
try printSourceAtAddress(debug_info, out_stream, return_address, tty_color);
}

Related to this commit: 00d8f4a

Related issue: #1923

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

No branches or pull requests

2 participants