public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* gdb 7.8 consistently fails to run executable - error is "dll path too long"
@ 2014-08-21  0:16 DGStevens
  2014-08-21  8:02 ` gdb 7.8 consistently fails to run executable - error is Achim Gratz
  0 siblings, 1 reply; 16+ messages in thread
From: DGStevens @ 2014-08-21  0:16 UTC (permalink / raw)
  To: cygwin

I'm unable to use gdb on any c/c++ executables.  When I try, gdb issues the
message "dll path too long" and fails to start the target executable.

I know that I must be doing something stupid, but it's escaping me.  The
only forum discussion that I could find suggested using mintty, which I am. 
I did see mention of a known bug in gdb, but no suggested workarounds, other
than running in mintty.

The following test case is the simplest that I could manage.  I see the same
failure with both 'C' and C++ files (gcc and g++, respectively).

I'm running Win7, with the old 32-bit cygwin.  cygcheck.txt should be
attached.

$> cat gdbtst.c
#include <stdio.h>

int main(int argc, char *argv[]) {
  printf("Hello World!\n");
}

$> gcc --version
gcc (GCC) 4.8.3
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$> gcc -g gdbtst.c -o gdbtst.exe
$> gdbtst.exe
Hello World!
$> gdb gdbtst.exe
GNU gdb (GDB) 7.8
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-cygwin".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gdbtst.exe...done.
(gdb) break main
Breakpoint 1 at 0x4011be: file gdbtst.c, line 4.
(gdb) step
The program is not being run.
(gdb) run
Starting program: /home/Deans/SBX/Samples/gdbtst.exe
[New Thread 34472.0x8ad8]
dll path too long
(gdb) step
Cannot execute this command while the selected thread is running.
(gdb) quit
A debugging session is active.

        Inferior 1 [process 34472] will be killed.

Quit anyway? (y or n) y
$> cygcheck -s -v -r >cygcheck.txt

cygcheck.txt <http://cygwin.1069669.n5.nabble.com/file/n110722/cygcheck.txt>  



--
View this message in context: http://cygwin.1069669.n5.nabble.com/gdb-7-8-consistently-fails-to-run-executable-error-is-dll-path-too-long-tp110722.html
Sent from the Cygwin list mailing list archive at Nabble.com.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb 7.8 consistently fails to run executable - error is
  2014-08-21  0:16 gdb 7.8 consistently fails to run executable - error is "dll path too long" DGStevens
@ 2014-08-21  8:02 ` Achim Gratz
  2014-08-22 18:32   ` DGStevens
  0 siblings, 1 reply; 16+ messages in thread
From: Achim Gratz @ 2014-08-21  8:02 UTC (permalink / raw)
  To: cygwin

DGStevens <deansx <at> gmail.com> writes:
> I'm unable to use gdb on any c/c++ executables.  When I try, gdb issues the
> message "dll path too long" and fails to start the target executable.

Try cutting your PATH after the third component.  If that helps, you could
set CYGWIN_NOWINPATH either as a system or user variable from Windows and
have that done automatically (if you use sh/bash).


Regards,
Achim.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb 7.8 consistently fails to run executable - error is
  2014-08-21  8:02 ` gdb 7.8 consistently fails to run executable - error is Achim Gratz
@ 2014-08-22 18:32   ` DGStevens
  2014-09-25 12:19     ` Dominik Straßer
  0 siblings, 1 reply; 16+ messages in thread
From: DGStevens @ 2014-08-22 18:32 UTC (permalink / raw)
  To: cygwin

Hi Achim-

Thanks.  Unfortunately, the change didn't seem to help regarding my issue
with GDB.  I don't know if it matters, but I fired up an old computer
running XP.  I updated all of the Cygwin software, and tried the same test. 
It worked fine on XP, but it seems to fail on Win7, at least for me.

FWIW, I tried manually trimming the path to just:

$> echo $PATH
.:/home/Deans/bin:/usr/local/bin:/usr/bin

...

$> cygcheck -s

Cygwin Configuration Diagnostics
Current System Time: Fri Aug 22 00:02:07 2014

Windows 7 Professional Ver 6.1 Build 7601 Service Pack 1

Running under WOW64 on AMD64

Path:   .
        C:\cygwin\home\Deans\bin
        C:\cygwin\usr\local\bin
        C:\cygwin\bin
...




--
View this message in context: http://cygwin.1069669.n5.nabble.com/gdb-7-8-consistently-fails-to-run-executable-error-is-dll-path-too-long-tp110722p110800.html
Sent from the Cygwin list mailing list archive at Nabble.com.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb 7.8 consistently fails to run executable - error is
  2014-08-22 18:32   ` DGStevens
@ 2014-09-25 12:19     ` Dominik Straßer
  2014-09-29 14:18       ` Dominik Straßer
  0 siblings, 1 reply; 16+ messages in thread
From: Dominik Straßer @ 2014-09-25 12:19 UTC (permalink / raw)
  To: cygwin

Hi,
I am running into the same issue.
My path is stripped down as far as possible:
$ echo $PATH
/usr/local/bin:/usr/bin

But still no cigar.

$ gdb
/local/night/fizz_build_Win7_with_icons/libraries/compilelib/unittest/exec/cygwin64/MINGW/normal_mt_so/unittest.exe
GNU gdb (GDB) 7.8
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-cygwin".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from
/local/night/fizz_build_Win7_with_icons/libraries/compilelib/unittest/exec/cygwin64/MINGW/normal_mt_so/unittest.exe...done.
(gdb) r
Starting program:
/local/night/fizz_build_Win7_with_icons/libraries/compilelib/unittest/exec/cygwin64/MINGW/normal_mt_so/unittest.exe
[New Thread 30016.0x7544]
dll path too long

strace revealend nothing.

Unfortunately MinGW's gdb doesn't work for other reasons, so I am back
to printf :-(

Regards

Dominik

Am 22.08.2014 um 20:32 schrieb DGStevens:
> Hi Achim-
> 
> Thanks.  Unfortunately, the change didn't seem to help regarding my issue
> with GDB.  I don't know if it matters, but I fired up an old computer
> running XP.  I updated all of the Cygwin software, and tried the same test. 
> It worked fine on XP, but it seems to fail on Win7, at least for me.
> 
> FWIW, I tried manually trimming the path to just:
> 
> $> echo $PATH
> .:/home/Deans/bin:/usr/local/bin:/usr/bin
> 
> ...
> 
> $> cygcheck -s
> 
> Cygwin Configuration Diagnostics
> Current System Time: Fri Aug 22 00:02:07 2014
> 
> Windows 7 Professional Ver 6.1 Build 7601 Service Pack 1
> 
> Running under WOW64 on AMD64
> 
> Path:   .
>         C:\cygwin\home\Deans\bin
>         C:\cygwin\usr\local\bin
>         C:\cygwin\bin
> ...
> 
> 
> 
> 
> --
> View this message in context: http://cygwin.1069669.n5.nabble.com/gdb-7-8-consistently-fails-to-run-executable-error-is-dll-path-too-long-tp110722p110800.html
> Sent from the Cygwin list mailing list archive at Nabble.com.
> 
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> 

-- 
Dominik Strasser       | Phone:  +49 89 99013-436
OneSpin Solutions GmbH | Fax:    +49 89 99013-100
Nymphenburgerstr. 20a
80335 Muenchen         | dominik.strasser@onespin-solutions.com
Geschaeftsfuehrung: Dr. Raik Brinkmann, Oliver Habeck
Vorsitzender des Beirats: Paul Hill
Sitz: Muenchen; Amtsgericht Muenchen HRB 139464
UstID#: DE 814413215

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb 7.8 consistently fails to run executable - error is
  2014-09-25 12:19     ` Dominik Straßer
@ 2014-09-29 14:18       ` Dominik Straßer
  2014-10-08 12:12         ` Corinna Vinschen
  0 siblings, 1 reply; 16+ messages in thread
From: Dominik Straßer @ 2014-09-29 14:18 UTC (permalink / raw)
  To: cygwin

Hi all,
I've dug into the gdb sources.
The problem is in the cygwin-only part and is not about the PATH
variable but about one single DLL file name.

This path length is *fixed* to 512 characters (SO_NAME_MAX_PATH_SIZE)
for the *realpath* of the DLL.

So there's no way for the user to work around this apart from shortening
the directory or file names.

Best regards

Dominik

Am 25.09.2014 um 13:07 schrieb Dominik Straßer:
> Hi,
> I am running into the same issue.
> My path is stripped down as far as possible:
> $ echo $PATH
> /usr/local/bin:/usr/bin
> 
> But still no cigar.
> 
> $ gdb
> /local/night/fizz_build_Win7_with_icons/libraries/compilelib/unittest/exec/cygwin64/MINGW/normal_mt_so/unittest.exe
> GNU gdb (GDB) 7.8
> Copyright (C) 2014 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-pc-cygwin".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from
> /local/night/fizz_build_Win7_with_icons/libraries/compilelib/unittest/exec/cygwin64/MINGW/normal_mt_so/unittest.exe...done.
> (gdb) r
> Starting program:
> /local/night/fizz_build_Win7_with_icons/libraries/compilelib/unittest/exec/cygwin64/MINGW/normal_mt_so/unittest.exe
> [New Thread 30016.0x7544]
> dll path too long
> 
> strace revealend nothing.
> 
> Unfortunately MinGW's gdb doesn't work for other reasons, so I am back
> to printf :-(
> 
> Regards
> 
> Dominik
> 
> Am 22.08.2014 um 20:32 schrieb DGStevens:
>> Hi Achim-
>>
>> Thanks.  Unfortunately, the change didn't seem to help regarding my issue
>> with GDB.  I don't know if it matters, but I fired up an old computer
>> running XP.  I updated all of the Cygwin software, and tried the same test. 
>> It worked fine on XP, but it seems to fail on Win7, at least for me.
>>
>> FWIW, I tried manually trimming the path to just:
>>
>> $> echo $PATH
>> .:/home/Deans/bin:/usr/local/bin:/usr/bin
>>
>> ...
>>
>> $> cygcheck -s
>>
>> Cygwin Configuration Diagnostics
>> Current System Time: Fri Aug 22 00:02:07 2014
>>
>> Windows 7 Professional Ver 6.1 Build 7601 Service Pack 1
>>
>> Running under WOW64 on AMD64
>>
>> Path:   .
>>         C:\cygwin\home\Deans\bin
>>         C:\cygwin\usr\local\bin
>>         C:\cygwin\bin
>> ...
>>
>>
>>
>>
>> --
>> View this message in context: http://cygwin.1069669.n5.nabble.com/gdb-7-8-consistently-fails-to-run-executable-error-is-dll-path-too-long-tp110722p110800.html
>> Sent from the Cygwin list mailing list archive at Nabble.com.
>>
>> --
>> Problem reports:       http://cygwin.com/problems.html
>> FAQ:                   http://cygwin.com/faq/
>> Documentation:         http://cygwin.com/docs.html
>> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>>
> 

-- 
Dominik Strasser       | Phone:  +49 89 99013-436
OneSpin Solutions GmbH | Fax:    +49 89 99013-100
Nymphenburgerstr. 20a
80335 Muenchen         | dominik.strasser@onespin-solutions.com
Geschaeftsfuehrung: Dr. Raik Brinkmann, Oliver Habeck
Vorsitzender des Beirats: Paul Hill
Sitz: Muenchen; Amtsgericht Muenchen HRB 139464
UstID#: DE 814413215

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb 7.8 consistently fails to run executable - error is
  2014-09-29 14:18       ` Dominik Straßer
@ 2014-10-08 12:12         ` Corinna Vinschen
  2014-10-08 12:38           ` Dominik Straßer
  0 siblings, 1 reply; 16+ messages in thread
From: Corinna Vinschen @ 2014-10-08 12:12 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 791 bytes --]

On Sep 29 14:13, Dominik Straßer wrote:
> Hi all,
> I've dug into the gdb sources.
> The problem is in the cygwin-only part and is not about the PATH
> variable but about one single DLL file name.
> 
> This path length is *fixed* to 512 characters (SO_NAME_MAX_PATH_SIZE)
> for the *realpath* of the DLL.

Thanks for looking into this.  While this occurs in Cygwin-specific
code, the problem is a result of the restriction of so_list::so_name
being always SO_NAME_MAX_PATH_SIZE in length.

I'm not sure how to fix this problem yet.  I'll look into it when I
had a chance to catch up with my insane mail backlog.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb 7.8 consistently fails to run executable - error is
  2014-10-08 12:12         ` Corinna Vinschen
@ 2014-10-08 12:38           ` Dominik Straßer
  2015-11-23 14:44             ` Tim Chick
  2015-11-23 15:09             ` Tim Chick
  0 siblings, 2 replies; 16+ messages in thread
From: Dominik Straßer @ 2014-10-08 12:38 UTC (permalink / raw)
  To: cygwin

Am 08.10.2014 um 14:12 schrieb Corinna Vinschen:
> On Sep 29 14:13, Dominik Straßer wrote:
>> Hi all,
Hi Corinna,
>> I've dug into the gdb sources. The problem is in the cygwin-only 
>> part and is not about the PATH variable but about one single DLL 
>> file name.
>> 
>> This path length is *fixed* to 512 characters 
>> (SO_NAME_MAX_PATH_SIZE) for the *realpath* of the DLL.
> 
> Thanks for looking into this.  While this occurs in Cygwin-specific
> code, the problem is a result of the restriction of 
> so_list::so_name being always SO_NAME_MAX_PATH_SIZE in length.
> 
> I'm not sure how to fix this problem yet.  I'll look into it when I
> had a chance to catch up with my insane mail backlog.
I only see a chance by makin this a dynamic storage.
as indicated in solist.h
#define SO_NAME_MAX_PATH_SIZE 512	/* FIXME: Should be dynamic */


Regards

Dominik
-- 
Dominik Strasser       | Phone:  +49 89 99013-436
OneSpin Solutions GmbH | Fax:    +49 89 99013-100
Nymphenburgerstr. 20a
80335 Muenchen         | dominik.strasser@onespin-solutions.com
Geschaeftsfuehrung: Dr. Raik Brinkmann, Oliver Habeck
Vorsitzender des Beirats: Paul Hill
Sitz: Muenchen; Amtsgericht Muenchen HRB 139464
UstID#: DE 814413215

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb 7.8 consistently fails to run executable - error is
  2014-10-08 12:38           ` Dominik Straßer
@ 2015-11-23 14:44             ` Tim Chick
  2016-01-12 13:58               ` Vanda Vodkamilkevich
  2015-11-23 15:09             ` Tim Chick
  1 sibling, 1 reply; 16+ messages in thread
From: Tim Chick @ 2015-11-23 14:44 UTC (permalink / raw)
  To: cygwin

Hi Dominik,

In my case, it was not down to the string size being too small. I seemed to
suffer exactly the same problem.

You get the same error if Windows can't access the dll. This seems to happen
for some "special" dlls.

The size of any PATH variable won't matter - the path it refers to here is
the "realpath" conversion of the dll filename.

The simple patch applied makes gdb work for me on Windows 7.

workaround_win7_dll_path_too_long.patch
<http://cygwin.1069669.n5.nabble.com/file/n122909/workaround_win7_dll_path_too_long.patch>  

Patch also below:

--- gdb-7.9.1-1.src/gdb.i686/src/gdb-7.9.1/gdb/windows-nat.c.orig	2015-11-23
11:43:17.834000000 +0000
+++ gdb-7.9.1-1.src/gdb.i686/src/gdb-7.9.1/gdb/windows-nat.c	2015-11-23
14:17:30.302252500 +0000
@@ -623,7 +623,8 @@ windows_make_so (const char *name, LPVOI
 	  free (rname);
 	}
       else
-	error (_("dll path too long"));
+          warning (_("dll path too long, or can not be accessed '\"%s\"'"),
+                   name);
     }
   /* Record cygwin1.dll .text start/end.  */
   p = strchr (so->so_name, '\0') - (sizeof ("/cygwin1.dll") - 1);


Thanks,
Tim




--
View this message in context: http://cygwin.1069669.n5.nabble.com/gdb-7-8-consistently-fails-to-run-executable-error-is-dll-path-too-long-tp110722p122909.html
Sent from the Cygwin list mailing list archive at Nabble.com.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb 7.8 consistently fails to run executable - error is
  2014-10-08 12:38           ` Dominik Straßer
  2015-11-23 14:44             ` Tim Chick
@ 2015-11-23 15:09             ` Tim Chick
  2016-01-14 15:53               ` Jon Turney
  1 sibling, 1 reply; 16+ messages in thread
From: Tim Chick @ 2015-11-23 15:09 UTC (permalink / raw)
  To: cygwin

> Am 08.10.2014 um 14:12 schrieb Corinna Vinschen: 
>> On Sep 29 14:13, Dominik Straßer wrote: 
>>> Hi all, 
> Hi Corinna,
> 
>>> I've dug into the gdb sources. The problem is in the cygwin-only 
>>> part and is not about the PATH variable but about one single DLL 
>>> file name. 
>>> 
>>> This path length is *fixed* to 512 characters 
>>> (SO_NAME_MAX_PATH_SIZE) for the *realpath* of the DLL. 
>> 
<SNIP>
>> 
>> I'm not sure how to fix this problem yet.  I'll look into it when I 
>> had a chance to catch up with my insane mail backlog.
> I only see a chance by makin this a dynamic storage. 
> as indicated in solist.h 

Dear All,

I experienced the same problem.

The error will occur if the path of the dll is too long, OR if gdb can not
access the dll for some reason. If the dll can not be accesed, then the call
to realpath() fails, and you get the "dll path too long" message.

In my case, the path was never too long. Making the change below lets you
debug your applications:

--- gdb-7.9.1-1.src/gdb.i686/src/gdb-7.9.1/gdb/windows-nat.c.orig 2015-11-23
11:43:17.834000000 +0000
+++ gdb-7.9.1-1.src/gdb.i686/src/gdb-7.9.1/gdb/windows-nat.c 2015-11-23
14:17:30.302252500 +0000
@@ -623,7 +623,8 @@ windows_make_so (const char *name, LPVOI
free (rname);
}
else
- error (_("dll path too long"));
+ warning (_("dll path too long, or can not be accessed '\"%s\"'"),
+ name);
}
/* Record cygwin1.dll .text start/end. */
p = strchr (so->so_name, '\0') - (sizeof ("/cygwin1.dll") - 1);

Hope this helps!
Tim





--
View this message in context: http://cygwin.1069669.n5.nabble.com/gdb-7-8-consistently-fails-to-run-executable-error-is-dll-path-too-long-tp110722p122912.html
Sent from the Cygwin list mailing list archive at Nabble.com.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb 7.8 consistently fails to run executable - error is
  2015-11-23 14:44             ` Tim Chick
@ 2016-01-12 13:58               ` Vanda Vodkamilkevich
  2016-01-12 17:30                 ` Corinna Vinschen
  0 siblings, 1 reply; 16+ messages in thread
From: Vanda Vodkamilkevich @ 2016-01-12 13:58 UTC (permalink / raw)
  To: cygwin

Hi,

I'm reacting to this email with a long delay but I just wanted to let you
know that this change saved my life, now I am finally able to debug again
with cygwin (w7 64bits , 32 bits cygwin) because I was blocked by a nasty
"security" dll (part of Arkoon Security). A big thank you...

Additionally I had another problem in gdb which is detecting kernel64.dll
instead of kernel32.dll : am I the only one still using Cygwin 32 on
Windows 64? Does this rings a bell for anyone?

I had to add another (uggly) patch above Tim's work, see below :

diff -ru origsrc/gdb-7.8/gdb/windows-nat.c src/gdb-7.8/gdb/windows-nat.c
--- origsrc/gdb-7.8/gdb/windows-nat.c   2015-06-23 17:44:40.862022600 +0200
+++ src/gdb-7.8/gdb/windows-nat.c       2015-11-25 13:28:46.893554500 +0100
@@ -648,6 +648,14 @@
   buf[0] = 0;
   if (access (name, F_OK) != 0)
     {
+      char *found=strstr(name,"kernel64.dll");
+DEBUG_EVENTS (("gdb: access() failed for \"%s\"\n", name));
+      if (found)
+         {
+                 char *six=strchr(found,'6');
+                 *six++ = '3';
+                 *six= '2';
+         }
       if (strcasecmp (name, "ntdll.dll") == 0)
 #ifdef __USEWIDE
        {
@@ -681,7 +689,7 @@
          free (rname);
        }
       else
-       error (_("dll path too long"));
+       warning (_("dll path too long, or can not be accessed: %s -
%s"),name,rname);
     }
   /* Record cygwin1.dll .text start/end.  */
   p = strchr (so->so_name, '\0') - (sizeof ("/cygwin1.dll") - 1);


2015-11-23 15:44 GMT+01:00 Tim Chick <chick@computergeek.freeserve.co.uk>:
> Hi Dominik,
>
> In my case, it was not down to the string size being too small. I seemed to
> suffer exactly the same problem.
>
> You get the same error if Windows can't access the dll. This seems to happen
> for some "special" dlls.
>
> The size of any PATH variable won't matter - the path it refers to here is
> the "realpath" conversion of the dll filename.
>
> The simple patch applied makes gdb work for me on Windows 7.
>
> workaround_win7_dll_path_too_long.patch
> <http://cygwin.1069669.n5.nabble.com/file/n122909/workaround_win7_dll_path_too_long.patch>
>
> Patch also below:
>
> --- gdb-7.9.1-1.src/gdb.i686/src/gdb-7.9.1/gdb/windows-nat.c.orig       2015-11-23
> 11:43:17.834000000 +0000
> +++ gdb-7.9.1-1.src/gdb.i686/src/gdb-7.9.1/gdb/windows-nat.c    2015-11-23
> 14:17:30.302252500 +0000
> @@ -623,7 +623,8 @@ windows_make_so (const char *name, LPVOI
>           free (rname);
>         }
>        else
> -       error (_("dll path too long"));
> +          warning (_("dll path too long, or can not be accessed '\"%s\"'"),
> +                   name);
>      }
>    /* Record cygwin1.dll .text start/end.  */
>    p = strchr (so->so_name, '\0') - (sizeof ("/cygwin1.dll") - 1);
>
>
> Thanks,
> Tim
>
>
>
>
> --
> View this message in context: http://cygwin.1069669.n5.nabble.com/gdb-7-8-consistently-fails-to-run-executable-error-is-dll-path-too-long-tp110722p122909.html
> Sent from the Cygwin list mailing list archive at Nabble.com.
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb 7.8 consistently fails to run executable - error is
  2016-01-12 13:58               ` Vanda Vodkamilkevich
@ 2016-01-12 17:30                 ` Corinna Vinschen
  0 siblings, 0 replies; 16+ messages in thread
From: Corinna Vinschen @ 2016-01-12 17:30 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1380 bytes --]

On Jan 12 13:34, Vanda Vodkamilkevich wrote:
> Hi,
> 
> I'm reacting to this email with a long delay but I just wanted to let you
> know that this change saved my life, now I am finally able to debug again
> with cygwin (w7 64bits , 32 bits cygwin) because I was blocked by a nasty
> "security" dll (part of Arkoon Security). A big thank you...
> 
> Additionally I had another problem in gdb which is detecting kernel64.dll
> instead of kernel32.dll : am I the only one still using Cygwin 32 on
> Windows 64? Does this rings a bell for anyone?
> 
> I had to add another (uggly) patch above Tim's work, see below :
> 
> diff -ru origsrc/gdb-7.8/gdb/windows-nat.c src/gdb-7.8/gdb/windows-nat.c
> --- origsrc/gdb-7.8/gdb/windows-nat.c   2015-06-23 17:44:40.862022600 +0200
> +++ src/gdb-7.8/gdb/windows-nat.c       2015-11-25 13:28:46.893554500 +0100
> @@ -648,6 +648,14 @@
>    buf[0] = 0;
>    if (access (name, F_OK) != 0)
>      {
> +      char *found=strstr(name,"kernel64.dll");

This is very suspicious.  There's no such DLL on Windows, neither for
64 bit nor for 32 bit, nor for 32 bit under WOW64, but there's an old
exploit known to rename qmgr.dll to kernel64.dll (CVE-2010-1297).  


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb 7.8 consistently fails to run executable - error is
  2015-11-23 15:09             ` Tim Chick
@ 2016-01-14 15:53               ` Jon Turney
  2016-01-14 19:48                 ` Tim Chick
  0 siblings, 1 reply; 16+ messages in thread
From: Jon Turney @ 2016-01-14 15:53 UTC (permalink / raw)
  To: cygwin; +Cc: Tim Chick

On 23/11/2015 15:09, Tim Chick wrote:
>> Am 08.10.2014 um 14:12 schrieb Corinna Vinschen:
>>> On Sep 29 14:13, Dominik Straßer wrote:
>>>> Hi all,
>> Hi Corinna,
>>
>>>> I've dug into the gdb sources. The problem is in the cygwin-only
>>>> part and is not about the PATH variable but about one single DLL
>>>> file name.
>>>>
>>>> This path length is *fixed* to 512 characters
>>>> (SO_NAME_MAX_PATH_SIZE) for the *realpath* of the DLL.
>>>
> <SNIP>
>>>
>>> I'm not sure how to fix this problem yet.  I'll look into it when I
>>> had a chance to catch up with my insane mail backlog.
>> I only see a chance by makin this a dynamic storage.
>> as indicated in solist.h
>
> Dear All,
>
> I experienced the same problem.
>
> The error will occur if the path of the dll is too long, OR if gdb can not
> access the dll for some reason. If the dll can not be accesed, then the call
> to realpath() fails, and you get the "dll path too long" message.
>
> In my case, the path was never too long. Making the change below lets you
> debug your applications:

Thanks very much for the patch.

I've built and uploaded a test release of gdb 7.10.1 with a tweaked 
version of this patch added.

Perhaps you could try that and see if it improves things for you?

I wasn't able to reproduce the problem where realpath() fails for some 
DLL, even using a non-administrator account.

Can you provide some more information about what path realpath() is 
failing for, and do you have any idea why?

> --- gdb-7.9.1-1.src/gdb.i686/src/gdb-7.9.1/gdb/windows-nat.c.orig 2015-11-23
> 11:43:17.834000000 +0000
> +++ gdb-7.9.1-1.src/gdb.i686/src/gdb-7.9.1/gdb/windows-nat.c 2015-11-23
> 14:17:30.302252500 +0000
> @@ -623,7 +623,8 @@ windows_make_so (const char *name, LPVOI
> free (rname);
> }
> else
> - error (_("dll path too long"));
> + warning (_("dll path too long, or can not be accessed '\"%s\"'"),
> + name);
> }
> /* Record cygwin1.dll .text start/end. */
> p = strchr (so->so_name, '\0') - (sizeof ("/cygwin1.dll") - 1);
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb 7.8 consistently fails to run executable - error is
  2016-01-14 15:53               ` Jon Turney
@ 2016-01-14 19:48                 ` Tim Chick
  2016-01-14 20:20                   ` Jon Turney
  0 siblings, 1 reply; 16+ messages in thread
From: Tim Chick @ 2016-01-14 19:48 UTC (permalink / raw)
  To: cygwin

Jon TURNEY wrote
> Can you provide some more information about what path realpath() is 
> failing for, and do you have any idea why?

The first one which fails for me is "c:\windows\system32\dgapi.dll"

I believe this is some security software installed on my machine by my
employer. I guess the software wants to hide itself!

I can't actually try the package, as I'm using 32-bit cygwin, sorry.

Thanks,
Tim




--
View this message in context: http://cygwin.1069669.n5.nabble.com/gdb-7-8-consistently-fails-to-run-executable-error-is-dll-path-too-long-tp110722p123730.html
Sent from the Cygwin list mailing list archive at Nabble.com.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb 7.8 consistently fails to run executable - error is
  2016-01-14 19:48                 ` Tim Chick
@ 2016-01-14 20:20                   ` Jon Turney
  2016-01-21 15:01                     ` Tim Chick
  0 siblings, 1 reply; 16+ messages in thread
From: Jon Turney @ 2016-01-14 20:20 UTC (permalink / raw)
  To: Tim Chick, cygwin

On 14/01/2016 16:02, Tim Chick wrote:
> Jon TURNEY wrote
>> Can you provide some more information about what path realpath() is
>> failing for, and do you have any idea why?
>
> The first one which fails for me is "c:\windows\system32\dgapi.dll"
>
> I believe this is some security software installed on my machine by my
> employer. I guess the software wants to hide itself!

Thanks for the information.

> I can't actually try the package, as I'm using 32-bit cygwin, sorry.

I built a 32-bit version as well, but there was a slight delay with that 
getting moved into the release.  It should be mirroring out now, though.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb 7.8 consistently fails to run executable - error is
  2016-01-14 20:20                   ` Jon Turney
@ 2016-01-21 15:01                     ` Tim Chick
  2016-01-27 21:47                       ` Jon Turney
  0 siblings, 1 reply; 16+ messages in thread
From: Tim Chick @ 2016-01-21 15:01 UTC (permalink / raw)
  To: cygwin

Jon TURNEY wrote
> On 14/01/2016 16:02, Tim Chick wrote:
>> Jon TURNEY wrote
> 
> I built a 32-bit version as well, but there was a slight delay with that 
> getting moved into the release.  It should be mirroring out now, though.

Hi Jon,

I've just tried the 7.10.1-1 package, and it works fine for me.

Thanks!
Tim




--
View this message in context: http://cygwin.1069669.n5.nabble.com/gdb-7-8-consistently-fails-to-run-executable-error-is-dll-path-too-long-tp110722p123827.html
Sent from the Cygwin list mailing list archive at Nabble.com.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb 7.8 consistently fails to run executable - error is
  2016-01-21 15:01                     ` Tim Chick
@ 2016-01-27 21:47                       ` Jon Turney
  0 siblings, 0 replies; 16+ messages in thread
From: Jon Turney @ 2016-01-27 21:47 UTC (permalink / raw)
  To: cygwin; +Cc: Tim Chick

On 21/01/2016 09:10, Tim Chick wrote:
> Jon TURNEY wrote
>> On 14/01/2016 16:02, Tim Chick wrote:
>>> Jon TURNEY wrote
>>
>> I built a 32-bit version as well, but there was a slight delay with that
>> getting moved into the release.  It should be mirroring out now, though.
>
> Hi Jon,
>
> I've just tried the 7.10.1-1 package, and it works fine for me.
>
> Thanks!

Thanks for testing.

I have promoted gdb 7.10.1-1 to current.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-01-27 18:39 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-21  0:16 gdb 7.8 consistently fails to run executable - error is "dll path too long" DGStevens
2014-08-21  8:02 ` gdb 7.8 consistently fails to run executable - error is Achim Gratz
2014-08-22 18:32   ` DGStevens
2014-09-25 12:19     ` Dominik Straßer
2014-09-29 14:18       ` Dominik Straßer
2014-10-08 12:12         ` Corinna Vinschen
2014-10-08 12:38           ` Dominik Straßer
2015-11-23 14:44             ` Tim Chick
2016-01-12 13:58               ` Vanda Vodkamilkevich
2016-01-12 17:30                 ` Corinna Vinschen
2015-11-23 15:09             ` Tim Chick
2016-01-14 15:53               ` Jon Turney
2016-01-14 19:48                 ` Tim Chick
2016-01-14 20:20                   ` Jon Turney
2016-01-21 15:01                     ` Tim Chick
2016-01-27 21:47                       ` Jon Turney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).