gap-packages / anupq

The ANUPQ GAP package
https://gap-packages.github.io/anupq/
Artistic License 2.0
4 stars 6 forks source link

32-bit build hangs with 64-bit GAP #19

Closed olexandr-konovalov closed 7 years ago

olexandr-konovalov commented 7 years ago

Two days ago a new version of bin/BuildPackages.sh script has been merged in https://github.com/gap-system/gap/pull/1128. It's previous version failed to build anupq on a jenkins slave, and now it builds:

==== Checking anupq-3.1.4
Running './configure' 'CFLAGS=-m32' 'LDFLAGS=-m32' '--with-gaproot=/data/gap-jenkins/workspace/GAP-pkg-update-master-quicktest/GAPCOPTS/64build/GAPGMP/gmp/GAPTARGET/packages/label/kovacs/GAP-pkg-update-master-snapshot' 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gawk... (cached) gawk
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether make sets $(MAKE)... (cached) yes
checking for a sed that does not truncate output... /usr/bin/sed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for CONFIGNAME... none
checking for GAP root directory... /data/gap-jenkins/workspace/GAP-pkg-update-master-quicktest/GAPCOPTS/64build/GAPGMP/gmp/GAPTARGET/packages/label/kovacs/GAP-pkg-update-master-snapshot
checking for GAP architecture... x86_64-pc-linux-gnu-gcc-default64
checking for GAP include files... /data/gap-jenkins/workspace/GAP-pkg-update-master-quicktest/GAPCOPTS/64build/GAPGMP/gmp/GAPTARGET/packages/label/kovacs/GAP-pkg-update-master-snapshot/src/compiled.h
checking for GAP config.h... /data/gap-jenkins/workspace/GAP-pkg-update-master-quicktest/GAPCOPTS/64build/GAPGMP/gmp/GAPTARGET/packages/label/kovacs/GAP-pkg-update-master-snapshot/bin/x86_64-pc-linux-gnu-gcc-default64/config.h
checking for GAP's gmp.h location... /data/gap-jenkins/workspace/GAP-pkg-update-master-quicktest/GAPCOPTS/64build/GAPGMP/gmp/GAPTARGET/packages/label/kovacs/GAP-pkg-update-master-snapshot/bin/x86_64-pc-linux-gnu-gcc-default64/extern/gmp/include/gmp.h
checking gmp.h usability... yes
checking gmp.h presence... yes
checking for gmp.h... yes
checking whether linking against GMP works... no
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for pid_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for gethostname... yes
checking for waitpid... yes
checking for wait4... yes
checking for tmpnam... yes
checking for tempnam... yes
checking for strftime... yes
checking for library containing log10... -lm
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
chmod: cannot access 'testPq': No such file or directory
config.status: creating testPq
config.status: creating include/config.h
config.status: executing depfiles commands
Running 'gmake' 'CFLAGS=-m32' 'LOPTS=-m32' 
  CC       src/pq-AllocateSpace.o
...
  CC       src/pq-write.o
  CC       src/pq-main.o
  CCLD     pq
src/pq-TemporaryFile.o: In function `TemporaryFile':
TemporaryFile.c:(.text+0x15): warning: the use of `tempnam' is dangerous, better use `mkstemp'
/usr/bin/mkdir -p ./bin/x86_64-pc-linux-gnu-gcc-default64
cp pq /data/gap-jenkins/workspace/GAP-pkg-update-master-quicktest/GAPCOPTS/64build/GAPGMP/gmp/GAPTARGET/packages/label/kovacs/GAP-pkg-update-master-snapshot/pkg/anupq-3.1.4/bin/x86_64-pc-linux-gnu-gcc-default64
SUCCESS!

file for x86_64-pc-linux-gnu-gcc-default64/pq returns

pq: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=3af1dc742c48269f4f211360c6c0c52251fcbf16, not stripped

However, the test (run via make testpackages) hangs:

Testing anupq 3.1.4, test=/data/gap-jenkins/workspace/GAP-pkg-update-master-quicktest/GAPCOPTS/64build/GAPGMP/gmp/GAPTARGET/packages/label/kovacs/GAP-pkg-update-master-snapshot/pkg/anupq-3.1.4/tst/anupqeg.tst, all packages=false
Build was aborted
olexandr-konovalov commented 7 years ago

I have extracted a reproducible example from tst/anupqeg.tst:

##Example: "Nott-APG-Rel-i" . . . based on: examples/pga_interactive
##Start point for Nottingham group
##Interactive construction of 40 5-groups of order 5^7
LoadPackage("anupq");
F := FreeGroup("a", "b");
rels := ["a^5", "b^5", "[b, a, b]"];
procId := PqStart(F : Prime := 5, Relators := rels);
PqPcPresentation(procId : ClassBound := 3, 
                          OutputLevel := 1);
PqComputePCover(procId);
PqSavePcPresentation(procId, ANUPQData.outfile);
PqPGSupplyAutomorphisms(procId, [ [[1,0,0,0],
                                   [0,1,0,1]],

                                   [[1,1,0,0],
                                    [0,1,0,1]],

                                   [[1,0,0,0],
                                    [0,4,0,0]],

                                   [[1,0,0,0],
                                    [0,2,0,0]],

                                   [[4,0,0,0],
                                    [0,1,0,0]],

                                   [[2,0,0,0],
                                    [0,1,0,0]] ]);
PqPGConstructDescendants(procId : ClassBound := 4,
                                   CapableDescendants,
                                   StepSize := 1,
                                   PcgsAutomorphisms,
                                   RankInitialSegmentSubgroups := 4);

PqPGSetDescendantToPcp(procId, 4, 1);
PqAPGDegree(procId, 2, 3);
PqAPGPermutations(procId);
PqAPGOrbits(procId : CustomiseOutput := rec(orbit := [1]));
PqAPGOrbitRepresentatives(procId);
PqPGSetDescendantToPcp(procId);
PqDisplayPcPresentation(procId);

PqAPGSingleStage(procId : StepSize:=2, BasicAlgorithm, 
                          CustomiseOutput := rec());

This input runs instantly on my laptop when GAP is built in 64 bit mode, and on the Jenkins node when GAP is built in 32 bit mode. However, it hangs forever on the same Jenkins node when GAP is built in 64-bit mode. Pressing Ctrl-C shows the following:

^CError, user interrupt in
  moreOfline := ReadLine( iostream )
 ; at /data/gap-jenkins/workspace/GAP-major-release-test/GAPCOPTS/64build/GAPTARGET/packages/label/kovacs/gap4r9/lib/streams.gi:169 called from 
ReadAllLine( iostream, true, IS_ALL_PQ_LINE 
 ) at /data/gap-jenkins/workspace/GAP-major-release-test/GAPCOPTS/64build/GAPTARGET/packages/label/kovacs/gap4r9/pkg/anupq-3.1.4/lib/anupqios.gi:389 calle\
d from
PQ_READ_NEXT_LINE( datarec.stream 
 ) at /data/gap-jenkins/workspace/GAP-major-release-test/GAPCOPTS/64build/GAPTARGET/packages/label/kovacs/gap4r9/pkg/anupq-3.1.4/lib/anupqios.gi:469 calle\
d from
FILTER_PQ_STREAM_UNTIL_PROMPT( datarec 
 ); at /data/gap-jenkins/workspace/GAP-major-release-test/GAPCOPTS/64build/GAPTARGET/packages/label/kovacs/gap4r9/pkg/anupq-3.1.4/lib/anupqios.gi:630 call\
ed from
ToPQ( datarec, [ 5 ], [ "  #single stage" ] 
 ); at /data/gap-jenkins/workspace/GAP-major-release-test/GAPCOPTS/64build/GAPTARGET/packages/label/kovacs/gap4r9/pkg/anupq-3.1.4/lib/anupqi.gi:2924 calle\
d from
PQ_PG_CONSTRUCT_DESCENDANTS( datarec 
 ); at /data/gap-jenkins/workspace/GAP-major-release-test/GAPCOPTS/64build/GAPTARGET/packages/label/kovacs/gap4r9/pkg/anupq-3.1.4/lib/anupqi.gi:3084 calle\
d from
...  at *stdin*:44
you can 'return;'
brk> 
fingolfin commented 7 years ago

The actual reason for the hang was this line in the configure output: "checking whether linking against GMP works... no" -- the result was that ANUPQ was built w/o GMP support. Which mostly works, but it disabled one "question" by the anupq menu system, which then broken certain anupq commands, resulting in this hang.

Fixed in ffe7839e6d70e2d944b65238ba82c819376433aa