strace crash (TLS data not initializing?)

Daniel Santos
Sat Apr 15 06:17:00 GMT 2017

Is anybody else getting this problem?  I'm using Windows 7 pro that's 
fully updated.  At least I'm getting the crash consistently now, even 
when debugging. I didn't have cygwin1.dll built with -O3, so I had to 
experiment to find the thread local storage.  If I've done in correctly, 
then it looks like this data is not initialized.  This is right after a 
mov %gs:0x30,%rax

(gdb) p ((_cygtls *)(((TEB*)$rax)->Tib.StackBase - 
$61 = {{{c_cnt = 2282544, w_cnt = 0}, _counters = 2282544}, c_buf = 
{0x76cea36e <ntdll!LdrInitializeThunk+14> 
     0x76cca228 <ntdll!RtlAdjustPrivilege+408> 
"L\213\330H\205\300\017\204", <incomplete sequence \362\007>, 0x0, 
0x22d430 "", 0x22d3e8 "\354'\001", 0x76cc0000 "MZ\220",

If there are really 2,282,544 single-char path buffers, then that would 
overflow the char *c_buf[50] buffer. Further, the first buffer exists in 
an executable section of ntdll.  So I would say that this looks 

Anyway, below is the backtrace.  When I call tp.get_w() from the gdb 
prompt, it gives me more bad pointers.

(gdb) run
Starting program: /usr/bin/strace ls
[New Thread 2444.0x990]

Program received signal SIGSEGV, Segmentation fault.
0x0000000076bfc6c3 in KERNEL32!GetVolumePathNamesForVolumeNameW () from 
(gdb) bt full
#0  0x0000000076bfc6c3 in KERNEL32!GetVolumePathNamesForVolumeNameW () 
from /c/Windows/system32/kernel32.dll
No symbol table info available.
#1  0x00000001800c9764 in dos_drive_mappings::dos_drive_mappings 
(this=0x600000010) at 
         len = 0
         tp = {c_buf_old = 2282544, w_buf_old = 0}
         vol = 
         mounts = 0x53002b002b0033 <error: Cannot access memory at 
address 0x53002b002b0033>
         devpath = 0x1f800010000f <error: Cannot access memory at 
address 0x1f800010000f>
         sh = 0x1d490d0
         __PRETTY_FUNCTION__ = "dos_drive_mappings::dos_drive_mappings()"
#2  0x000000018005fde5 in cygwin_internal (t=<optimized out>) at 
         ddm = <optimized out>
         arg = 0x22fc88 ""
         res = 18446744073709551615
         __PRETTY_FUNCTION__ = "uintptr_t 
cygwin_internal(cygwin_getinfo_types, ...)"
#3  0x0000000000402b43 in main2 (argc=<optimized out>, argc@entry=2, 
argv=argv@entry=0x1f71f20) at 
         mask = 1
         ofile = 0x0
         pid = 32978536
         opt = <optimized out>
         toggle = 0
         sawquiet = -25362252
         ret = 0
#4  0x000000000040c37a in main (argc=2, argv=0x1f71f20) at 
No locals.


Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list