Closed dismine closed 9 years ago
I confirm the problem, but did .gnu_debuglink
ever work for anyone? I tried 0.6.6 and above without success.
I also confirm the issue. .gnu_debuglink worked for me with version 0.6.2 as far as I remember. I'm not sure if the bug is in DrMinGW or in gcc/objcopy version for Windows.
I can't repro on my system. It works just fine:
z:\projects\drmingw\issues\12>g++ --version
g++ (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.
z:\projects\drmingw\issues\12>g++ -g -std=c++0x main.cpp -o test.exe
z:\projects\drmingw\issues\12>objcopy --only-keep-debug test.exe test.dbg
z:\projects\drmingw\issues\12>objcopy --strip-debug test.exe
z:\projects\drmingw\issues\12>objcopy --add-gnu-debuglink="test.dbg" test.exe
z:\projects\drmingw\issues\12>copy /y drmingw-0.7.2-win32\bin\exchndl.dll .
1 file(s) copied.
z:\projects\drmingw\issues\12>copy /y drmingw-0.7.2-win32\bin\symsrv.yes .
1 file(s) copied.
z:\projects\drmingw\issues\12>copy /y drmingw-0.7.2-win32\bin\symsrv.dll .
1 file(s) copied.
z:\projects\drmingw\issues\12>copy /y drmingw-0.7.2-win32\bin\mgwhelp.dll .
1 file(s) copied.
z:\projects\drmingw\issues\12>copy /y drmingw-0.7.2-win32\bin\dbghelp.dll .
1 file(s) copied.
z:\projects\drmingw\issues\12>del test.RPT
Could Not Find z:\projects\drmingw\issues\12\test.RPT
z:\projects\drmingw\issues\12>test.exe
z:\projects\drmingw\issues\12>type test.RPT
-------------------
Error occured on Thursday, June 4, 2015 at 10:25:27.
test.exe caused an Access Violation at location 6FC89887 in module libstdc++-6.dll Reading from location 00000000.
Registers:
eax=0028fe94 ebx=00000000 ecx=00000000 edx=00386fcc esi=00382ca8 edi=0000000e
eip=6fc89887 esp=0028fe10 ebp=0028fe38 iopl=0 nv up ei pl nz na pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010202
AddrPC Params
6FC89887 0028FE94 00409038 0028FE98 libstdc++-6.dll!ZNSs6appendERKSs
0040164D 00382C70 00000009 00000001 test.exe!main [z:\projects\drmingw\issues\12/main.cpp @ 23]
21: std::string *a;
22: a = NULL;
> 23: *a += "pi is " + std::to_string(3.1415926);
24: return(0);
25: }
004013DE 7EFDE000 0028FFD4 779A9F72 test.exe!__tmainCRTStartup
7660338A 7EFDE000 938A7145 00000000 kernel32.dll!BaseThreadInitThunk
779A9F72 004014E0 7EFDE000 00000000 ntdll.dll!__RtlUserThreadStart
779A9F45 004014E0 7EFDE000 00000000 ntdll.dll!_RtlUserThreadStart
Those who repro the issue, could you please tell me:
Those who repro the issue, could you please tell me:
- exact mingw version you have (and where you got it from)
- Windows version
If you will careful look into my report you will find string C:/Qt/Qt5.4.1/Tools/mingw491_32/i686-w64-mingw32. So my mingw is part of Qt 5.4.1.
And i used Windows XP.
Hope it will help.
So my mingw is part of Qt 5.4.1.
That's it. I also happened to have that installed, and indeeds it repros fine with it.
z:\projects\drmingw\issues\12>g++ --version g++ (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.
My mingw version is:
C:\test>g++ --version
g++ (i686-posix-dwarf-rev2, Built by MinGW-W64 project) 4.9.1
Copyright (C) 2014 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.
I also confirm the issue. .gnu_debuglink worked for me with version 0.6.2 as far as I remember. I'm not sure if the bug is in DrMinGW or in gcc/objcopy version for Windows.
For me it worked in 0.6.3 too.
My research
-------------------
Error occured on Thursday, June 4, 2015 at 18:47:15.
C:\test\test.exe caused an Access Violation at location 6FC8AAA6 in module C:\test\libstdc++-6.dll Reading from location 00000000.
Registers:
eax=00000000 ebx=00000000 ecx=003e4d14 edx=0022fed4 esi=0022fed4 edi=00000011
eip=6fc8aaa6 esp=0022fe90 ebp=0000000e iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202
AddrPC Params
6FC8AAA6 0022FED8 00409078 00000000 libstdc++-6.dll!ZNSs6appendERKSs
0040788C 0022FED4 00409078 0022FED8 test.exe!std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) [C:/Qt/Qt5.4.1/Tools/mingw491_32/i686-w64-mingw32/include/c++/bits/basic_string.h @ 2475]
004016BA 003E3998 00000011 00000001 test.exe!main [C:\test/main.cpp @ 27]
004013DE 00380039 00340034 7FFD4000 test.exe!13de
7C817077 004014E0 00000000 78746341 kernel32.dll!BaseProcessStart
-------------------
Error occured on Thursday, June 4, 2015 at 18:47:51.
C:\test\test.exe caused an Access Violation at location 6FC8AAA6 in module C:\test\libstdc++-6.dll Reading from location 00000000.
Registers:
eax=00000000 ebx=00000000 ecx=003e4d14 edx=0022fed4 esi=0022fed4 edi=00000011
eip=6fc8aaa6 esp=0022fe90 ebp=0000000e iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202
AddrPC Params
6FC8AAA6 0022FED8 00409078 00000000 libstdc++-6.dll!ZNSs6appendERKSs
0040788C 0022FED4 00409078 0022FED8 test.exe!std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) [C:/Qt/Qt5.4.1/Tools/mingw491_32/i686-w64-mingw32/include/c++/bits/basic_string.h @ 2475]
004016BA 003E3998 00000011 00000001 test.exe!main [C:\test/main.cpp @ 27]
004013DE 00380039 00340034 7FFD5000 test.exe!13de
7C817077 004014E0 00000000 78746341 kernel32.dll!BaseProcessStart
Should be broken.
Should be broken.
-------------------
Error occured on Thursday, June 4, 2015 at 18:23:49.
C:\test\test.exe caused an Access Violation at location 6FC8AAA6 in module C:\test\libstdc++-6.dll Reading from location 00000000.
Registers:
eax=00000000 ebx=00000000 ecx=003e4d14 edx=0022fed4 esi=0022fed4 edi=00000011
eip=6fc8aaa6 esp=0022fe90 ebp=0000000e iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202
AddrPC Params
6FC8AAA6 0022FED8 00409078 00000000 libstdc++-6.dll!ZNSs6appendERKSs
0040788C 0022FED4 00409078 0022FED8 test.exe!operator+<char, std::char_traits<char>, std::allocator<char> > [C:/Qt/Qt5.4.1/Tools/mingw491_32/i686-w64-mingw32/include/c++/bits/basic_string.h @ 2475]
004016BA 003E3998 00000011 00000001 test.exe!main [C:\test/main.cpp @ 27]
004013DE 00380039 00340034 7FFD7000 test.exe!13de
7C817077 004014E0 00000000 78746341 kernel32.dll!BaseProcessStart
-------------------
Error occured on Thursday, June 4, 2015 at 18:26:43.
C:\test\test.exe caused an Access Violation at location 6FC8AAA6 in module C:\test\libstdc++-6.dll Reading from location 00000000.
Registers:
eax=00000000 ebx=00000000 ecx=003e4d14 edx=0022fed4 esi=0022fed4 edi=00000011
eip=6fc8aaa6 esp=0022fe90 ebp=0000000e iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202
AddrPC Params
6FC8AAA6 0022FED8 00409078 00000000 libstdc++-6.dll!ZNSs6appendERKSs
0040788C 0022FED4 00409078 0022FED8 test.exe!788c
004016BA 003E3998 00000011 00000001 test.exe!16ba
004013DE 00380039 00340034 7FFDE000 test.exe!13de
7C817077 004014E0 00000000 78746341 kernel32.dll!BaseProcessStart
Works broken on Windows XP
-------------------
Error occured on четверг, июня 4, 2015 at 18:33:07.
-------------------
Error occured on четверг, июня 4, 2015 at 18:33:51.
-------------------
Error occured on четверг, июня 4, 2015 at 18:35:16.
test.exe caused an Access Violation at location 6FC8AAA6 in module libstdc++-6.dll Reading from location 00000000.
Registers:
eax=00000000 ebx=00000000 ecx=003e4ea4 edx=0022fed4 esi=0022fed4 edi=00000011
eip=6fc8aaa6 esp=0022fe90 ebp=0000000e iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202
AddrPC Params
6FC8AAA6 0022FED8 00409078 00000000 libstdc++-6.dll!ZNSs6appendERKSs
0040788C 0022FED4 00409078 0022FED8 test.exe!operator+<char, std::char_traits<char>, std::allocator<char> > [C:/Qt/Qt5.4.1/Tools/mingw491_32/i686-w64-mingw32/include/c++/bits/basic_string.h @ 2475]
...
operator+(const _CharT* __lhs,
basic_string<_CharT, _Traits, _Alloc>&& __rhs)
> { return std::move(__rhs.insert(0, __lhs)); }
template<typename _CharT, typename _Traits, typename _Alloc>
...
004016BA 003E3998 00000011 00000001 test.exe!main [C:\test/main.cpp @ 27]
...
std::string *a;
a = NULL;
> *a += "pi is " + std::to_string(3.1415926);
return(0);
}
...
004013DE 00380039 00340034 7FFD9000 test.exe!__tmainCRTStartup
7C817077 004014E0 00000000 78746341 kernel32.dll!BaseProcessStart
-------------------
Error occured on четверг, июня 4, 2015 at 18:36:05.
test.exe caused an Access Violation at location 6FC8AAA6 in module libstdc++-6.dll Reading from location 00000000.
Registers:
eax=00000000 ebx=00000000 ecx=003e4ea4 edx=0022fed4 esi=0022fed4 edi=00000011
eip=6fc8aaa6 esp=0022fe90 ebp=0000000e iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202
AddrPC Params
6FC8AAA6 0022FED8 00409078 00000000 libstdc++-6.dll!ZNSs6appendERKSs
0040788C 0022FED4 00409078 0022FED8 test.exe!std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)
004016BA 003E3998 00000011 00000001 test.exe!main
004013DE 00380039 00340034 7FFD9000 test.exe!__tmainCRTStartup
7C817077 004014E0 00000000 78746341 kernel32.dll!BaseProcessStart
-------------------
Error occured on четверг, июня 4, 2015 at 18:41:54.
test.exe caused an Access Violation at location 6FC8AAA6 in module libstdc++-6.dll Reading from location 00000000.
Registers:
eax=00000000 ebx=00000000 ecx=003e4ea4 edx=0022fed4 esi=0022fed4 edi=00000011
eip=6fc8aaa6 esp=0022fe90 ebp=0000000e iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202
AddrPC Params
6FC8AAA6 0022FED8 00409078 00000000 libstdc++-6.dll!ZNSs6appendERKSs
0040788C 0022FED4 00409078 0022FED8 test.exe!operator+<char, std::char_traits<char>, std::allocator<char> > [C:/Qt/Qt5.4.1/Tools/mingw491_32/i686-w64-mingw32/include/c++/bits/basic_string.h @ 2475]
2473: operator+(const _CharT* __lhs,
2474: basic_string<_CharT, _Traits, _Alloc>&& __rhs)
> 2475: { return std::move(__rhs.insert(0, __lhs)); }
2476:
2477: template<typename _CharT, typename _Traits, typename _Alloc>
004016BA 003E3998 00000011 00000001 test.exe!main [C:\test/main.cpp @ 27]
25: std::string *a;
26: a = NULL;
> 27: *a += "pi is " + std::to_string(3.1415926);
28: return(0);
29: }
004013DE 00380039 00340034 7FFDF000 test.exe!__tmainCRTStartup
7C817077 004014E0 00000000 78746341 kernel32.dll!BaseProcessStart
-------------------
Error occured on четверг, июня 4, 2015 at 18:42:59.
test.exe caused an Access Violation at location 6FC8AAA6 in module libstdc++-6.dll Reading from location 00000000.
Registers:
eax=00000000 ebx=00000000 ecx=003e4ea4 edx=0022fed4 esi=0022fed4 edi=00000011
eip=6fc8aaa6 esp=0022fe90 ebp=0000000e iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202
AddrPC Params
6FC8AAA6 0022FED8 00409078 00000000 libstdc++-6.dll!ZNSs6appendERKSs
0040788C 0022FED4 00409078 0022FED8 test.exe!std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)
004016BA 003E3998 00000011 00000001 test.exe!main
004013DE 00380039 00340034 7FFDA000 test.exe!__tmainCRTStartup
7C817077 004014E0 00000000 78746341 kernel32.dll!BaseProcessStart
It is little bit strange for me, but your report is
z:\projects\drmingw\issues\12>type test.RPT
-------------------
Error occured on Thursday, June 4, 2015 at 10:25:27.
test.exe caused an Access Violation at location 6FC89887 in module libstdc++-6.dll Reading from location 00000000.
Registers:
eax=0028fe94 ebx=00000000 ecx=00000000 edx=00386fcc esi=00382ca8 edi=0000000e
eip=6fc89887 esp=0028fe10 ebp=0028fe38 iopl=0 nv up ei pl nz na pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010202
AddrPC Params
6FC89887 0028FE94 00409038 0028FE98 libstdc++-6.dll!ZNSs6appendERKSs
0040164D 00382C70 00000009 00000001 test.exe!main [z:\projects\drmingw\issues\12/main.cpp @ 23]
21: std::string *a;
22: a = NULL;
> 23: *a += "pi is " + std::to_string(3.1415926);
24: return(0);
25: }
004013DE 7EFDE000 0028FFD4 779A9F72 test.exe!__tmainCRTStartup
7660338A 7EFDE000 938A7145 00000000 kernel32.dll!BaseThreadInitThunk
779A9F72 004014E0 7EFDE000 00000000 ntdll.dll!__RtlUserThreadStart
779A9F45 004014E0 7EFDE000 00000000 ntdll.dll!_RtlUserThreadStart
different then my
-------------------
Error occured on четверг, июня 4, 2015 at 18:41:54.
test.exe caused an Access Violation at location 6FC8AAA6 in module libstdc++-6.dll Reading from location 00000000.
Registers:
eax=00000000 ebx=00000000 ecx=003e4ea4 edx=0022fed4 esi=0022fed4 edi=00000011
eip=6fc8aaa6 esp=0022fe90 ebp=0000000e iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202
AddrPC Params
6FC8AAA6 0022FED8 00409078 00000000 libstdc++-6.dll!ZNSs6appendERKSs
0040788C 0022FED4 00409078 0022FED8 test.exe!operator+<char, std::char_traits<char>, std::allocator<char> > [C:/Qt/Qt5.4.1/Tools/mingw491_32/i686-w64-mingw32/include/c++/bits/basic_string.h @ 2475]
2473: operator+(const _CharT* __lhs,
2474: basic_string<_CharT, _Traits, _Alloc>&& __rhs)
> 2475: { return std::move(__rhs.insert(0, __lhs)); }
2476:
2477: template<typename _CharT, typename _Traits, typename _Alloc>
004016BA 003E3998 00000011 00000001 test.exe!main [C:\test/main.cpp @ 27]
25: std::string *a;
26: a = NULL;
> 27: *a += "pi is " + std::to_string(3.1415926);
28: return(0);
29: }
004013DE 00380039 00340034 7FFDF000 test.exe!__tmainCRTStartup
7C817077 004014E0 00000000 78746341 kernel32.dll!BaseProcessStart
You have only one place in report and i have two.
Thanks for the updates.
I believe found the bug. I should have a fix pushed, maybe later today.
For the record, earlier versions of DrMingw happened to support .gnu_debuglink
because it was falling back to the GNU BFD library. But DrMingw's dependency on BFD was severed due to its license (GPL) which is fine for DrMingw itself, but less so for ExcHndl
.
You have only one place in report and i have two.
@dismine I also see two with Qt's binaries. It depends on the particular libstdc++ version/implementation.
I confirm that latest revision 749fca8 does not reproduce the bug anymore:
Error occured on quinta-feira, junho 4, 2015 at 19:42:58.
pidgin.exe caused an Access Violation at location 6C4DF75E in module pidgin.dll Writing to location 00000000.
Registers:
eax=00000000 ebx=0649b7e0 ecx=00000000 edx=6c4df750 esi=00000000 edi=0028e870
eip=6c4df75e esp=0028e6f0 ebp=0028e81c iopl=0 nv up ei pl zr na po nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010246
AddrPC Params
6C4DF75E 00000001 00000001 00000004 pidgin.dll!modify_account_cb [D:\Pidgin\build\pidgin.32\pidgin/gtkblist.c @ 8012]
8010: {
8011: int *x = NULL;
> 8012: *x = 1;
8013: pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, data);
8014: }
Hi.
I checked with version 0.7.2. And it again doesn't work.
Build with g++ -g -std=c++0x main.cpp -o test.exe
Strip with objcopy --only-keep-debug test.exe test.dbg objcopy --strip-debug test.exe objcopy --add-gnu-debuglink="test.dbg" test.exe
Report without strip
Error occured on воскресенье, мая 10, 2015 at 17:45:03. test.exe caused an Access Violation at location 6FC8AAA6 in module libstdc++-6.dll Reading from location 00000000. Registers: eax=00000000 ebx=00000000 ecx=003e4ea4 edx=0022fed4 esi=0022fed4 edi=00000011 eip=6fc8aaa6 esp=0022fe90 ebp=0000000e iopl=0 nv up ei pl nz na pe nc cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202 AddrPC Params 6FC8AAA6 0022FED8 00409078 00000000 libstdc++-6.dll!ZNSs6appendERKSs 0040788C 0022FED4 00409078 0022FED8 test.exe!operator+<char, std::char_traits, std::allocator > [C:/Qt/Qt5.4.1/Tools/mingw491_32/i686-w64-mingw32/include/c++/bits/basic_string.h @ 2475]
2473: operator+(const _CharT* lhs,
2474: basic_string<_CharT, _Traits, _Alloc>&& rhs)
Error occured on воскресенье, мая 10, 2015 at 17:46:02. test.exe caused an Access Violation at location 6FC8AAA6 in module libstdc++-6.dll Reading from location 00000000. Registers: eax=00000000 ebx=00000000 ecx=003e4ea4 edx=0022fed4 esi=0022fed4 edi=00000011 eip=6fc8aaa6 esp=0022fe90 ebp=0000000e iopl=0 nv up ei pl nz na pe nc cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202 AddrPC Params 6FC8AAA6 0022FED8 00409078 00000000 libstdc++-6.dll!ZNSs6appendERKSs 0040788C 0022FED4 00409078 0022FED8 test.exe!std::basic_string<char, std::char_traits, std::allocator > std::operator+<char, std::char_traits, std::allocator >(char const*, std::basic_string<char, std::char_traits, std::allocator >&&)
004016BA 003E3998 00000011 00000001 test.exe!main
004013DE 00380039 00340034 7FFDB000 test.exe!__tmainCRTStartup
7C817077 004014E0 00000000 78746341 kernel32.dll!BaseProcessStart
How always i used all dll's.