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

bug report: index overflow cause crash #2504

Closed
Josscii opened this issue Oct 23, 2024 · 6 comments
Closed

bug report: index overflow cause crash #2504

Josscii opened this issue Oct 23, 2024 · 6 comments

Comments

@Josscii
Copy link
Contributor

Josscii commented Oct 23, 2024

if (j < ns - 1 && tokens[j].t1 > tokens[j + 1].t0) {

j is compared with ns, which seems wrong, it should less than n, not ns.

@Josscii
Copy link
Contributor Author

Josscii commented Oct 23, 2024

I do transcribe with turbo model, and it sometimes crash on this line

@Josscii
Copy link
Contributor Author

Josscii commented Oct 23, 2024

@ggerganov

@ggerganov
Copy link
Owner

Thanks for finding this. Would you like to submit a PR?

@Josscii
Copy link
Contributor Author

Josscii commented Oct 23, 2024

I can submit a pr, but I'm don't have a good understanding of the code, I only debuged it here, I'm afraid I would break some code

@ggerganov
Copy link
Owner

The fix is correct. ns is the number of samples, while the j iterator loops over the tokens, not the samples. This check is needed to guarantee that we don't do out-of-bounds access in the tokens array.

@Josscii
Copy link
Contributor Author

Josscii commented Oct 23, 2024

Thanks for your explaination, I'll submit a pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants