Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 547416 - dev-lang/php-5.4.40, dev-lang/php-5.5.24 ACCESS VIOLATION with USE="phar"
Summary: dev-lang/php-5.4.40, dev-lang/php-5.5.24 ACCESS VIOLATION with USE="phar"
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-22 16:08 UTC by Stuart Shelton
Modified: 2015-04-24 12:26 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
php-5.4.40 build log (php-5.4.40:20150422-130417.log.gz,102.51 KB, application/x-gzip)
2015-04-22 16:08 UTC, Stuart Shelton
Details
php-5.4.40 sandbox log (sandbox-29134.log,1.11 KB, text/plain)
2015-04-22 16:09 UTC, Stuart Shelton
Details
php-5.5.24 build log (php-5.5.24:20150422-141514.log.gz,185.36 KB, application/x-gzip)
2015-04-22 16:09 UTC, Stuart Shelton
Details
php-5.5.24 sandbox log (sandbox-25897.log,1.11 KB, text/plain)
2015-04-22 16:10 UTC, Stuart Shelton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Shelton 2015-04-22 16:08:20 UTC
Created attachment 401814 [details]
php-5.4.40 build log

php-5.5.24:

Build complete.
Don't forget to run 'make test'.

>>> Source compiled.
 * --------------------------- ACCESS VIOLATION SUMMARY ---------------------------
 * LOG FILE: "/var/log/sandbox/sandbox-25897.log"
 * 
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: mkdir
S: deny
P: /var/lib/net-snmp/mib_indexes
A: /var/lib/net-snmp/mib_indexes
R: /var/state/net-snmp/mib_indexes
C: /var/tmp/portage/dev-lang/php-5.5.24/work/sapis-build/cli/sapi/cli/php -n -d open_basedir= -d output_buffering=0 -d memory_limit=-1 -d phar.readonly=0 -d safe_mode=0 /var/tmp/portage/dev-lang/php-5.5.24/work/sapis-build/cli/ext/phar/build_precommand.php 

F: mkdir
S: deny
P: /var/lib/net-snmp/mib_indexes
A: /var/lib/net-snmp/mib_indexes
R: /var/state/net-snmp/mib_indexes
C: /var/tmp/portage/dev-lang/php-5.5.24/work/sapis-build/cli/sapi/cli/php -n -d open_basedir= -d output_buffering=0 -d memory_limit=-1 -d phar.readonly=0 -d safe_mode=0 ext/phar/phar.php pack -f ext/phar/phar.phar -a pharcommand -c auto -x \.svn -p 0 -s /var/tmp/portage/dev-lang/php-5.5.24/work/sapis-build/cli/ext/phar/phar/phar.php -h sha1 -b /usr/lib32/php5.5/bin/php /var/tmp/portage/dev-lang/php-5.5.24/work/sapis-build/cli/ext/phar/phar/ 
 * --------------------------------------------------------------------------------

>>> Failed to emerge dev-lang/php-5.5.24, Log file:

>>>  '/var/log/portage/build/dev-lang/php-5.5.24:20150422-141514.log.gz'


php-5.4.40:

Generating phar.php
Generating phar.phar
Unknown command 'pack', check ext/phar/phar.php help
Makefile:340: recipe for target 'ext/phar/phar.phar' failed
make: *** [ext/phar/phar.phar] Error 1
 * ERROR: dev-lang/php-5.4.40::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=dev-lang/php-5.4.40::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-lang/php-5.4.40::gentoo'`.
 * The complete build log is located at '/var/log/portage/build/dev-lang/php-5.4.40:20150422-130417.log.gz'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-lang/php-5.4.40/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-lang/php-5.4.40/work/sapis-build/cli'
 * S: '/var/tmp/portage/dev-lang/php-5.4.40/work/php-5.4.40'
 * --------------------------- ACCESS VIOLATION SUMMARY ---------------------------
 * LOG FILE: "/var/log/sandbox/sandbox-29134.log"
 * 
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: mkdir
S: deny
P: /var/lib/net-snmp/mib_indexes
A: /var/lib/net-snmp/mib_indexes
R: /var/state/net-snmp/mib_indexes
C: /var/tmp/portage/dev-lang/php-5.4.40/work/sapis-build/cli/sapi/cli/php -n -d open_basedir= -d output_buffering=0 -d memory_limit=-1 -d phar.readonly=0 -d safe_mode=0 /var/tmp/portage/dev-lang/php-5.4.40/work/sapis-build/cli/ext/phar/build_precommand.php 

F: mkdir
S: deny
P: /var/lib/net-snmp/mib_indexes
A: /var/lib/net-snmp/mib_indexes
R: /var/state/net-snmp/mib_indexes
C: /var/tmp/portage/dev-lang/php-5.4.40/work/sapis-build/cli/sapi/cli/php -n -d open_basedir= -d output_buffering=0 -d memory_limit=-1 -d phar.readonly=0 -d safe_mode=0 ext/phar/phar.php pack -f ext/phar/phar.phar -a pharcommand -c auto -x \.svn -p 0 -s /var/tmp/portage/dev-lang/php-5.4.40/work/sapis-build/cli/ext/phar/phar/phar.php -h sha1 -b /usr/lib32/php5.4/bin/php /var/tmp/portage/dev-lang/php-5.4.40/work/sapis-build/cli/ext/phar/phar/ 
 * --------------------------------------------------------------------------------

>>> Failed to emerge dev-lang/php-5.4.40, Log file:

>>>  '/var/log/portage/build/dev-lang/php-5.4.40:20150422-130417.log.gz'

... more attachments to come
Comment 1 Stuart Shelton 2015-04-22 16:09:08 UTC
Created attachment 401816 [details]
php-5.4.40 sandbox log
Comment 2 Stuart Shelton 2015-04-22 16:09:42 UTC
Created attachment 401818 [details]
php-5.5.24 build log
Comment 3 Stuart Shelton 2015-04-22 16:10:13 UTC
Created attachment 401820 [details]
php-5.5.24 sandbox log
Comment 4 Stuart Shelton 2015-04-22 16:26:53 UTC
So the problem appears to be:

```
src_configure() {
    addpredict /var/lib/net-snmp/mib_indexes
```

... which fails if /var/lib is a symlink (to /var/state, say).

I don't know whether this is still current, but certain revisions of the FHS state:

"/var/state: Previous releases of this standard used the name /var/lib for this hierarchy. /var/lib is deprecated, but it may be used in parallel with the required /var/state hierarchy, as a transitional measure for application-specific data. Note, however, that this allowance will be removed in a future release of the standard. Alternately, /var/lib may be made a symbolic link to /var/state."

... and I do consider /var/state to be more representative of function than /var/lib.

In any case, this would actually appear to be a portage bug in that 'addpredict' doesn't follow symlinks?
Comment 5 Brian Evans (RETIRED) gentoo-dev 2015-04-22 16:45:17 UTC
(In reply to Stuart Shelton from comment #4)

> ... and I do consider /var/state to be more representative of function than
> /var/lib.
> 
> In any case, this would actually appear to be a portage bug in that
> 'addpredict' doesn't follow symlinks?

If you make changes from the baselayout that Gentoo provides, you get to pick up the pieces.

That said, I'm not sure how the sandbox handles symlinks,  it could be very dangerous to blindly follow them IMO.

On a side note, no need to tar up a single log file.. just use bzip2 by itself.
Comment 6 Brian Evans (RETIRED) gentoo-dev 2015-04-22 17:20:53 UTC
I cannot find /var/state in any current FHS document.

The last reference to /var/state I can find is http://www.gossamer-threads.com/lists/drbd/users/473  which said that /var/lib replaced /var/state in FHS 2.1

Where did you get the quote from?

If you want to argue that an addpredict for the sandbox should follow symlinks, perhaps you should file a bug for that
Comment 7 Stuart Shelton 2015-04-24 12:26:01 UTC
For reference, the following stanza fixes this issue regardless:

    local varlib="/var/lib"
    if [[ -L "${varlib}" ]]; then
        varlib="$( readlink -e "${varlib}" )"
    fi
    addpredict "${varlib}"/net-snmp/mib_indexes
    unset varlib

(... although this does add a dependency on 'readlink', but this is from coreutils)