Skip to content

--file-types output is racy #749

@scop

Description

@scop

When running --file-types over a directory containing many files, using several threads, some lines are garbled in the output, apparently because multiple threads output simultaneously. Running with --threads=1 avoids the issue.

An example from running in the checked out https://github.com/scop/bash-completion/tree/master/completions dir, on a box with 2 cores (4 "CPUs"). Output varies between runs, but every one exhibits the same issue.

$ typos --file-types | grep -v ':-$'
./Makefile.am:make
./update-rc.d:d
-
-
./invoke-rc.d:d
./checksec:-./chgrp:
-
./btdownloadheadless.py:py
./apt-get:-./apt-cache:
-
./_umount:./_udevadm-
./vipw:./usermod:--

./tracepath:./tree:--

./rpm2tgz:-./secret-tool:
-
-

The following lines are expected, there should be no other output from the above command.

./Makefile.am:make
./update-rc.d:d
./invoke-rc.d:d
./btdownloadheadless.py:py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions