[File] newlines break file tests

Christos Zoulas christos at zoulas.com
Mon Aug 26 18:21:51 UTC 2024


They should not have a maximum size. I will take a look.

christos

> On Aug 26, 2024, at 1:19 PM, Alexandre IOOSS <erdnaxe at crans.org> wrote:
> 
> Hello,
> 
> I recently noticed that tests are currently broken on file master branch. `make check` fails on my machine with:
> ```
> TZ=UTC MAGIC=../magic/magic ./test -e ../tests/keyman-2.testfile ../tests/keyman-2.result
> ../tests/keyman-2.testfile: Zip archive data, at least v1.0 to extract, compression method=deflate
> test: ERROR: result was (len 70)
> Zip archive data, at least v1.0 to extract, compression method=deflate
> expected (len 29)
> Keyman Compiled Package File
> make[2]: *** [Makefile:791: check-local] Error 1
> make[2]: Leaving directory '/home/erdnaxe/git/file/tests'
> make[1]: *** [Makefile:667: check-am] Error 2
> make[1]: Leaving directory '/home/erdnaxe/git/file/tests'
> make: *** [Makefile:465: check-recursive] Error 1
> ```
> 
> Reverting commit 3bce3e16ec645be7a012ea9a29ad858510f84d4b makes the test pass, but if you look at the commit it does not really make sense why it would break the test.
> During debugging, I noticed a strange behavior: adding 50 newlines at line 260 in magic/Magdir/archive breaks the tests/keyman-2 test.
> I believe this is a bug in the file magic parser, and this bug is triggered when the magic definitions file is too big.
> 
> Do files under `magic/Magdir/` folder have a maximum size?
> 
> Best regards,
> -- 
> Alexandre
> -- 
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file



More information about the File mailing list