nauty-biplabg gives "sorry, this program doesn't support digraphs yet"

Bug #1903548 reported by Doug Torrance
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nauty (Ubuntu)
Fix Released
Medium
Unassigned
Focal
New
Medium
Unassigned

Bug Description

[Impact]
Running nauty-biplabg in focal always results in an error. In particular, it always complains that a digraph has been input even if this is not the case.

This is due to the following code in nauty:

int
main(int argc, char *argv[])
{
        char *infilename,*outfilename;
        FILE *infile,*outfile;
        boolean badargs,quiet;
 int j,m,n,argnum;
 int codetype,outcode;
 graph *g;
 nauty_counter nin,nout;
        char *arg,sw;
 double t;

[...snip...]

 NODIGRAPHSYET(codetype);

 if (infilename && infilename[0] == '-') infilename = NULL;
 infile = opengraphfile(infilename,&codetype,FALSE,1);
 if (!infile) exit(1);
 if (!infilename) infilename = "stdin";

The NODIGRAPHSYET macro is defined in a header file and is responsible for our error message:

#define NODIGRAPHSYET(code) if (((code)&DIGRAPH6)) \
  gt_abort(">E Sorry, this program doesn't support digraphs yet.\n")

The variable codetype is not initialized until the call to opengraphfile, so if we're unlucky, it might find that DIGRAPH6 bit in whatever piece of memory it's pointing to at the time.

This bug results in build failures when building the computer algebra software Macaulay2 in focal, as one of its packages calls nauty-biplabg when building examples and running tests. See https://github.com/Macaulay2/M2/issues/1408.

This has been fixed in nauty version 2.7 (which is in groovy and hirsute already) by moving the call to NODIGRAPHSYET a few lines lower. See the attached patch.

[Test Case]

* Before:
$ echo 'ES\o' > foo
$ nauty-biplabg -q foo
>E Sorry, this program doesn't support digraphs yet.

* After:
$ echo 'ES\o' > foo
$ nauty-biplabg -q foo
EBz_

[Where problems could occur]
None known. The attached patch is very small.

Further information:
(focal-amd64)root@nimmie:~# lsb_release -rd
Description: Ubuntu 20.04 LTS
Release: 20.04
(focal-amd64)root@nimmie:~# apt-cache policy nauty
nauty:
  Installed: 2.6r10+ds-1ubuntu1
  Candidate: 2.6r10+ds-1ubuntu1
  Version table:
 *** 2.6r10+ds-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
        100 /var/lib/dpkg/status

Tags: focal patch
Revision history for this message
Doug Torrance (profzoom) wrote :
tags: added: focal
Changed in nauty (Ubuntu):
status: New → Fix Released
Revision history for this message
Doug Torrance (profzoom) wrote :

Here is a debdiff with the patch for an SRU:

nauty (2.6r10+ds-1ubuntu2) focal; urgency=medium

  * debian/patches/upstream-biplabg.patch
    - New patch; fix "sorry, this program doesn't support digraphs yet"
      message when running nauty-biplabg (LP: #1903548).

 -- Doug Torrance <email address hidden> Mon, 09 Nov 2020 13:17:32 -0500

Revision history for this message
Doug Torrance (profzoom) wrote :

Switched the status of this bug to "In Progress". I'm not sure if I'm reading the SRU docs correctly -- is this the correct status while waiting for SRU sponsorship?

Changed in nauty (Ubuntu):
status: Fix Released → In Progress
Mathew Hodson (mhodson)
Changed in nauty (Ubuntu):
status: In Progress → Fix Released
importance: Undecided → Medium
Changed in nauty (Ubuntu Focal):
importance: Undecided → Medium
Mathew Hodson (mhodson)
tags: added: patch
Revision history for this message
William Wilson (jawn-smith) wrote :

@profzoom could you update the SRU template [Test Case] section with information on what a successful run after updating the package would look like? I applied your patch but I still see "Sorry, this program doesn't support digraphs yet."

Doug Torrance (profzoom)
description: updated
Revision history for this message
Doug Torrance (profzoom) wrote :

Done! I've updated the test case example so that it actually acts on a specific file in graph6 format, and we see what happens both before and after the patch.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.