ashvardanian / ashvardanian/StringZilla

Bug: Crash with sz::argsort

Open
#337 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
3.6k
Forks
135
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

I read this file to Vec, after call fn

```Rust
pub fn sz_упорядочить_ряд_строк(ряд: Vec) -> Vec {
match ряд.len() {
0 => return ряд,
_ => (),
}
let mut порядок: Vec = vec![0; ряд.len()];
match sz::argsort(&ряд, &mut порядок, Default::default()) {
Ok(успех) => успех,
Err(ошибка) => panic!("Ошибка |{:?}|", ошибка),
};
let mut новый_ряд: Vec = Vec::new();
for число in порядок.into_iter() {
новый_ряд.push(ряд[число].clone());
}
return новый_ряд;
}
```
after
thread '' (10800) has overflowed its stack

### Steps to reproduce

1.read file to vec
2.call fn sz_упорядочить_ряд_строк

### Expected behavior

[Импеданс – как он рассчитывается и почему он важен_ _ Transfer Multisort Elektronik Ukraine.html](https://github.com/user-attachments/files/31143189/_._.Transfer.Multisort.Elektronik.Ukraine.html)

### StringZilla version

5.1.2

### Operating System

Windows 11

### Hardware architecture

x86

### Which interface are you using?

C implementation

### Contact Details

_No response_

### Are you open to being tagged as a contributor?

- [x] I am open to being mentioned in the project `.git` history as a contributor

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Research direction

Start at the sz::argsort call in the provided sz_упорядочить_ряд_строк function and reproduce the stack overflow using the attached HTML converted to Vec. Trace whether the failure is specific to the Rust call or the C implementation, and consider the issue done when this input sorts without overflowing the stack and the expected ordering is returned.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, rust
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.