Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 626902

Summary: dev-util/coccinelle-1.0.6 : sandbox issue
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED OBSOLETE    
Severity: normal CC: cJ-gentoo, emilianmedve, gabemarcano, naota
Priority: Normal Keywords: PMASKED
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Deadline: 2020-09-02   
Attachments: emerge-info.txt
dev-util:coccinelle-1.0.6:20170802-165318.log
emerge-history.txt
environment
etc.portage.tbz2
logs.tbz2
sandbox-10062.log
temp.tbz2
coccinelle_pcre.patch

Description Toralf Förster gentoo-dev 2017-08-02 17:27:11 UTC
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.0_20170731-194316

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-6.3.0 *

Available Python interpreters, in order of preference:
  [1]   python3.4
  [2]   python3.5 (fallback)
  [3]   python2.7 (fallback)
Available Ruby profiles:
  [1]   ruby21 (with Rubygems) *
  [2]   ruby22 (with Rubygems)



emerge -qpv dev-util/coccinelle
[ebuild  N    ] dev-util/coccinelle-1.0.6  USE="ocamlopt pcre -doc -emacs -ocaml -python {-test} -vim-syntax" PYTHON_TARGETS="python2_7"
Comment 1 Toralf Förster gentoo-dev 2017-08-02 17:27:14 UTC
Created attachment 487730 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2017-08-02 17:27:17 UTC
Created attachment 487732 [details]
dev-util:coccinelle-1.0.6:20170802-165318.log
Comment 3 Toralf Förster gentoo-dev 2017-08-02 17:27:21 UTC
Created attachment 487734 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2017-08-02 17:27:24 UTC
Created attachment 487736 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2017-08-02 17:27:27 UTC
Created attachment 487738 [details]
etc.portage.tbz2
Comment 6 Toralf Förster gentoo-dev 2017-08-02 17:27:30 UTC
Created attachment 487740 [details]
logs.tbz2
Comment 7 Toralf Förster gentoo-dev 2017-08-02 17:27:33 UTC
Created attachment 487742 [details]
sandbox-10062.log
Comment 8 Toralf Förster gentoo-dev 2017-08-02 17:27:36 UTC
Created attachment 487744 [details]
temp.tbz2
Comment 9 Alexis Ballier gentoo-dev 2017-08-02 17:39:06 UTC
*** Bug 626904 has been marked as a duplicate of this bug. ***
Comment 10 Malcolm Lashley 2017-09-03 21:20:27 UTC
I can confirm this on my system - for anyone else landing here looking for a workaround - setting USE=-pcre will avoid the issue.

[ebuild   R    ] dev-util/coccinelle-1.0.6::gentoo  USE="ocamlopt python vim-syntax -doc -emacs -ocaml -pcre* {-test}" PYTHON_TARGETS="python2_7" 0 KiB
Comment 11 brho 2017-09-20 13:09:05 UTC
Thanks, Malcolm, for the workaround.

It looks like the Makefile might be trying to compile ocaml's pcre.mli and thus replace pcre.cmi:

make[5]: Entering directory '/var/tmp/portage/dev-util/coccinelle-1.0.6/work/coccinelle-1.0.6/globals'
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I /usr/lib64/ocaml/pcre -c config.ml
/usr/bin/ocamlopt.opt -unsafe -I ../commons -I /usr/lib64/ocaml/pcre -c flag.ml
/usr/bin/ocamlc.opt -unsafe -I ../commons -I /usr/lib64/ocaml/pcre -c iteration.mli
/usr/bin/ocamlc.opt -unsafe -I ../commons -I /usr/lib64/ocaml/pcre -c /usr/lib64/ocaml/pcre/pcre.mli
 * ACCESS DENIED:  open_wr:      /usr/lib64/ocaml/pcre/pcre.cmi
File "/usr/lib64/ocaml/pcre/pcre.mli", line 1:
Error: I/O error: /usr/lib64/ocaml/pcre/pcre.cmi: Permission denied

Note the last command was on pcre.mli, while all the others were on files within coccinelle's globals directory.
Comment 12 Naohiro Aota gentoo-dev 2017-11-08 08:56:52 UTC
Within the Makefile, it generates ".depend" file with:
/usr/bin/ocamldep -I ../commons -I /usr/lib64/ocaml/pcre *.mli *.ml > .depend

This generates the following dependency:
> regexp_pcre.cmo : /usr/lib64/ocaml/pcre/pcre.cmi
> regexp_pcre.cmx : /usr/lib64/ocaml/pcre/pcre.cmi

While we have /usr/lib64/ocaml/pcre/pcre.cmi from dev-ml/pcre-ocaml, due to the order of installation and a rule in coccinelle/globals/Makefile (.mli.cmi), "make" try to re-generate "pcre.cmi" from "/usr/.../pcre.mli".

Thanks to the ebuild dependency, we are sure that "/usr/.../pcre.cmi" exists. So we can safely filter out the dep to "/usr/.../pcre.cmi" using e.g. "sed 's!/.*/pcre.cmi!!'" and make the process won't touch the file.


... or more sophisticated solution would be separating local vs global dependency as in this commit: https://github.com/coccinelle/coccinelle/commit/984eba5c98b0ac2fdc7f13b059837a6328c56697
Comment 13 Gabriel Marcano 2018-03-14 16:22:09 UTC
Created attachment 523912 [details, diff]
coccinelle_pcre.patch

I've made a patch based on the one linked to in comment 12. I haven't verified that it didn't break any functionality, but it does allow for compilation to proceed and finish.
Comment 14 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-09-02 08:21:00 UTC
package removed.