* [PATCH] Skip gcore-buffer-overflow.exp on windows
@ 2012-11-15 15:02 Yao Qi
2012-11-15 15:21 ` Joel Brobecker
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Yao Qi @ 2012-11-15 15:02 UTC (permalink / raw)
To: gdb-patches
Hi,
When running gcore-buffer-overflow.exp on ia32/windows host,
we saw the following error,
cp: accessing `XXX/gdb.base/gcore-buffer-overflow-01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789': File name too long
Looks we don't have other supported hosts that have file name length
limitation, so this patch simply skips it on windows. Is it OK?
gdb/testsuite:
2012-11-15 Daniel Jacobowitz <dan@codesourcery.com>
Yao Qi <yao@codesourcery.com>
* gdb.base/gcore-buffer-overflow.exp: Skip on Windows.
---
gdb/testsuite/gdb.base/gcore-buffer-overflow.exp | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp b/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
index 13c3e75..45139bd 100644
--- a/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
+++ b/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
@@ -15,6 +15,11 @@
# Test GDB's internal buffers safety for the GCORE command.
+# Skip this test on Windows; the long filename is not allowed.
+if { [ishost "i?86-*-mingw*"] } {
+ untested gcore-buffer-overflow.exp
+ return -1
+}
set testfile "gcore-buffer-overflow"
set srcfile ${testfile}.c
--
1.7.7.6
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Skip gcore-buffer-overflow.exp on windows
2012-11-15 15:02 [PATCH] Skip gcore-buffer-overflow.exp on windows Yao Qi
@ 2012-11-15 15:21 ` Joel Brobecker
2012-11-15 16:04 ` Pedro Alves
2012-11-15 17:09 ` Eli Zaretskii
2 siblings, 0 replies; 7+ messages in thread
From: Joel Brobecker @ 2012-11-15 15:21 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
> 2012-11-15 Daniel Jacobowitz <dan@codesourcery.com>
> Yao Qi <yao@codesourcery.com>
>
> * gdb.base/gcore-buffer-overflow.exp: Skip on Windows.
I took a look, and based on the comments provided in the testcase,
I don't think there is a way to use a shorter filename and yet trigger
the original situation. So, OK to commit.
Thanks, Yao.
--
Joel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Skip gcore-buffer-overflow.exp on windows
2012-11-15 15:02 [PATCH] Skip gcore-buffer-overflow.exp on windows Yao Qi
2012-11-15 15:21 ` Joel Brobecker
@ 2012-11-15 16:04 ` Pedro Alves
2012-11-15 17:09 ` Eli Zaretskii
2 siblings, 0 replies; 7+ messages in thread
From: Pedro Alves @ 2012-11-15 16:04 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
On 15-11-2012 15:01, Yao Qi wrote:
>
> +# Skip this test on Windows; the long filename is not allowed.
> +if { [ishost "i?86-*-mingw*"] } {
> + untested gcore-buffer-overflow.exp
In untested calls, please spell out the reason the test ends up untested,
instead of just writing the test name, as with the latter we just end up with
the test name duplicated in the gdb.sum output.
> + return -1
> +}
--
Pedro Alves
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Skip gcore-buffer-overflow.exp on windows
2012-11-15 15:02 [PATCH] Skip gcore-buffer-overflow.exp on windows Yao Qi
2012-11-15 15:21 ` Joel Brobecker
2012-11-15 16:04 ` Pedro Alves
@ 2012-11-15 17:09 ` Eli Zaretskii
2012-11-16 1:11 ` Yao Qi
2 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2012-11-15 17:09 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
> From: Yao Qi <yao@codesourcery.com>
> Date: Thu, 15 Nov 2012 23:01:47 +0800
>
> Hi,
> When running gcore-buffer-overflow.exp on ia32/windows host,
> we saw the following error,
>
> cp: accessing `XXX/gdb.base/gcore-buffer-overflow-01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789': File name too long
>
> Looks we don't have other supported hosts that have file name length
> limitation, so this patch simply skips it on windows. Is it OK?
??? First, does the MinGW build of GDB really support the gcore
command? In my testing, it fails saying "Can't create a corefile".
Which figures, since MinGW doesn't support them.
And second, why in the world is this file name too long? The
limitation imposed by Windows on file-names used in "ANSI" APIs is 256
characters, not 80 or 150 that we see above. So why is this failing?
Apologies if I'm missing something.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Skip gcore-buffer-overflow.exp on windows
2012-11-15 17:09 ` Eli Zaretskii
@ 2012-11-16 1:11 ` Yao Qi
2012-11-16 15:57 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Yao Qi @ 2012-11-16 1:11 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On 11/16/2012 01:09 AM, Eli Zaretskii wrote:
> ??? First, does the MinGW build of GDB really support the gcore
> command? In my testing, it fails saying "Can't create a corefile".
> Which figures, since MinGW doesn't support them.
>
Eli,
Our GDB is configured as "--host=i686-mingw32
--target=i686-pc-linux-gnu", instead of native mingw32 gdb.
...
(gdb) gcore
Saved corefile core.2493
So gcore works, and sorry for the confusion.
> And second, why in the world is this file name too long? The
> limitation imposed by Windows on file-names used in "ANSI" APIs is 256
> characters, not 80 or 150 that we see above. So why is this failing?
I checked the log today again, and find the compilation is failed
because of the too-long file name, I think.
Executing on host: i686-pc-linux-gnu-gcc gcore-buffer-overflow.c -I
/scratch/yqi/i686-pc-linux-gnu-lite/src/gdb-trunk/gdb/testsuite/gdb.base
-Wl,-dynamic-linker,/scratch/yqi/i686-pc-linux-gnu-lite/obj/test-2012.09-999999-i686-pc-linux-gnu/host-i686-mingw32/ia32-2012.09/i686-pc-linux-gnu/libc/./lib/ld-linux.so.2
-Wl,-rpath,/scratch/yqi/i686-pc-linux-gnu-lite/obj/test-2012.09-999999-i686-pc-linux-gnu/host-i686-mingw32/ia32-2012.09/i686-pc-linux-gnu/libc/./lib/./
-Wl,-rpath,/scratch/yqi/i686-pc-linux-gnu-lite/obj/test-2012.09-999999-i686-pc-linux-gnu/host-i686-mingw32/ia32-2012.09/i686-pc-linux-gnu/libc/./usr/lib/./
-g -lm -o
/scratch/yqi/i686-pc-linux-gnu-lite/obj/test-2012.09-999999-i686-pc-linux-gnu/host-i686-mingw32/default/gdb.d/gdb.base/gcore-buffer-overflow-01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
(timeout = 3000)
c:/cygwin/home/yqi/test-i686-mingw32/test-build5-lucid-cs/ia32-2012.09/bin/../lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../i686-pc-linux-gnu/bin/ld.exe:
cannot open output file
/scratch/yqi/i686-pc-linux-gnu-lite/obj/test-2012.09-999999-i686-pc-linux-gnu/host-i686-mingw32/default/gdb.d/gdb.base/gcore-buffer-overflow-01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789:
No such file or directory^M^M
collect2.exe: error: ld returned 1 exit status
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Skip gcore-buffer-overflow.exp on windows
2012-11-16 1:11 ` Yao Qi
@ 2012-11-16 15:57 ` Eli Zaretskii
2012-11-19 2:41 ` Yao Qi
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2012-11-16 15:57 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
> Date: Fri, 16 Nov 2012 09:11:23 +0800
> From: Yao Qi <yao@codesourcery.com>
> CC: <gdb-patches@sourceware.org>
>
> On 11/16/2012 01:09 AM, Eli Zaretskii wrote:
> > ??? First, does the MinGW build of GDB really support the gcore
> > command? In my testing, it fails saying "Can't create a corefile".
> > Which figures, since MinGW doesn't support them.
> >
>
> Eli,
> Our GDB is configured as "--host=i686-mingw32
> --target=i686-pc-linux-gnu", instead of native mingw32 gdb.
That explains one mystery, thanks.
> c:/cygwin/home/yqi/test-i686-mingw32/test-build5-lucid-cs/ia32-2012.09/bin/../lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../i686-pc-linux-gnu/bin/ld.exe:
> cannot open output file
> /scratch/yqi/i686-pc-linux-gnu-lite/obj/test-2012.09-999999-i686-pc-linux-gnu/host-i686-mingw32/default/gdb.d/gdb.base/gcore-buffer-overflow-01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789:
This is still less than 256 characters, so I don't understand why it
fails. And you can make it even less if you use relative file names.
So this mystery still stands.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Skip gcore-buffer-overflow.exp on windows
2012-11-16 15:57 ` Eli Zaretskii
@ 2012-11-19 2:41 ` Yao Qi
0 siblings, 0 replies; 7+ messages in thread
From: Yao Qi @ 2012-11-19 2:41 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On 11/16/2012 11:56 PM, Eli Zaretskii wrote:
> This is still less than 256 characters, so I don't understand why it
> fails. And you can make it even less if you use relative file names.
My experiments show that the max length of file name is 241.
$ i686-pc-linux-gnu-gcc.exe gcore-buffer-overflow.c -g -lm -o
gcore-buffer-overflow111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222223567
We'll get the error when file name length is 242.
$ i686-pc-linux-gnu-gcc.exe gcore-buffer-overflow.c -g -lm -o
gcore-buffer-overflow1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222222222222222222222235678
c:/cygwin/home/yqi/test-i686-mingw32/test-build5-lucid-cs/ia32-2012.09/bin/../lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../i686-pc-linux-gnu/bin/ld.exe:
cannot open output file
gcore-buffer-overflow1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222222222222222222222235678:
No such file or directory
and I checked that 'fopen' can't open the file whose length exceeds 241.
However, I can 'cp' or 'mv' file to the file with long file name (242
~ 256).. Any ideas?
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-11-19 2:41 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-15 15:02 [PATCH] Skip gcore-buffer-overflow.exp on windows Yao Qi
2012-11-15 15:21 ` Joel Brobecker
2012-11-15 16:04 ` Pedro Alves
2012-11-15 17:09 ` Eli Zaretskii
2012-11-16 1:11 ` Yao Qi
2012-11-16 15:57 ` Eli Zaretskii
2012-11-19 2:41 ` Yao Qi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox