squaresLab / ManyBugs

16 stars 7 forks source link

Cannot build subset of the PHP scenarios #13

Open afsafzal opened 6 years ago

afsafzal commented 6 years ago

I cannot build php scenarios. Tried a couple and all result in this:

mv: cannot create hard link '/experiment/bug-info/scenario-data.txt' to '/experiment/000000/main': Operation not permitted
mv: cannot create hard link '/experiment/bug-info/log-msg.txt' to '/experiment/000000/main/streams': Operation not permitted

mv: will not create hard link '/experiment/fixed/main' to directory '/experiment/diffs/main'

mv: will not create hard link '/experiment/preprocessed/main' to directory '/experiment/php/ext'

Traceback (most recent call last):
  File "/home/afsoon/BugZoo/bin/bugzoo", line 9, in <module>
    load_entry_point('bugzoo==2.0.3', 'console_scripts', 'bugzoo')()
  File "/home/afsoon/BugZoo/lib/python3.5/site-packages/bugzoo/cli/__init__.py", line 503, in main
    args.func(args)
  File "/home/afsoon/BugZoo/lib/python3.5/site-packages/bugzoo/cli/__init__.py", line 465, in <lambda>
    cmd.set_defaults(func=lambda args: build_bug(rbox, args.bug, args.force))
  File "/home/afsoon/BugZoo/lib/python3.5/site-packages/bugzoo/cli/__init__.py", line 79, in build_bug
    rbox.bugs.build(bug, force=force)
  File "/home/afsoon/BugZoo/lib/python3.5/site-packages/bugzoo/mgr/bug.py", line 82, in build
    quiet=quiet)
  File "/home/afsoon/BugZoo/lib/python3.5/site-packages/bugzoo/mgr/build.py", line 124, in build
    raise ImageBuildFailed(name, log)
bugzoo.core.errors.ImageBuildFailed: squareslab/manybugs:php-2011-12-10-74343ca506-52c36e60c4
ChrisTimperley commented 6 years ago

Can you give me a list of the PHP scenarios that you couldn't build? This looks like the same issue that Manish dealt with. We just need to add a script to fix some of the symbolic links in the original ManyBugs archives.

ChrisTimperley commented 6 years ago

This is the same issue as #3

afsafzal commented 6 years ago

manybugs:php:2011-12-10-74343ca506-52c36e60c4 manybugs:php:2011-01-30-5bb0a44e06-1e91069eb4 manybugs:php:2011-01-09-7c6310852e-478e5d1dd0 manybugs:php:2011-03-20-2034e14341-7f2937223d

afsafzal commented 6 years ago

Seriously, it's all php. I just pick any at random and they all fail.

ChrisTimperley commented 6 years ago

Ok. I'll look into this, but as I mentioned above, whether or not it's started happening to all of the scenarios, it looks like the same bug that Manish dealt with. It would save some time if he could share his script for fixing the sym. links.

ChrisTimperley commented 6 years ago

I get this output for manybugs:php-2011-12-10-74343ca506-52c36e60c4

Generating phar.php
/bin/sh: line 1: 15236 Segmentation fault      (core dumped) ` if test -x "/experiment/src/sapi/cli/php"; then /experiment/src/build/shtool echo -n -- "/experiment/src/sapi/cli/php -n"; if test "x" != "x"; then /experiment/src/build/shtool echo -n -- " -d extension_dir=/experiment/src/modules"; for i in bz2 zlib phar; do if test -f "/experiment/src/modules/$i.la"; then . /experiment/src/modules/$i.la; /experiment/src/build/shtool echo -n -- " -d extension=$dlname"; fi; done; fi; else /experiment/src/build/shtool echo -n -- "/experiment/src/sapi/cli/php"; fi;` -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0 -d 'safe_mode=0' /experiment/src/ext/phar/build_precommand.php > ext/phar/phar.php

make: *** [ext/phar/phar.php] Error 139

Traceback (most recent call last):
  File "/experiment/prepare.py", line 81, in <module>

    cmd('cd /experiment/src && make -j{}'.format(multiprocessing.cpu_count()))

  File "/experiment/prepare.py", line 45, in cmd
    subprocess.check_call(cmd, shell=True)

  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call

    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError
: Command 'cd /experiment/src && make -j8' returned non-zero exit status 2

It looks like that one needs to be added to the list of bugs that have PHAR issues.

I'll keep trying the others.

ChrisTimperley commented 6 years ago

manybugs:php:2011-01-30-5bb0a44e06-1e91069eb4 builds for me.

ChrisTimperley commented 6 years ago

Please could you dump the output of bugzoo source list for me, @afsafzal?

afsafzal commented 6 years ago

Source          Type    URL                                               Location                                                               Version
--------------  ------  ------------------------------------------------  ---------------------------------------------------------------------  ---------
ardu-demo-bugs  Remote  https://github.com/ChrisTimperley/ardu-demo-bugs  /home/afsoon/.bugzoo/sources/github_com_ChrisTimperley_ardu-demo-bugs  bf0fcf21
manybugs        Remote  https://github.com/squaresLab/ManyBugs            /home/afsoon/.bugzoo/sources/github_com_squaresLab_ManyBugs            f414f466
ChrisTimperley commented 6 years ago

We're definitely building using the exact same instructions and files, so I guess that there's some issue with building the Docker image that only arises on the server (Docker is designed to avoid those problems, but it doesn't always manage to ;-)).

I'll take a look into this later this evening. If you need to use the images before then, I suggest that you remove that source, and instead clone this ManyBugs repository to your machine and add it as a local source:

bugzoo source remove manybugs
git clone --depth 1 https://github.com/squaresLab/ManyBugs /home/afsoon/manybugs
bugzoo source add manybugs /home/afsoon/manybugs

You can then try to tweak php/Dockerfile.bug to localise the failing command and to print some extra debugging information. You could also try to do this before rebuilding:

$ docker rmi -f squareslab/manybugs-php

Also, try to remove any dangling images.

ChrisTimperley commented 6 years ago

I can confirm that I get the same error when I run BugZoo on the squaresLab server. I'll try to pinpoint the failure to a single bash statement within the failing RUN command.

ChrisTimperley commented 6 years ago

It looks like a bug in AUFS: https://github.com/moby/moby/issues/4570

joerenzullo commented 5 years ago

I can confirm that AUFS was the culprit for this issue. I ran into it also, then changed the storage driver Docker uses to Overlay2 and it resolved for most PHP bugs which now run properly.