biber hangs forever when a name list contains an empty name (e.g. `author = {Doe, Jane and ,}`)

Open Beginner friendly
#520 3 comments 0 reactions 1 assignee View on GitHub

@plk is already working on this.

Since Oct 25, 2026.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
69/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
latex, perl
Domain
backend, databases

Research direction

Start with Biber::DataList::set_uniquename in lib/Biber/DataList.pm and inspect how it marks uniqueness data as changed when the current value is undefined. Reproduce the hang with the minimal test.bib example and run the relevant Biber test suite; done means malformed names terminate and produce a .bbl without changing output for existing cases.

Written by the indexing model from the issue text.

Description

Bug fixedindev

🤖 This issue was identified by Claude Opus 5.5, and the text below is entirely written by Claude Opus 5.5

biber never terminates when a name in the labelname list has no name parts. The .bbl stays empty, and nothing is written to the log after the data source is read. A stray comma in a name list is enough, which is easy to get from exported or hand-edited .bib files.

Minimal example

test.bib:

@misc{key,
  author = {Doe, Jane and ,},
  title  = {Title},
}

test.tex:

\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\addbibresource{test.bib}
\begin{document}
\cite{key}
\printbibliography
\end{document}

pdflatex test && biber test: biber 2.22 (TeX Live 2026, macOS) is still running when killed after 30 seconds. The last log line is Found BibTeX data source 'test.bib', and test.bbl is left empty.

Other inputs that hang the same way:

  • author = {,};
  • author = {family=Doe, given="Ja};
  • a granular XDATA reference to a missing entry, author = {xdata=missing-author}.
Cause

In Biber::generate_uniquename, a name with no name parts has empty namestrings and namedisschema. So it ends up calling

$dlist->set_uniquename($nlid, $nid, $namedisschema->[0])   # undef

and Biber::DataList::set_uniquename sets the "changed" flag whenever the current value is undefined:

if (not defined($currval) or not Compare($currval, $s)) {
  $self->set_unul_changed(1);
}

The stored value stays undef, so every pass of the while ('true') loop in Biber::uniqueness sees a change and runs again.

Suggested fix

Data::Compare already treats undef/undef as equal and undef/value as different, so the defined test can go:

--- a/lib/Biber/DataList.pm
+++ b/lib/Biber/DataList.pm
@@ -495,7 +495,7 @@
 
   my $currval = $self->{state}{namelistdata}{$nlid}{$nid}{un};
   # Set modified flag to positive if we changed something
-  if (not defined($currval) or not Compare($currval, $s)) {
+  if (not Compare($currval, $s)) {
     $self->set_unul_changed(1);
   }
   $self->{state}{namelistdata}{$nlid}{$nid}{un} = $s;

With this change, all of the inputs above terminate and produce a .bbl. I also ran the patched biber (from source, perl 5.42) over 776 test documents: the biblatex example files, the biber test suite's control files, and documents for the standard and contributed styles. The output was byte-identical to unpatched 2.22 in every case.

The code is unchanged on dev (df6438f). As an extra safeguard, the loop in Biber::uniqueness could also stop with a warning after some large number of passes, since real documents converge in two or three.

Dominant language
TeX
Stars
396
Forks
40
Avg merge
8h 3m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from plk/biber

All issues in plk/biber

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.