Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cygwin] "make check" fails #15

Closed
tueda opened this issue Jun 11, 2014 · 1 comment
Closed

[cygwin] "make check" fails #15

tueda opened this issue Jun 11, 2014 · 1 comment

Comments

@tueda
Copy link
Collaborator

tueda commented Jun 11, 2014

Here I just record what I encountered for make check within Cygwin 1.7.30 (both x86_64 and i686) on Windows 7 (SP1, x86_64):

make  check-TESTS
make[1]: Entering directory '/home/tueda/tmp/form-4.1/check'
Run options:

# Running tests:

EEEEEEE./form.rb:87: [BUG] Segmentation fault
ruby 1.9.3p545 (2014-02-24) [x86_64-cygwin]

-- Control frame information -----------------------------------------------
c:0026 p:---- s:0108 b:0108 l:000107 d:000107 CFUNC  :close
c:0025 p:0233 s:0105 b:0105 l:000ae0 d:000ae0 METHOD ./form.rb:87
c:0024 p:0018 s:0093 b:0093 l:000092 d:000092 METHOD /home/tueda/tmp/form-4.1/check/examples.rb:1070
c:0023 p:0073 s:0090 b:0090 l:000089 d:000089 METHOD /usr/lib/ruby/1.9.1/minitest/unit.rb:949
c:0022 p:0025 s:0084 b:0084 l:000083 d:000083 METHOD /usr/lib/ruby/1.9.1/test/unit/testcase.rb:17
c:0021 p:0090 s:0080 b:0080 l:000068 d:000079 BLOCK  /usr/lib/ruby/1.9.1/minitest/unit.rb:787
c:0020 p:---- s:0074 b:0074 l:000073 d:000073 FINISH
c:0019 p:---- s:0072 b:0072 l:000071 d:000071 CFUNC  :map
c:0018 p:0124 s:0069 b:0069 l:000068 d:000068 METHOD /usr/lib/ruby/1.9.1/minitest/unit.rb:780
c:0017 p:0020 s:0061 b:0060 l:000050 d:000059 BLOCK  /usr/lib/ruby/1.9.1/test/unit.rb:565
c:0016 p:---- s:0056 b:0056 l:000055 d:000055 FINISH
c:0015 p:---- s:0054 b:0054 l:000053 d:000053 CFUNC  :each
c:0014 p:0053 s:0051 b:0051 l:000050 d:000050 METHOD /usr/lib/ruby/1.9.1/test/unit.rb:563
c:0013 p:0189 s:0045 b:0045 l:000044 d:000044 METHOD /usr/lib/ruby/1.9.1/minitest/unit.rb:746
c:0012 p:0013 s:0035 b:0035 l:000034 d:000034 METHOD /usr/lib/ruby/1.9.1/minitest/unit.rb:909
c:0011 p:0012 s:0032 b:0032 l:000023 d:000031 BLOCK  /usr/lib/ruby/1.9.1/minitest/unit.rb:896
c:0010 p:---- s:0029 b:0029 l:000028 d:000028 FINISH
c:0009 p:---- s:0027 b:0027 l:000026 d:000026 CFUNC  :each
c:0008 p:0068 s:0024 b:0024 l:000023 d:000023 METHOD /usr/lib/ruby/1.9.1/minitest/unit.rb:895
c:0007 p:0029 s:0020 b:0020 l:000019 d:000019 METHOD /usr/lib/ruby/1.9.1/minitest/unit.rb:884
c:0006 p:0022 s:0016 b:0016 l:000015 d:000015 METHOD /usr/lib/ruby/1.9.1/test/unit.rb:21
c:0005 p:0033 s:0012 b:0011 l:0012e8 d:000010 BLOCK  /usr/lib/ruby/1.9.1/test/unit.rb:326
c:0004 p:0036 s:0009 b:0009 l:000008 d:000008 METHOD /usr/lib/ruby/1.9.1/test/unit.rb:27
c:0003 p:0026 s:0006 b:0006 l:0012e8 d:000005 BLOCK  /usr/lib/ruby/1.9.1/test/unit.rb:325
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0005c8 d:0005c8 TOP

-- Ruby level backtrace information ----------------------------------------
/usr/lib/ruby/1.9.1/test/unit.rb:325:in `block in autorun'
/usr/lib/ruby/1.9.1/test/unit.rb:27:in `run_once'
/usr/lib/ruby/1.9.1/test/unit.rb:326:in `block (2 levels) in autorun'
/usr/lib/ruby/1.9.1/test/unit.rb:21:in `run'
/usr/lib/ruby/1.9.1/minitest/unit.rb:884:in `run'
/usr/lib/ruby/1.9.1/minitest/unit.rb:895:in `_run'
/usr/lib/ruby/1.9.1/minitest/unit.rb:895:in `each'
/usr/lib/ruby/1.9.1/minitest/unit.rb:896:in `block in _run'
/usr/lib/ruby/1.9.1/minitest/unit.rb:909:in `run_tests'
/usr/lib/ruby/1.9.1/minitest/unit.rb:746:in `_run_anything'
/usr/lib/ruby/1.9.1/test/unit.rb:563:in `_run_suites'
/usr/lib/ruby/1.9.1/test/unit.rb:563:in `each'
/usr/lib/ruby/1.9.1/test/unit.rb:565:in `block in _run_suites'
/usr/lib/ruby/1.9.1/minitest/unit.rb:780:in `_run_suite'
/usr/lib/ruby/1.9.1/minitest/unit.rb:780:in `map'
/usr/lib/ruby/1.9.1/minitest/unit.rb:787:in `block in _run_suite'
/usr/lib/ruby/1.9.1/test/unit/testcase.rb:17:in `run'
/usr/lib/ruby/1.9.1/minitest/unit.rb:949:in `run'
/home/tueda/tmp/form-4.1/check/examples.rb:1070:in `test1'
./form.rb:87:in `execute'
./form.rb:87:in `close'

-- Other runtime information -----------------------------------------------

* Loaded script: ./form.rb

* Loaded features:

    0 enumerator.so
    1 /usr/lib/ruby/1.9.1/x86_64-cygwin/enc/encdb.so
    2 /usr/lib/ruby/1.9.1/x86_64-cygwin/enc/shift_jis.so
    3 /usr/lib/ruby/1.9.1/x86_64-cygwin/enc/trans/transdb.so
    4 /usr/lib/ruby/1.9.1/rubygems/defaults.rb
    5 /usr/lib/ruby/1.9.1/x86_64-cygwin/rbconfig.rb
    6 /usr/lib/ruby/1.9.1/rubygems/deprecate.rb
    7 /usr/lib/ruby/1.9.1/rubygems/exceptions.rb
    8 /usr/lib/ruby/1.9.1/rubygems/custom_require.rb
    9 /usr/lib/ruby/1.9.1/rubygems.rb
   10 /usr/lib/ruby/1.9.1/open3.rb
   11 /usr/lib/ruby/1.9.1/optparse.rb
   12 /usr/lib/ruby/1.9.1/minitest/unit.rb
   13 /usr/lib/ruby/1.9.1/prettyprint.rb
   14 /usr/lib/ruby/1.9.1/pp.rb
   15 /usr/lib/ruby/1.9.1/test/unit/assertions.rb
   16 /usr/lib/ruby/1.9.1/test/unit/testcase.rb
   17 /usr/lib/ruby/1.9.1/test/unit.rb
   18 /home/tueda/tmp/form-4.1/check/examples.rb
   19 /home/tueda/tmp/form-4.1/check/parser.rb
   20 /home/tueda/tmp/form-4.1/check/symmetrize.rb
   21 /home/tueda/tmp/form-4.1/check/table.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

/bin/sh: line 5:  6516 Aborted                 (core dumped) /usr/bin/ruby -I . ${dir}$tst
FAIL: form.rb
===============================
1 of 1 test failed
Please report to form@nikhef.nl
===============================
Makefile:294: recipe for target 'check-TESTS' failed

There are two problems:

  • The behaviour of strace differs from that on Linux. It just ignores the -ff option. Moreover, the system call exit_group is not called on Cygwin, so the return_value method always fails.
  • The test program Sec_15 takes about 10 seconds under the strace run. (The output looks OK.) So the form.rb often tries to kill the process due to TIMEOUT=10, and somehow causes a segfault of Ruby at closing @outputstream (maybe still used by the process being killed?).
@tueda tueda mentioned this issue Aug 22, 2014
tueda added a commit to tueda/form that referenced this issue Sep 1, 2015
Motivations:
- The old test suite depended on strace utility, so did not work on
  OS X and Cygwin (vermaseren#15).
- ParFORM support should be added.
- Writing Ruby classes for test cases still seems to set a high bar.

How to run:
- From Autoconf/automake build system:

    $ make check

- Standalone mode:

    $ ./check/check.rb [/path/to/form]

  By default, "*.frm" files in the "check" directory are used for the
  test, where each test case is supposed to finish within 10 seconds.
  Test cases requiring more time can be put in subdirectories. To run
  them:

    $ ./check/check.rb -C subdir -t 100

  where "-t 100" sets the timeout to 100 seconds.

New Format:
- Small Ruby code for assertions is embedded into FORM code (*.frm).
- Test files look something like:

    #ifndef `TEST'
      #message Use -D TEST=XXX
      #terminate
    #else
      #include `NAME_' # `TEST'
    #endif
    .end
    *--#[ Test1 :
      S x;
      L F = (1+x)^2;
      P;
      .end
      assert succeeded?
      assert result("F") =~ expr("1 + 2*x + x^2")
    *--#] Test1 :

  Each fold corresponds to a test case. Ruby code for assertions are
  written after ".end".
- One can also run the above test case directly from FORM (with its file
  name "test.frm"):

    $ form -D TEST=Test1 test.frm

  although the assertions written in Ruby are not checked. Note that
  FORM just ignores lines after ".end".
tueda added a commit to tueda/form that referenced this issue Sep 1, 2015
Motivations:
- The old test suite depended on strace utility, so did not work on
  OS X and Cygwin (vermaseren#15).
- ParFORM support should be added.
- Writing Ruby classes for test cases still seems to set a high bar.

How to run:
- From Autoconf/automake build system:

    $ make check

- Standalone mode:

    $ ./check/check.rb [/path/to/form]

  By default, "*.frm" files in the "check" directory are used for the
  test, where each test case is supposed to finish within 10 seconds.
  Test cases requiring more time can be put in subdirectories. To run
  them:

    $ ./check/check.rb -C subdir -t 100

  where "-t 100" sets the timeout to 100 seconds.

New Format:
- Small Ruby code for assertions is embedded into FORM code (*.frm).
- Test files look something like:

    #ifndef `TEST'
      #message Use -D TEST=XXX
      #terminate
    #else
      #include `NAME_' # `TEST'
    #endif
    .end
    *--#[ Test1 :
      S x;
      L F = (1+x)^2;
      P;
      .end
      assert succeeded?
      assert result("F") =~ expr("1 + 2*x + x^2")
    *--#] Test1 :

  Each fold corresponds to a test case. Ruby code for assertions are
  written after ".end".
- For many of test cases, checking whether FORM finished successfully
  and checking results in expressions are enough. In the above Ruby
  code, `succeeded?` gives true if FORM finished with the exit status 0,
  `result("F")` gives the string representation of the expression "F"
  (lastly printed by Print statement), and `expr("1 + 2*x + x^2")` is
  a pattern to be matched with the whole expression (whitespace
  including new lines are ignored).
- One can also run the above test case directly from FORM (with its file
  name "test.frm"):

    $ form -D TEST=Test1 test.frm

  although the assertions written in Ruby are not checked. Note that
  FORM just ignores lines after ".end".
@tueda
Copy link
Collaborator Author

tueda commented Sep 1, 2015

The new test suite seems to work, except the cases memory allocations fail or timeout. (I got failures with "No memory while allocating" or timeouts on my laptop, especially for 64-bit tform.) So I would close this issue.

@tueda tueda closed this as completed Sep 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant