Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 480268 - sys-libs/glibc: hppa is missing fanotify_mark
Summary: sys-libs/glibc: hppa is missing fanotify_mark
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: HPPA Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL: http://sourceware.org/ml/libc-ports/2...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-08-08 16:26 UTC by Jeroen Roovers (RETIRED)
Modified: 2013-11-24 17:42 UTC (History)
3 users (show)

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


Attachments
sys-apps:systemd-206-r1:20130808-154630.log.gz (20130808-154630.log.gz,52.88 KB, application/x-gzip)
2013-08-08 16:26 UTC, Jeroen Roovers (RETIRED)
Details
config.log (config.log,128.54 KB, text/plain)
2013-08-08 16:27 UTC, Jeroen Roovers (RETIRED)
Details
make sure glibc compiles in fanotify_mark (glibc-2.17-hppa-fanotify_mark.patch,383 bytes, patch)
2013-08-12 20:51 UTC, Jeroen Roovers (RETIRED)
Details | Diff
glibc-2.17-hppa-fanotify_mark.patch (glibc-2.17-hppa-fanotify_mark.patch,457 bytes, patch)
2013-08-21 14:53 UTC, Jeroen Roovers (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Roovers (RETIRED) gentoo-dev 2013-08-08 16:26:04 UTC
Created attachment 355420 [details]
sys-apps:systemd-206-r1:20130808-154630.log.gz

Thu  8 Aug 18:25:12 CEST 2013
emerge --info sys-apps/systemd
Portage 2.1.13.5 (default/linux/hppa/13.0, gcc-4.6.3, glibc-2.17, 3.11.0-rc3-JeR-00668-gabe0308 parisc64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.11.0-rc3-JeR-00668-gabe0308-parisc64-PA8800_-Mako-with-gentoo-2.2
KiB Mem:     2049384 total,    279708 free
KiB Swap:    2101676 total,   2046712 free
Timestamp of tree: Thu, 08 Aug 2013 15:15:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
distcc 3.1 hppa2.0-unknown-linux-gnu [enabled]
ccache version 3.1.9 [disabled]
app-shells/bash:          4.2_p45
dev-lang/python:          2.5.4-r6, 2.6.8-r2, 2.7.5-r1, 3.1.5-r1, 3.2.5-r1, 3.3.2-r1
dev-util/ccache:          3.1.9
dev-util/cmake:           2.8.11.1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.6, 1.12.6
sys-devel/binutils:       2.22-r1, 2.23.1
sys-devel/gcc:            4.6.3, 4.7.2-r1, 4.7.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.7 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo JeR
ACCEPT_KEYWORDS="hppa"
ACCEPT_LICENSE="*"
CBUILD="hppa2.0-unknown-linux-gnu"
CFLAGS="-mschedule=8000 -march=2.0 -ggdb -pipe -Wall -O2 -Wno-comment"
CHOST="hppa2.0-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/distcc/bin /usr/lib/python2.5/site-packages/buildbot/status/web /usr/lib/python2.6/site-packages/buildbot/status/web /usr/lib/python2.7/site-packages/buildbot/status/web /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /var/bind /var/www/localhost/htdocs/wordpress/wp-config.php"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-mschedule=8000 -march=2.0 -ggdb -pipe -Wall -O2"
DISTDIR="/world/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=n"
FCFLAGS=""
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distcc distlocks ebuild-locks fixlafiles merge-sync metadata-transfer news notitles parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict test test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-mschedule=8000 -march=2.0 -ggdb -pipe -Wall -O2"
GENTOO_MIRRORS="ftp://ftp.snt.utwente.nl/gentoo ftp://gentoo.imj.fr/pub/gentoo/ ftp://mirror.netcologne.de/gentoo/ ftp://mirror.netcologne.de/gentoo/ ftp://91.121.124.139/gentoo-distfiles/"
LANG="en_GB.utf8"
LC_ALL="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed"
MAKEOPTS="-j6"
PKGDIR="/keeps/gentoo/packages/karsten"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/world/gentoo/portage"
PORTDIR_OVERLAY="/keeps/gentoo/local"
SYNC="rsync://rsync.nl.gentoo.org/gentoo-portage"
USE="256-color X acl alsa amr apng bash-completion bfio bzip2 canberra cli coverage cracklib crypt cups custom-cflags cxx dirac directfb dri exif fbcon filecaps firefox firmware foomaticdb fortran frontend-optional gdbm geoip glep gpm graphite gsm gstreamer gtk gudev hppa hwdb iconv idn imlib ipv6 jpeg kmod ladspa launch-frontend libcaca libcanberra libwww lua lzma lzo mad mng mod modplug modules mp3 mudflap multislot ncurses netlink nls nptl offensive openmp openrc oss pam pcre php pkcs11 png pnm python qt quvi readline regression-test rtmp samba schroedinger session smi speex spell sqlite ssl tcl tcpd test tga theora threads tk truetype unicode v4l vim-syntax vorbis vpx wcwidth x264 xattr xcb xft xml2 xvfb xvid zlib" ALSA_CARDS="ad1889 usb-audio" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CURL_SSL="nss" DRACUT_MODULES="nfs syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev joystick keyboard mouse acecad aiptek calcomp citron digitaledge dmc dynapro elo2300 elographics fpit hyperpen jamstudio magellan microtouch mutouch palmax penmount spaceorb summa tek4957 tslib ur98 void" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en nl he" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_6 python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="stifb dummy" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.5 2.6 2.7 3.1 3.2"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-08 16:27:04 UTC
Created attachment 355422 [details]
config.log
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-08 16:29:53 UTC
[ebuild  N    ] sys-apps/systemd-206-r2  USE="acl filecaps firmware-loader gudev kmod lzma openrc pam python tcpd {test} xattr -audi
t -cryptsetup -doc -gcrypt -http -introspection (-policykit) -qrcode (-selinux) -vanilla" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TA
RGETS="python2_7"
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-08-08 16:39:15 UTC
Is this issue hppa-specific? And could you report it upstream, please?
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2013-08-08 16:51:22 UTC
Jeroen, can you try upgrading your sys-kernel/linux-headers to something more modern, like 3.9+ ?
I'm thinking /usr/include/sys/fanotify.h and /usr/include/sys/fanotify.h incompability because you have so new glibc installed.
Comment 5 Mike Gilbert gentoo-dev 2013-08-08 22:31:28 UTC
(In reply to Samuli Suominen from comment #4)

I'm not sure I follow; you think old(ish) linux-headers causes glibc to be missing the fanotify_mark symbol?
Comment 6 Samuli Suominen (RETIRED) gentoo-dev 2013-08-09 05:52:24 UTC
(In reply to Mike Gilbert from comment #5)
> (In reply to Samuli Suominen from comment #4)
> 
> I'm not sure I follow; you think old(ish) linux-headers causes glibc to be
> missing the fanotify_mark symbol?

I don't think this is a systemd specific bug but somehow the 'generic' autotools check of the function in configure.ac...

AC_CHECK_FUNCS([fanotify_init fanotify_mark])

...is failing like

configure:15790: checking for fanotify_mark
configure:15790: hppa2.0-unknown-linux-gnu-gcc -std=gnu99 -o conftest -mschedule=8000 -march=2.0 -ggdb -pipe -Wall -O2 -Wno-comment  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed conftest.c -ldl -lrt  >&5
/var/tmp/portage/sys-apps/systemd-206-r1/temp/ccTBiRRm.o: In function `main':
/var/tmp/portage/sys-apps/systemd-206-r1/work/systemd-206_build/conftest.c:66: undefined reference to `fanotify_mark'
collect2: ld returned 1 exit status
distcc[19019] ERROR: compile conftest.c on localhost failed
configure:15790: $? = 1
configure: failed program was:
[ ... ]

So I'm thinking this is one of the following:

1. Too old linux-headers on too new glibc
2. Broken installation of glibc:

Jeroen, can you verify your libc has fanotify_mark() as expected?

$ nm -D --defined-only /lib/libc.so.6 |grep fanotify_mark
00000000000e84f0 T fanotify_mark

3. Failure caused by 'distcc', please try without 'distcc' in FEATURES

Now that I think of it, I'm leaning more to 2. but these really should be tested so we know where to look at.
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-09 13:00:07 UTC
(In reply to Samuli Suominen from comment #6)

> 2. Broken installation of glibc:
> 
> Jeroen, can you verify your libc has fanotify_mark() as expected?
> 
> $ nm -D --defined-only /lib/libc.so.6 |grep fanotify_mark
> 00000000000e84f0 T fanotify_mark

That's the one.
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-12 20:51:49 UTC
Created attachment 355816 [details, diff]
make sure glibc compiles in fanotify_mark

This appears to fix the immediate issue, but using dev-util/fatrace results in:

29746 fanotify_init(0, 0)               = 3
29746 fanotify_mark(0x3, 0x11, 0x4800003b, 0, 0xffffff9c) = -1 EINVAL (Invalid argument)

whereas on am64 I see:

9721  fanotify_init(0, 0)               = 3
9721  fanotify_mark(0x3, 0x11, 0x4800003b, 0xffffff9c, 0x4019a8) = 0
Comment 9 Mike Gilbert gentoo-dev 2013-08-12 22:55:29 UTC
I'm a glibc newbie, but I think the the fanotify_mark entry varies between 32-bit and 64-bit arches.

sysdeps/unix/sysv/linux/i386/syscalls.list:
fanotify_mark EXTRA   fanotify_mark   i:iiiiis   fanotify_mark

sysdeps/unix/sysv/linux/wordsize-64/syscalls.list:
fanotify_mark EXTRA   fanotify_mark   i:iiiis fanotify_mark

I'm guessing this is because the "mask" parameter is a 64-bit integer which can be passed in one parameter on 64-bit arches.

If I'm not making any sense, please ignore. ;)
Comment 10 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-13 14:06:47 UTC
(In reply to Mike Gilbert from comment #9)
> I'm a glibc newbie, but I think the the fanotify_mark entry varies between
> 32-bit and 64-bit arches.

The HPPA userland is invariably 32-bit, but the kernel can be either 32-bit or 64-bit.

> sysdeps/unix/sysv/linux/i386/syscalls.list:
> fanotify_mark EXTRA   fanotify_mark   i:iiiiis   fanotify_mark

I tried with that one, too, with a similarly flawed result.

> If I'm not making any sense, please ignore. ;)

No, it makes sense.


I have mailed the linux-parisc mailing list requesting comments/patches.
Comment 11 SpanKY gentoo-dev 2013-08-19 05:03:35 UTC
Comment on attachment 355816 [details, diff]
make sure glibc compiles in fanotify_mark

fanotify_mark on 32bit ABIs (like hppa) take 6 args, so you'll need 5 i's.  the strace output is a little bit broken in that it decodes only 5 args for all targets (but i've sent a patch upstream for that).

would be good to start with a small test program that works on x86_64 that sets up an fd for notifying and does a few calls.  then we can move on to making sure that the code for hppa is doing the right thing.

if i had to guess, the kernel you're using has CONFIG_FSNOTIFY disabled in it.  you might want to check you have that enabled before trying to run fanotify code.
Comment 12 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-19 09:47:42 UTC
(In reply to SpanKY from comment #11)
> Comment on attachment 355816 [details, diff] [details, diff]
> make sure glibc compiles in fanotify_mark
> 
> fanotify_mark on 32bit ABIs (like hppa) take 6 args, so you'll need 5 i's. 

Tried that. Same result.

> the strace output is a little bit broken in that it decodes only 5 args for
> all targets (but i've sent a patch upstream for that).

Aha!

> would be good to start with a small test program that works on x86_64 that
> sets up an fd for notifying and does a few calls.

Like fatrace?

> then we can move on to making sure that the code for hppa is doing the right
> thing.
> 
> if i had to guess, the kernel you're using has CONFIG_FSNOTIFY disabled in
> it.  you might want to check you have that enabled before trying to run
> fanotify code.

CONFIG_FSNOTIFY=y
Comment 13 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-20 13:47:55 UTC
(In reply to Jeroen Roovers from comment #12)
> CONFIG_FSNOTIFY=y

Also:
CONFIG_FANOTIFY=y
Comment 14 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-21 14:53:18 UTC
Created attachment 356602 [details, diff]
glibc-2.17-hppa-fanotify_mark.patch

Ah yes, after rebuilding fatrace, it does now seem to work properly with this glibc patch... I had tried exactly this before but it magically didn't work then.
Comment 15 SpanKY gentoo-dev 2013-08-21 15:53:47 UTC
(In reply to Jeroen Roovers from comment #14)

my guess is that it was using a stub function and it needed a recompile/relink in order to pick up the new symbol
Comment 16 SpanKY gentoo-dev 2013-08-21 15:55:30 UTC
Comment on attachment 356602 [details, diff]
glibc-2.17-hppa-fanotify_mark.patch

this is more or less correct.  it's missing a minor update to the Versions file, and the symbol version is probably wrong, but that'll require discussion with upstream.  backporting this might be a pita if we wanted to be strict about versioning, but maybe it's not a big deal considering hppa hasn't officially be buildable in mainline for a long time now.