|
From: <sv...@va...> - 2012-07-05 21:21:45
|
florian 2012-07-05 22:21:37 +0100 (Thu, 05 Jul 2012)
New Revision: 12715
Log:
Add testcase from bugzilla #301204.
Testcase by Chantry Xavier (shi...@gm...).
Added files:
trunk/none/tests/ifunc.c
trunk/none/tests/ifunc.stderr.exp
trunk/none/tests/ifunc.stdout.exp
trunk/none/tests/ifunc.vgtest
Modified directories:
trunk/none/tests/
Modified files:
trunk/configure.in
trunk/none/tests/Makefile.am
Modified: trunk/none/tests/
Property changed: trunk/none/tests (+0 -0)
___________________________________________________________________
Name: svn:ignore
- *.dSYM
*.so
*.stderr.diff*
*.stderr.out
*.stdout.diff*
*.stdout.out
.deps
allexec32
allexec64
ansi
args
async-sigs
as_mmap
as_shm
bitfield1
blockfault
bug129866
closeall
coolo_sigaction
coolo_strlen
discard
exec-sigmask
execve
faultstatus
fcntl_setown
fdleak_cmsg
fdleak_creat
fdleak_dup
fdleak_dup2
fdleak_fcntl
fdleak_ipv4
fdleak_open
fdleak_pipe
fdleak_socketpair
floored
fork
fucomip
gxx304
insn_basic
insn_basic.c
insn_cmov
insn_cmov.c
insn_fpu
insn_fpu.c
insn_mmx
insn_mmx.c
insn_mmxext
insn_mmxext.c
insn_sse
insn_sse.c
insn_sse2
insn_sse2.c
Makefile
Makefile.in
manythreads
map_unaligned
map_unmap
mmap_fcntl_bug
mq
mremap
mremap2
munmap_exe
nestedfns
pending
pluto
process_vm_readv_writev
procfs-cmdline-exe
pth_atfork1
pth_blockedsig
pth_cancel1
pth_cancel2
pth_cvsimple
pth_detached
pth_empty
pth_exit
pth_exit2
pth_mutexspeed
pth_once
pth_rwlock
pth_semaphore1
pth_simple_mutex
pth_simple_threads
pth_specific
pth_stackalign
pth_yield
rcrl
readline1
require-text-symbol
resolv
res_search
rlimit_nofile
rlimit64_nofile
selfrun
sem
semlimit
sha1_test
shortpush
shorts
sigstackgrowth
smc1
stackgrowth
susphello
syscall-restart1
syscall-restart2
syslog
system
thread-exits
threaded-fork
threadederrno
timestamp
tls
valgrind_cpp_test
vgcore.*
vgprintf
yield
+ *.dSYM
*.so
*.stderr.diff*
*.stderr.out
*.stdout.diff*
*.stdout.out
.deps
allexec32
allexec64
ansi
args
async-sigs
as_mmap
as_shm
bitfield1
blockfault
bug129866
closeall
coolo_sigaction
coolo_strlen
discard
exec-sigmask
execve
faultstatus
fcntl_setown
fdleak_cmsg
fdleak_creat
fdleak_dup
fdleak_dup2
fdleak_fcntl
fdleak_ipv4
fdleak_open
fdleak_pipe
fdleak_socketpair
floored
fork
fucomip
gxx304
ifunc
insn_basic
insn_basic.c
insn_cmov
insn_cmov.c
insn_fpu
insn_fpu.c
insn_mmx
insn_mmx.c
insn_mmxext
insn_mmxext.c
insn_sse
insn_sse.c
insn_sse2
insn_sse2.c
Makefile
Makefile.in
manythreads
map_unaligned
map_unmap
mmap_fcntl_bug
mq
mremap
mremap2
munmap_exe
nestedfns
pending
pluto
process_vm_readv_writev
procfs-cmdline-exe
pth_atfork1
pth_blockedsig
pth_cancel1
pth_cancel2
pth_cvsimple
pth_detached
pth_empty
pth_exit
pth_exit2
pth_mutexspeed
pth_once
pth_rwlock
pth_semaphore1
pth_simple_mutex
pth_simple_threads
pth_specific
pth_stackalign
pth_yield
rcrl
readline1
require-text-symbol
resolv
res_search
rlimit_nofile
rlimit64_nofile
selfrun
sem
semlimit
sha1_test
shortpush
shorts
sigstackgrowth
smc1
stackgrowth
susphello
syscall-restart1
syscall-restart2
syslog
system
thread-exits
threaded-fork
threadederrno
timestamp
tls
valgrind_cpp_test
vgcore.*
vgprintf
yield
Modified: trunk/configure.in (+19 -0)
===================================================================
--- trunk/configure.in 2012-07-05 22:11:12 +01:00 (rev 12714)
+++ trunk/configure.in 2012-07-05 22:21:37 +01:00 (rev 12715)
@@ -1747,6 +1747,25 @@
AM_CONDITIONAL(BUILD_AVX_TESTS, test x$ac_have_as_avx = xyes)
+# Does the C compiler support the "ifunc" attribute
+# Note, this doesn't generate a C-level symbol. It generates a
+# automake-level symbol (BUILD_IFUNC_TESTS), used in test Makefile.am's
+AC_MSG_CHECKING([if gcc supports the ifunc attribute])
+
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]], [[
+ void bar(void) {}
+ void foo(void) __attribute__((ifunc("bar")));
+]])], [
+ac_have_ifunc_attr=yes
+AC_MSG_RESULT([yes])
+], [
+ac_have_ifunc_attr=no
+AC_MSG_RESULT([no])
+])
+
+AM_CONDITIONAL(BUILD_IFUNC_TESTS, test x$ac_have_ifunc_attr = xyes)
+
+
# XXX JRS 2010 Oct 13: what is this for? For sure, we don't need this
# when building the tool executables. I think we should get rid of it.
#
Added: trunk/none/tests/ifunc.stdout.exp (+1 -0)
===================================================================
--- trunk/none/tests/ifunc.stdout.exp 2012-07-05 22:11:12 +01:00 (rev 12714)
+++ trunk/none/tests/ifunc.stdout.exp 2012-07-05 22:21:37 +01:00 (rev 12715)
@@ -0,0 +1 @@
+5
Added: trunk/none/tests/ifunc.stderr.exp (+2 -0)
===================================================================
--- trunk/none/tests/ifunc.stderr.exp 2012-07-05 22:11:12 +01:00 (rev 12714)
+++ trunk/none/tests/ifunc.stderr.exp 2012-07-05 22:21:37 +01:00 (rev 12715)
@@ -0,0 +1,2 @@
+
+
Modified: trunk/none/tests/Makefile.am (+4 -0)
===================================================================
--- trunk/none/tests/Makefile.am 2012-07-05 22:11:12 +01:00 (rev 12714)
+++ trunk/none/tests/Makefile.am 2012-07-05 22:21:37 +01:00 (rev 12715)
@@ -95,6 +95,7 @@
fork.stderr.exp fork.stdout.exp fork.vgtest \
fucomip.stderr.exp fucomip.vgtest \
gxx304.stderr.exp gxx304.vgtest \
+ ifunc.stderr.exp ifunc.stdout.exp ifunc.vgtest \
manythreads.stdout.exp manythreads.stderr.exp manythreads.vgtest \
map_unaligned.stderr.exp map_unaligned.vgtest \
map_unmap.stderr.exp map_unmap.stdout.exp map_unmap.vgtest \
@@ -227,6 +228,9 @@
check_PROGRAMS += rlimit64_nofile
endif
+if BUILD_IFUNC_TESTS
+ check_PROGRAMS += ifunc
+endif
AM_CFLAGS += $(AM_FLAG_M3264_PRI)
AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
Added: trunk/none/tests/ifunc.vgtest (+1 -0)
===================================================================
--- trunk/none/tests/ifunc.vgtest 2012-07-05 22:11:12 +01:00 (rev 12714)
+++ trunk/none/tests/ifunc.vgtest 2012-07-05 22:21:37 +01:00 (rev 12715)
@@ -0,0 +1 @@
+prog: ifunc
Added: trunk/none/tests/ifunc.c (+21 -0)
===================================================================
--- trunk/none/tests/ifunc.c 2012-07-05 22:11:12 +01:00 (rev 12714)
+++ trunk/none/tests/ifunc.c 2012-07-05 22:21:37 +01:00 (rev 12715)
@@ -0,0 +1,21 @@
+/* This test made valgrind run in an infinite loop. See bugzilla #301204 */
+#include <stdio.h>
+
+static void mytest(int d)
+{
+ printf("%d\n", d);
+}
+
+static void (*resolve_test(void))(void)
+{
+ return (void (*)(void))&mytest;
+}
+
+void test(int d)
+ __attribute__((ifunc("resolve_test")));
+
+int main()
+{
+ test(5);
+ return 0;
+}
|
|
From: Philippe W. <phi...@sk...> - 2012-07-05 21:59:13
|
On Thu, 2012-07-05 at 22:21 +0100, sv...@va... wrote: > florian 2012-07-05 22:21:37 +0100 (Thu, 05 Jul 2012) > > New Revision: 12715 Hello Florian, With the abive, there is a little bit of mystery on gcc110 (ppc64 beast): on gcc110 (after fresh autogen.sh and configure) : gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../include -I../../coregrind -I../../include -I../../VEX/pub -DVGA_ppc64=1 -DVGO_linux=1 -DVGP_ppc64_linux=1 -DVGPV_ppc64_linux_vanilla=1 -DVGA_SEC_ppc32=1 -DVGP_SEC_ppc64_linux=1 -Winline -Wall -Wshadow -g -m64 -Wno-long-long -Wno-pointer-sign -fno-stack-protector -MT ifunc.o -MD -MP -MF .deps/ifunc.Tpo -c -o ifunc.o ifunc.c ifunc.c:14:6: error: ifunc is not supported in this configuration In the config.log: configure:8255: checking if gcc supports the ifunc attribute configure:8262: gcc -c -Wno-long-long -Wno-pointer-sign -fno-stack-protector conftest.c >&5 configure:8262: $? = 0 configure:8265: result: yes So, unclear to me what is happening. Philippe |
|
From: Philippe W. <phi...@sk...> - 2012-07-05 22:14:55
|
On Thu, 2012-07-05 at 23:59 +0200, Philippe Waroquiers wrote: > On Thu, 2012-07-05 at 22:21 +0100, sv...@va... wrote: > > florian 2012-07-05 22:21:37 +0100 (Thu, 05 Jul 2012) > > > > New Revision: 12715 > > Hello Florian, > With the abive, there is a little bit of mystery on gcc110 (ppc64 beast): > > on gcc110 (after fresh autogen.sh and configure) : > gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../include -I../../coregrind -I../../include -I../../VEX/pub -DVGA_ppc64=1 -DVGO_linux=1 -DVGP_ppc64_linux=1 -DVGPV_ppc64_linux_vanilla=1 -DVGA_SEC_ppc32=1 -DVGP_SEC_ppc64_linux=1 -Winline -Wall -Wshadow -g -m64 -Wno-long-long -Wno-pointer-sign -fno-stack-protector -MT ifunc.o -MD -MP -MF .deps/ifunc.Tpo -c -o ifunc.o ifunc.c > ifunc.c:14:6: error: ifunc is not supported in this configuration > > In the config.log: > configure:8255: checking if gcc supports the ifunc attribute > configure:8262: gcc -c -Wno-long-long -Wno-pointer-sign -fno-stack-protector conftest.c >&5 > configure:8262: $? = 0 > configure:8265: result: yes > > So, unclear to me what is happening. On gcc20, another problem: gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../include -I../../coregrind -I../../include -I../../VEX/pub -DVGA_amd64=1 -DVGO_linux=1 -DVGP_amd64_linux=1 -DVGPV_amd64_linux_vanilla=1 -DVGA_SEC_x86=1 -DVGP_SEC_amd64_linux=1 -Winline -Wall -Wshadow -g -m64 -Wno-long-long -Wno-pointer-sign -fno-stack-protector -MT ifunc.o -MD -MP -MF .deps/ifunc.Tpo -c -o ifunc.o ifunc.c ifunc.c:15: warning: ‘ifunc’ attribute directive ignored ifunc.c:9: warning: ‘resolve_test’ defined but not used mv -f .deps/ifunc.Tpo .deps/ifunc.Po gcc -Winline -Wall -Wshadow -g -m64 -Wno-long-long -Wno-pointer-sign -fno-stack-protector -o ifunc ifunc.o ifunc.o: In function `main': /home/philippe/valgrind/trunk_untouched/none/tests/ifunc.c:19: undefined reference to `test' collect2: ld returned 1 exit status Philippe |
|
From: Florian K. <br...@ac...> - 2012-07-06 09:19:28
|
Hi Philippe, thanks for the reports. Should be fixed now r12716 / r12717. Florian On 07/06/2012 12:15 AM, Philippe Waroquiers wrote: > On Thu, 2012-07-05 at 23:59 +0200, Philippe Waroquiers wrote: >> On Thu, 2012-07-05 at 22:21 +0100, sv...@va... wrote: >>> florian 2012-07-05 22:21:37 +0100 (Thu, 05 Jul 2012) >>> >>> New Revision: 12715 >> >> Hello Florian, >> With the abive, there is a little bit of mystery on gcc110 (ppc64 beast): >> >> on gcc110 (after fresh autogen.sh and configure) : >> gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../include -I../../coregrind -I../../include -I../../VEX/pub -DVGA_ppc64=1 -DVGO_linux=1 -DVGP_ppc64_linux=1 -DVGPV_ppc64_linux_vanilla=1 -DVGA_SEC_ppc32=1 -DVGP_SEC_ppc64_linux=1 -Winline -Wall -Wshadow -g -m64 -Wno-long-long -Wno-pointer-sign -fno-stack-protector -MT ifunc.o -MD -MP -MF .deps/ifunc.Tpo -c -o ifunc.o ifunc.c >> ifunc.c:14:6: error: ifunc is not supported in this configuration >> >> In the config.log: >> configure:8255: checking if gcc supports the ifunc attribute >> configure:8262: gcc -c -Wno-long-long -Wno-pointer-sign -fno-stack-protector conftest.c >&5 >> configure:8262: $? = 0 >> configure:8265: result: yes >> >> So, unclear to me what is happening. > > On gcc20, another problem: > > gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../include -I../../coregrind -I../../include -I../../VEX/pub -DVGA_amd64=1 -DVGO_linux=1 -DVGP_amd64_linux=1 -DVGPV_amd64_linux_vanilla=1 -DVGA_SEC_x86=1 -DVGP_SEC_amd64_linux=1 -Winline -Wall -Wshadow -g -m64 -Wno-long-long -Wno-pointer-sign -fno-stack-protector -MT ifunc.o -MD -MP -MF .deps/ifunc.Tpo -c -o ifunc.o ifunc.c > ifunc.c:15: warning: ‘ifunc’ attribute directive ignored > ifunc.c:9: warning: ‘resolve_test’ defined but not used > mv -f .deps/ifunc.Tpo .deps/ifunc.Po > gcc -Winline -Wall -Wshadow -g -m64 -Wno-long-long -Wno-pointer-sign -fno-stack-protector -o ifunc ifunc.o > ifunc.o: In function `main': > /home/philippe/valgrind/trunk_untouched/none/tests/ifunc.c:19: undefined reference to `test' > collect2: ld returned 1 exit status > > Philippe > > > |
|
From: Philippe W. <phi...@sk...> - 2012-07-06 21:48:18
|
On Fri, 2012-07-06 at 11:19 +0200, Florian Krohm wrote: > Hi Philippe, > > thanks for the reports. Should be fixed now r12716 / r12717. On gcc20, I obtain: == 621 tests, 1 stderr failure, 1 stdout failure, 0 stderrB failures, 0 stdoutB failures, 0 post failures == none/tests/ifunc (stdout) none/tests/ifunc (stderr) So, still something slightly wrong : it looks like the test is not compiled or linked anymore, but is not disabled. On gcc110 (ppc64), ifunc compiles/links and runs correctly. The diffs on gcc20 are: more ./none/tests/ifunc.*diff :::::::::::::: ./none/tests/ifunc.stderr.diff :::::::::::::: --- ifunc.stderr.exp 2012-07-05 23:53:38.521746994 +0200 +++ ifunc.stderr.out 2012-07-06 23:28:19.333735432 +0200 @@ -1,2 +1 @@ - - +valgrind: ./ifunc: No such file or directory :::::::::::::: ./none/tests/ifunc.stdout.diff :::::::::::::: --- ifunc.stdout.exp 2012-07-05 23:53:38.521746994 +0200 +++ ifunc.stdout.out 2012-07-06 23:28:19.315647342 +0200 @@ -1 +0,0 @@ -5 > > Florian > > > On 07/06/2012 12:15 AM, Philippe Waroquiers wrote: > > On Thu, 2012-07-05 at 23:59 +0200, Philippe Waroquiers wrote: > >> On Thu, 2012-07-05 at 22:21 +0100, sv...@va... wrote: > >>> florian 2012-07-05 22:21:37 +0100 (Thu, 05 Jul 2012) > >>> > >>> New Revision: 12715 > >> > >> Hello Florian, > >> With the abive, there is a little bit of mystery on gcc110 (ppc64 beast): > >> > >> on gcc110 (after fresh autogen.sh and configure) : > >> gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../include -I../../coregrind -I../../include -I../../VEX/pub -DVGA_ppc64=1 -DVGO_linux=1 -DVGP_ppc64_linux=1 -DVGPV_ppc64_linux_vanilla=1 -DVGA_SEC_ppc32=1 -DVGP_SEC_ppc64_linux=1 -Winline -Wall -Wshadow -g -m64 -Wno-long-long -Wno-pointer-sign -fno-stack-protector -MT ifunc.o -MD -MP -MF .deps/ifunc.Tpo -c -o ifunc.o ifunc.c > >> ifunc.c:14:6: error: ifunc is not supported in this configuration > >> > >> In the config.log: > >> configure:8255: checking if gcc supports the ifunc attribute > >> configure:8262: gcc -c -Wno-long-long -Wno-pointer-sign -fno-stack-protector conftest.c >&5 > >> configure:8262: $? = 0 > >> configure:8265: result: yes > >> > >> So, unclear to me what is happening. > > > > On gcc20, another problem: > > > > gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../include -I../../coregrind -I../../include -I../../VEX/pub -DVGA_amd64=1 -DVGO_linux=1 -DVGP_amd64_linux=1 -DVGPV_amd64_linux_vanilla=1 -DVGA_SEC_x86=1 -DVGP_SEC_amd64_linux=1 -Winline -Wall -Wshadow -g -m64 -Wno-long-long -Wno-pointer-sign -fno-stack-protector -MT ifunc.o -MD -MP -MF .deps/ifunc.Tpo -c -o ifunc.o ifunc.c > > ifunc.c:15: warning: ‘ifunc’ attribute directive ignored > > ifunc.c:9: warning: ‘resolve_test’ defined but not used > > mv -f .deps/ifunc.Tpo .deps/ifunc.Po > > gcc -Winline -Wall -Wshadow -g -m64 -Wno-long-long -Wno-pointer-sign -fno-stack-protector -o ifunc ifunc.o > > ifunc.o: In function `main': > > /home/philippe/valgrind/trunk_untouched/none/tests/ifunc.c:19: undefined reference to `test' > > collect2: ld returned 1 exit status > > > > Philippe > > > > > > > |
|
From: Philippe W. <phi...@sk...> - 2012-07-06 22:03:40
|
On Fri, 2012-07-06 at 23:48 +0200, Philippe Waroquiers wrote: > On gcc110 (ppc64), ifunc compiles/links and runs correctly. Oops, this also does not work (forgot to remove a bypass I put in yesterday). So, it fails the same way on gcc110 (ppc64). Philippe |