Skip to content

tc_generic_method.pl has been syntactically invalid since 9f024eae8 — every structural method (3D-Coffee, Expresso, TMalign_pair) aborts #74

Description

@mmokrejs

lib/perl/lib/scripts/tc_generic_method.pl does not compile. Three stray
characters (ata) are glued to the front of the elsif on line 2689:

      &safe_system ($command);
  }
ata	elsif ( $SERVER eq "LOCAL_blastall")
  {
    &check_configuration ("blastall");

Because T-Coffee writes this script out at run time and executes it, every
pairwise structural method dies before doing any work.

Reproducing it — no build required

$ wget https://github.com/cbcrg/tcoffee/archive/refs/tags/Version_13.46.2.7c9e712d.tar.gz
$ tar xzf ...
$ perl -c tcoffee-Version_13.46.2.7c9e712d/lib/perl/lib/scripts/tc_generic_method.pl
syntax error at .../tc_generic_method.pl line 2689, near "ata	elsif"
.../tc_generic_method.pl had compilation errors.

grep -n '^ata' lib/perl/lib/scripts/tc_generic_method.pl → one hit, line 2689.

What a user sees

Building from source and running any structural method:

$ t_coffee seqs.fasta -method TMalign_pair,proba_pair -template_file templates.txt \
      -output fasta_aln -outfile out.aln
syntax error at .../tco/tcohj5u9adn2000597/396232000699i326y453.pl line 2686, near "ata	elsif"
Execution of .../396232000699i326y453.pl aborted due to compilation errors.
...
2000725 -- ERROR: UNSPECIFIED UNSPECIFIED
2000725 -- COM: .../396232000697i326y452.pl -mode=pdb_pair -method=TMalign ...
# TERMINATION STATUS: FAILURE

(The generated copy reports line 2686 rather than 2689 because the emitted
file has a slightly different header.)

Where it came from

Introduced by commit
9f024eae8 (2024-12-03,
"fixed -outfile=stdout/stderr in regressive, and unrealeased for PDBs"). The
diff for this hunk is exactly:

-	elsif ( $SERVER eq "LOCAL_blastall")
+ata	elsif ( $SERVER eq "LOCAL_blastall")

It looks like an accidental keystroke rather than an intended edit. That is the
most recent commit touching the file, and the corruption is still present in
master
(verified 2026-08-13 through the GitHub contents API).

Why a correct build still ships it

compile/makefile:216-219 copies the file and appends a version line:

tc_generic_method.pl:\
	$(SCRIPT_LIB)/tc_generic_method.pl
	cp $(SCRIPT_LIB)/tc_generic_method.pl .
	echo "my $(dollar)program=$(quote)$(PROGRAM) ($(VERSION))$(quote);">> tc_generic_method.pl

It is then embedded as a C string in perl_header_lib.h and written out at run
time. The lib/data_headers/perl_header_lib.h in the tarball is only a
435-byte stub; the real 540 KB header is generated during the build, and the
built copy contains ata\telsif. So the build is faithful — the input is bad,
and nothing in the build or test path catches it.

Suggested fix

Delete the three characters. After that the file is syntax OK with no other
change:

-ata	elsif ( $SERVER eq "LOCAL_blastall")
+	elsif ( $SERVER eq "LOCAL_blastall")

It might also be worth adding perl -c over lib/perl/lib/scripts/*.pl as a
CI step — this class of defect is invisible until the script is executed, and
tc_generic_method.pl is only executed on the structural/BLAST paths, which
appear not to be exercised by the current tests.

Not affected

Debian's packaged 13.41.0 (Version_13.41.0.28bdc39, Build 465) does not
contain the corrupt string and runs the same commands correctly.

Environment

  • T-Coffee Version_13.46.2.7c9e712d, built from
    tcoffee-13.46.2.7c9e712d.tar.gz
    (sha256 8ccbbf03ecaf3e5e3043db11ef9594bbebfe99fd9353890740c58d2623b3f1b7,
    37 801 295 bytes)
  • Debian GNU/Linux 13 (trixie), kernel 6.12.101+deb13-amd64
  • perl v5.40.1

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com

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