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

Crash when running in a directory containing 8 files #5

Closed
gadanidis opened this issue Jul 13, 2022 · 4 comments
Closed

Crash when running in a directory containing 8 files #5

gadanidis opened this issue Jul 13, 2022 · 4 comments

Comments

@gadanidis
Copy link

When running brn in this git repository after running make, it crashes with the following error:

malloc(): invalid next size (unsorted)
[1]    85812 IOT instruction (core dumped)  brn

The directory looks like this:

.git
.gitignore
brn
brn.c
brn-example.gif
LICENSE
Makefile
README.md

I have not been able to reproduce the error in any other git repositories. The error disappears when any file is removed, or if another file is added to the repository. It does not occur on a fresh clone (with no brn executable) and also does not occur in other directories containing the brn executable. I know nothing about C so I'm not sure what could be causing this or how to debug further.

This is obviously not really affecting my workflow, I just noticed it because after installing I tried to test it out by renaming the readme, and got this error instead.

Thanks for brn, I'm finding it very useful!

@nimaipatel
Copy link
Owner

nimaipatel commented Jul 13, 2022

That's very strange. I'm noticing it on a fresh clone too but not in my original development repository. Thanks for reporting this issue, I'll dig into it.

@gadanidis
Copy link
Author

On further use of brn, I've noticed that this seems to happen in any directory with 8 files/subdirectories, so that's why it only happens in the brn repo after running make, because the resulting directory contains 8 files. I can reliably reproduce with:

mkdir test && cd test
touch 1 2 3 4 5 6 7 8
brn

and

mkdir test && cd test
mkdir 1 2 3 4 5 6 7 8
brn

@gadanidis gadanidis changed the title Crash when running in the brn repository after build Crash when running in a directory containing 8 files Jul 21, 2022
@nimaipatel
Copy link
Owner

nimaipatel commented Jul 22, 2022

The issue seems to arise because of commit ccda59e.
I'll revert it for now and fix the 100 file limit in a while. Once again, thanks a lot for testing and reporting!

@nimaipatel
Copy link
Owner

Fixed in 82ae79d and 454e213.

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