Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't seem to support the VC140 compiler #28

Closed
krasi0 opened this issue Feb 21, 2016 · 29 comments
Closed

Doesn't seem to support the VC140 compiler #28

krasi0 opened this issue Feb 21, 2016 · 29 comments

Comments

@krasi0
Copy link

krasi0 commented Feb 21, 2016

The function names are not resolved...

@CyberShadow
Copy link
Member

Can you build and upload a test program?

@itscool
Copy link

itscool commented Apr 21, 2016

To get function names resolved:

  • Go to Project -> Properties -> Linker -> Debugging -> Generate Debug Info
  • Set to "Optimize for debugging (/DEBUG)" instead of "Optimize for faster linking (/FASTLINK)"

@CyberShadow
Copy link
Member

As there has been no reply for 10 months, I'm closing this issue. Please post a message if you think this should be reopened.

@CyberShadow
Copy link
Member

Set to "Optimize for debugging (/DEBUG)" instead of "Optimize for faster linking (/FASTLINK)"

I haven't been able to reproduce this issue either way.

@heroboy
Copy link

heroboy commented Feb 2, 2017

hi @CyberShadow , I guess vs2015 has a link optimize, see https://blogs.msdn.microsoft.com/vcblog/2015/10/16/debugfastlink-for-vs2015-update-1/

In VS2017, I found I have to set Linker->Debugging->Generate Debug Info to "Generate Debug Information optimized for sharing and publishing (/DEBUG:FULL)", else I can't read all symbol names in PDB files with DIASDK(https://docs.microsoft.com/en-us/visualstudio/debugger/debug-interface-access/debug-interface-access-sdk).

@CyberShadow
Copy link
Member

I've tried compiling with /DEBUG and /DEBUG:FASTLINK using Visual Studio 2015 and I can see symbols either way. Visual Studio 2017 RC crashes on startup for me.

Could you provide instructions on how to compile a program with symbols that Very Sleepy can't read? Preferably from the command line (see e.g. https://github.com/VerySleepy/tests/blob/master/tests/msvc14/build.bat).

@heroboy
Copy link

heroboy commented Feb 2, 2017

please try: cl /MD /Z7 a.cpp /link /DEBUG:FASTLINK

@CyberShadow
Copy link
Member

Thanks, that works.

@CyberShadow CyberShadow reopened this Feb 2, 2017
@CyberShadow
Copy link
Member

Should be fixed, can you try the latest build?

@heroboy
Copy link

heroboy commented Feb 3, 2017

When I click the process that previously was not working, sleepy stop responding.
Here is the stack trace when it is not responding.

>	dbghelpms.dll!SymCachePdb::fRegisterPDBMappings(void)	Unknown
 	dbghelpms.dll!SymCachePdb::ModCache::LoadTypes(void)	Unknown
 	dbghelpms.dll!SymCachePdb::ModCache::GetType(unsigned long,bool)	Unknown
 	dbghelpms.dll!SymbolDataSimpleImpl<1028,26>::getData(struct SYMTYPE *,unsigned int,struct SymRowImage *,class GetTheData &)	Unknown
 	dbghelpms.dll!SymbolDataGeneralImpl<struct PROCSYM32,4423>::getData(struct SYMTYPE *,unsigned int,struct SymRowImage *,class GetTheData &)	Unknown
 	dbghelpms.dll!CSymIdTrav::get(class CSymRow &)	Unknown
 	dbghelpms.dll!CDiaSession::ReturnOneObject<class CDiaSymbol,class CSymRow,struct IDiaSymbol>(class CDiaSymbol *,class CTraversal<class CSymRow> *,struct IDiaSymbol * *)	Unknown
 	dbghelpms.dll!CDiaSession::getSymbol(struct SYMBOL_ID_INTERNAL *,struct IDiaSymbol * *)	Unknown
 	dbghelpms.dll!CDiaSymbol::get_lexicalParent(struct IDiaSymbol * *)	Unknown
 	dbghelpms.dll!diaGetFpoFromAddr(struct _MODULE_ENTRY *,unsigned __int64,int *)	Unknown
 	dbghelpms.dll!LookupFunctionEntryX86(void *,struct _MODULE_ENTRY *,unsigned __int64)	Unknown
 	dbghelpms.dll!SymFunctionTableAccess64AccessRoutines�()	Unknown
 	dbghelpms.dll!DbhStackServices::GetFunctionEntry(unsigned __int64,void *,unsigned long)	Unknown
 	dbghelpms.dll!DbsX86StackUnwinder::DoUnwindUsingInternalContext(struct DbsStackUnwinder::PreviousFrameSummary const &,struct DbsStackUnwinder::AbstractContext const &,struct DbsStackUnwinder::FrameSummary *)	Unknown
 	dbghelpms.dll!DbsX86StackUnwinder::UnwindAndUpdateInternalContext(struct DbsStackUnwinder::AbstractContext const &,struct DbsStackUnwinder::PreviousFrameSummary const &)	Unknown
 	dbghelpms.dll!DbsStackUnwinder::DoDbhUnwind(struct _tagSTACKFRAME64 *,unsigned long,void *,unsigned long,void *)	Unknown
 	dbghelpms.dll!DbsStackUnwinder::DbhUnwind(struct _tagSTACKFRAME64 *,unsigned long,void *,unsigned long,void *)	Unknown
 	dbghelpms.dll!PickX86Walk(class DbsStackUnwinder *,class DbhStackServices *,struct _tagSTACKFRAME64 *,void *)	Unknown
 	dbghelpms.dll!PickX86Walk(class DbsStackUnwinder *,class DbhStackServices *,struct _tagSTACKFRAME64 *,void *)	Unknown
 	dbghelpms.dll!StackWalkEx�()	Unknown
 	dbghelpms.dll!StackWalk64�()	Unknown
 	sleepy.exe!000000014001cb59()	Unknown
 	sleepy.exe!00000001400796af()	Unknown
 	sleepy.exe!000000014007a70c()	Unknown
 	sleepy.exe!000000014007a2de()	Unknown
 	sleepy.exe!00000001400606eb()	Unknown
 	sleepy.exe!00000001400b2208()	Unknown
 	sleepy.exe!00000001400b6584()	Unknown
 	sleepy.exe!00000001400b61a3()	Unknown
 	sleepy.exe!00000001400b70fd()	Unknown
 	sleepy.exe!00000001400b64d5()	Unknown
 	sleepy.exe!00000001400b6d43()	Unknown
 	sleepy.exe!0000000140150630()	Unknown
 	sleepy.exe!00000001401311c6()	Unknown
 	sleepy.exe!00000001401337c8()	Unknown
 	sleepy.exe!0000000140137328()	Unknown
 	user32.dll!00007ffdd9ca1c24()	Unknown
 	user32.dll!00007ffdd9ca125e()	Unknown
 	user32.dll!00007ffdd9ca0ff5()	Unknown
 	comctl32.dll!00007ffdce7f4dd6()	Unknown
 	comctl32.dll!00007ffdce7941a8()	Unknown
 	comctl32.dll!00007ffdce7f5ae9()	Unknown
 	comctl32.dll!00007ffdce94a3cf()	Unknown
 	comctl32.dll!00007ffdce94a51f()	Unknown
 	comctl32.dll!00007ffdce83398c()	Unknown
 	comctl32.dll!00007ffdce7f96a4()	Unknown
 	comctl32.dll!00007ffdce7f6582()	Unknown
 	user32.dll!00007ffdd9ca1c24()	Unknown
 	user32.dll!00007ffdd9ca17bb()	Unknown
 	comctl32.dll!00007ffdce7e87c0()	Unknown
 	comctl32.dll!00007ffdce7e88da()	Unknown
 	comctl32.dll!00007ffdce7e8662()	Unknown
 	user32.dll!00007ffdd9ca1c24()	Unknown
 	user32.dll!00007ffdd9ca17bb()	Unknown
 	sleepy.exe!0000000140130584()	Unknown
 	sleepy.exe!00000001401337e0()	Unknown
 	sleepy.exe!0000000140150e48()	Unknown
 	sleepy.exe!0000000140137328()	Unknown
 	user32.dll!00007ffdd9ca1c24()	Unknown
 	user32.dll!00007ffdd9ca156c()	Unknown
 	user32.dll!00007ffdd9ca42ff()	Unknown
 	sleepy.exe!0000000140132ddf()	Unknown
 	sleepy.exe!0000000140132c17()	Unknown
 	sleepy.exe!00000001401ab52f()	Unknown
 	sleepy.exe!00000001401ab582()	Unknown
 	sleepy.exe!00000001401ab334()	Unknown
 	sleepy.exe!00000001400d70be()	Unknown
 	sleepy.exe!00000001400d72b5()	Unknown
 	sleepy.exe!000000014006c627()	Unknown
 	sleepy.exe!000000014006ac37()	Unknown
 	sleepy.exe!000000014006c1e0()	Unknown
 	sleepy.exe!000000014006a27c()	Unknown
 	sleepy.exe!000000014006bc8d()	Unknown
 	sleepy.exe!00000001400d7229()	Unknown
 	sleepy.exe!00000001400d70ac()	Unknown
 	sleepy.exe!00000001400d72b5()	Unknown
 	sleepy.exe!00000001400b3031()	Unknown
 	sleepy.exe!00000001401071ab()	Unknown
 	sleepy.exe!000000014019735e()	Unknown
 	sleepy.exe!000000014007ea89()	Unknown
 	kernel32.dll!00007ffdd7ab8364()	Unknown
 	ntdll.dll!00007ffdda2c70d1()	Unknown

@CyberShadow
Copy link
Member

Are you trying to attach to an existing process? What about launching a new process from Sleepy, does that work?

How can I reproduce this?

@heroboy
Copy link

heroboy commented Feb 3, 2017

Could you download this: http://pan.baidu.com/s/1qYJaxcg
And click "a.exe" in sleepy process list, then sleepy will stop responding.
But other exe is working.

@heroboy
Copy link

heroboy commented Feb 3, 2017

Lauching a.exe in sleepy, and click "Stop", it show "Waiting for symbol query to start...". And cancel button is not working.

@CyberShadow
Copy link
Member

Could you download this: http://pan.baidu.com/s/1qYJaxcg

Link doesn't seem to work.

I think that if you put it in a .zip file, you can just attach it here, on GitHub.

@heroboy
Copy link

heroboy commented Feb 3, 2017

temp.zip

@CyberShadow
Copy link
Member

Everything works fine here... :/ Windows 10 x64

@heroboy
Copy link

heroboy commented Feb 3, 2017

Sorry it doesn't work for me. Windows 10 x64 too.
If I rename the a.pdb or compile without fastlink, it will not hang.
Looks like there is an infinity loop in SymCachePdb::fRegisterPDBMappings(void).

@CyberShadow
Copy link
Member

There might be a problem with your symbol settings. Check your symbol paths and try disabling using the symbol server.

@CyberShadow
Copy link
Member

BTW, if it actually gets stuck in that function (and it's not just Very Sleepy calling that function in a loop), then the problem is in Microsoft's dbghelp.dll...

@heroboy
Copy link

heroboy commented Feb 3, 2017

I already tried disable the use symbol server in options
Just before it hand, it print "DBGHELP: Symbol Search Path: ;D:\temp"

@CyberShadow
Copy link
Member

Can you check whether the infinite loop occurs in Very Sleepy code, or in dbghelp code?

You can do this by building Very Sleepy from source code, then placing a breakpoint on the StackWalk64 call in profiler.cpp.

@heroboy
Copy link

heroboy commented Feb 3, 2017

Yes, I am sure it's in dbghelp code. StackWalk64(Actually SymCachePdb::fRegisterPDBMappings(void)) never returns.
I made a very simple program to test it with removing all wxWidget codes.

int main()
{
	if (!dbgHelpInit())
	{
		printf("dbghelp error\n");
		return 0;
	}

	std::vector<ProcessInfo> pInfos;
	ProcessInfo::enumProcesses(pInfos);
	for (auto& info : pInfos)
	{
		if (info.getName() == L"a.exe")
		{
			SymbolInfo si;
			si.loadSymbols(info.getProcessHandle(), false);
			std::map<CallStack, SAMPLE_TYPE> callstacks;
			std::map<PROFILER_ADDR, SAMPLE_TYPE> flatcounts;
			Profiler p(info.getProcessHandle(),info.threads[0].getThreadHandle(),callstacks,flatcounts);
			p.sampleTarget(0.0, &si);
			break;
		}
	}
    return 0;
}

@CyberShadow
Copy link
Member

Thanks. Do you know if it only happens with the version of dbghelp.dll (dbghelpms.dll) shipped with Very Sleepy? Maybe it's a bug with that specific version.

@heroboy
Copy link

heroboy commented Feb 3, 2017

I use Process Explorer to view a.exe's thread callstack, it stop responding too.

@heroboy
Copy link

heroboy commented Feb 3, 2017

I had tried many dbghelp.dll, 32bit/64bit, in C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\dbghelp.dll, in C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\dbghelp.dll. Either it doesn't resolve the symbol names or stop responding.

@heroboy
Copy link

heroboy commented Feb 3, 2017

I tried adding

BOOL (WINAPI *SymEnumSymbols)(
		_In_           HANDLE                         hProcess,
		_In_           ULONG64                        BaseOfDll,
		_In_opt_       PCTSTR                         Mask,
		_In_           PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback,
		_In_opt_ const PVOID                          UserContext
	); 
	BOOL (WINAPI *SymEnumTypes)(
		_In_     HANDLE                         hProcess,
		_In_     ULONG64                        BaseOfDll,
		_In_     PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback,
		_In_opt_ PVOID                          UserContext
	);

in class DbgHelp.
And nothing enumerated when it is built with fastlink.
Did you see the a.exe!foo function in verysleepy?

@CyberShadow
Copy link
Member

And nothing enumerated when it is built with fastlink.

Strange... I am out of ideas. I guess this is a MS DbgHelp bug.

I don't know if it would help since it doesn't seem to depend on any other components, but maybe you could try installing the latest Windows SDK. The version this DbgHelp is from is 10.0.14393.0.

Did you see the a.exe!foo function in verysleepy?

Yes:

foo

@heroboy
Copy link

heroboy commented Feb 21, 2017

Hi,
please see https://developercommunity.visualstudio.com/content/problem/4631/dia-sdk-still-doesnt-support-debugfastlink.html?childToView=20764#comment-20764 the last comment posted by Alex Postlethwaite . Maybe it is the same issue.

@CyberShadow
Copy link
Member

Could you please see if this issue occurs with the latest release:
https://github.com/VerySleepy/verysleepy/releases

As the latest release includes many fixes, it's likely that this particular problem was fixed as well. If you encounter further problems, please leave a comment or open a new issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants