• Bug#1101989: libconfig-model-dpkg-perl: scan-copyrights crashes on esli

    From Walter Lozano@21:1/5 to All on Thu Apr 3 18:10:01 2025
    Package: libconfig-model-dpkg-perl
    Version: 3.012
    Severity: normal

    Dear Maintainer,

    While running scan-copyrights on eslint the following error is triggered:

    malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "\x{feff}{\n "priv...") at /usr/share/perl5/JSON.pm line 190, <$pipe> line 1477.

    The issue seems to be triggered by invalid json files
    - tests/fixtures/config-file/broken-package-json/package.json
    - tests/fixtures/ignored-paths/broken-package-json/package.json

    Also file tests/fixtures/config-file/bom/package.json makes he tool to crash but due to different reasons.

    Thanks in advance!


    -- System Information:
    Debian Release: trixie/sid
    APT prefers noble-updates
    APT policy: (500, 'noble-updates'), (500, 'noble-security'), (500, 'noble'), (100, 'noble-backports')
    Architecture: amd64 (x86_64)
    Foreign Architectures: i386

    Kernel: Linux 6.8.0-53-generic (SMP w/8 CPU threads; PREEMPT)
    Kernel taint flags: TAINT_FIRMWARE_WORKAROUND, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
    Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
    Shell: /bin/sh linked to /usr/bin/dash
    Init: systemd (via /run/systemd/system)
    LSM: AppArmor: enabled

    Versions of packages libconfig-model-dpkg-perl depends on:
    ii debhelper 13.14.1ubuntu5
    ii libapt-pkg-perl 0.1.40build7
    ii libarray-intspan-perl 2.004-2
    ii libconfig-model-backend-yaml-perl 2.134-2
    ii libconfig-model-perl 2.153-3
    ii libexporter-lite-perl 0.09-2
    ii liblog-log4perl-perl 1.57-1
    ii libmouse-perl 2.5.10-1build8
    ii libparse-debcontrol-perl 2.005-6
    ii libparse-recdescent-perl 1.967015+dfsg-4
    ii libsoftware-copyright-perl 0.012-2
    ii libsoftware-licensemoreutils-perl 1.009-1
    ii libsort-versions-perl 1.62-3
    ii libtext-autoformat-perl 1.750000-2
    ii libtext-levenshtein-damerau-perl 0.41-3
    ii libtoml-tiny-perl 0.16-1
    ii liburi-perl 5.27-1
    ii libwww-perl 6.76-1
    ii libyaml-pp-perl 0.38.0-1
    ii licensecheck 3.3.9-1ubuntu1
    ii lintian 2.117.0ubuntu1.2
    ii perl [libmodule-corelist-perl] 5.38.2-3.2build2.1

    Versions of packages libconfig-model-dpkg-perl recommends:
    ii libconfig-model-tkui-perl 1.379-1

    libconfig-model-dpkg-perl suggests no packages.

    -- no debconf information

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dominique Dumont@21:1/5 to All on Sat Apr 5 18:10:01 2025
    On Thursday, 3 April 2025 18:03:59 Central European Summer Time you wrote:
    While running scan-copyrights on eslint the following error is triggered:

    malformed JSON string, neither tag, array, object, number, string or atom,
    at character offset 0 (before "\x{feff}{\n "priv...") at /usr/share/perl5/JSON.pm line 190, <$pipe> line 1477.

    The issue seems to be triggered by invalid json files
    - tests/fixtures/config-file/broken-package-json/package.json
    - tests/fixtures/ignored-paths/broken-package-json/package.json

    Like #1101988, you must configure cme to skip these files. See https://github.com/dod38fr/config-model/wiki/Updating-debian-copyright-file-with-cme#filling-missing-information
    https://manpages.debian.org/buster/libconfig-model-dpkg-perl/Dpkg::Copyright::Scanner.3pm.en.html#Filling_the_blanks

    Also file tests/fixtures/config-file/bom/package.json makes he tool to crash but due to different reasons.

    This file contain non printable characters (eb bb bf) before the first {, so it cannot be parsed by JSON module:
    $ hexdump -C tests/fixtures/config-file/bom/package.json
    00000000 ef bb bf 7b 0a 20 20 20 20 22 70 72 69 76 61 74 |...{. "privat| 00000010 65 22 3a 20 74 72 75 65 2c 0a 20 20 20 20 22 6e |e": true,. "n| 00000020 61 6d 65 22 3a 20 22 65 73 6c 69 6e 74 2d 74 65 |ame": "eslint-te| 00000030 73 74 22 2c 0a 20 20 20 20 22 76 65 72 73 69 6f |st",. "versio| 00000040 6e 22 3a 20 22 30 2e 30 2e 30 22 2c 0a 20 20 20 |n": "0.0.0",. | 00000050 20 22 65 73 6c 69 6e 74 43 6f 6e 66 69 67 22 3a | "eslintConfig":| 00000060 20 7b 0a 20 20 20 20 20 20 20 20 22 72 75 6c 65 | {. "rule| 00000070 73 22 3a 20 7b 0a 20 20 20 20 20 20 20 20 20 20 |s": {. | 00000080 20 20 22 73 65 6d 69 22 3a 20 22 65 72 72 6f 72 | "semi": "error| 00000090 22 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 |". }. | 000000a0 7d 0a 7d 0a |}.}.|
    000000a4

    You must add a skip instruction in debian/fill.copyright.blanks.yml to skip this file

    All the best

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)