Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

비주얼 스튜디오 원격 디버깅 시 'Unknown function' 콜스택이 나온다면?

Windows Server 2008 R2에서 실행 중인 프로그램을 Windows Server 2012 R2에서 실행 중인 Visual Studio를 이용해 원격 디버깅 연결을 했더니, 호출 스택이 '알 수 없는 함수'로 나옵니다. (재미있는 것은, 같은 종류의 운영체제 사이에서는 이런 문제가 없습니다.)

unknown_callstack_1.png

    [Managed to Native Transition]  
    System.Windows.Forms.dll!<Unknown function>   Unknown
    System.Windows.Forms.dll!<Unknown function>   Unknown
    System.Windows.Forms.dll!<Unknown function>   Unknown
    System.Windows.Forms.dll!<Unknown function>   Unknown
>    IISConfigHelper.exe!<Unknown function> Line 948   C#
    System.Windows.Forms.dll!<Unknown function>   Unknown
    System.Windows.Forms.dll!<Unknown function>   Unknown
    System.Windows.Forms.dll!<Unknown function>   Unknown
    System.Windows.Forms.dll!<Unknown function>   Unknown
    System.Windows.Forms.dll!<Unknown function>   Unknown
    [Native to Managed Transition]  
    [Managed to Native Transition]  
    System.Windows.Forms.dll!<Unknown function>   Unknown
    System.Windows.Forms.dll!<Unknown function>   Unknown
    System.Windows.Forms.dll!<Unknown function>   Unknown
    IISConfigHelper.exe!<Unknown function> Line 23    C#

콜스택뿐만 아니라 Watch 창의 변수 확인에서도 "식 계산기에 내부 오류가 있습니다.(Internal error in the expression evaluator.)"라고만 뜰 뿐 확인이 안됩니다.

예전 경험으로 미뤄봤을 때 원격 디버깅 툴과 Visual Studio의 업데이트 버전이 달랐을 때 이런 현상이 있었습니다. 하지만, 이번에는 2개의 프로그램 모두 버전이 같았습니다. 참고로, 원격 디버깅 툴의 버전 확인은 Visual Studio Remote Debugging Monitor 프로그램의 "Help" / "About Remote Debugging Monitor" 메뉴를 통해 확인할 수 있습니다.

Remote Debugging Monitor for Visual Studio (R)
Version 12.0.31101.0 built by: REL

버전이 "12.0.31101.0"이면 2013 Update 4입니다. (또는, 제어판의 "Programs and Features"에 가면 설치 프로그램이 "Remote Tools for Visual Studio 2013 Update 4"임을 알려줍니다.)

몇 번의 시행 착오 끝에, 디버거를 연결할 때의 옵션에 "관리되는 호환성 모드(Managed Compatibility Mode)"를 켜면,

unknown_callstack_2.png

이렇게 정상적으로 콜스택과 Watch 창의 변수들이 나오는 것을 확인했습니다. ^^

unknown_callstack_3.png




"Managed Compatibility Mode"가 어떤 것인지는 다음의 글에 자세히 나옵니다.

Switching to Managed Compatibility Mode in Visual Studio 2013
; https://devblogs.microsoft.com/devops/switching-to-managed-compatibility-mode-in-visual-studio-2013/

정리해 보면, 2012부터 새로운 디버깅 엔진이 도입되었고 2013에서는 그 엔진을 통해 "Managed Return Values, .NET 64-bit Edit and Continue, Async Callstacks Enhancements, and Improved Tasks Window to name a few" 등의 기능들이 구현되었다고 합니다. 하지만, 새로운 디버그 엔진으로 여전히 지원되지 않는 디버그 상황이 있는데,

  1. You are using a .NET language other than C#, VB, or F# that provides its own Expression Evaluator (this includes managed C++)
  2. You want to enable Edit and Continue (EnC) for C++ projects while mixed mode debugging

이 두가지에 해당한다면 기존의 디버그 엔진을 사용해야 한다고 합니다. 이 때 Visual Studio로 하여금 신형 디버그 엔진이 아닌, 구형 디버그 엔진을 이용하라고 지정할 수 있는 옵션이 바로 "관리되는 호환성 모드(Managed Compatibility Mode)"입니다.

향후 목표는 기존 구형 엔진을 완전히 버리는 거라고 하지만 2015RC에서도 있는 걸로 봐서 여전히 안되는 기능들이 있는 듯 합니다.




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 3/12/2023]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 46  47  48  49  50  51  52  53  54  55  56  [57]  58  59  60  ...
NoWriterDateCnt.TitleFile(s)
12199정성태3/17/20209038오류 유형: 610. C# - CodeDomProvider 사용 시 Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path '...\f2_6uod0.tmp'.
12198정성태3/17/202011742오류 유형: 609. SQL 서버 접속 시 "Cannot open user default database. Login failed."
12197정성태3/17/202010899VS.NET IDE: 144. .NET Core 콘솔 응용 프로그램을 배포(publish) 시 docker image 자동 생성 - 두 번째 이야기 [1]
12196정성태3/17/20208835오류 유형: 608. The ServicedComponent being invoked is not correctly configured (Use regsvcs to re-register).
12195정성태3/16/202010550.NET Framework: 902. C# - 프로세스의 모든 핸들을 열람 - 세 번째 이야기
12194정성태3/16/202012886오류 유형: 607. PostgreSQL - Npgsql.NpgsqlException: sorry, too many clients already
12193정성태3/16/20209547개발 환경 구성: 485. docker - SAP Adaptive Server Enterprise 컨테이너 실행 [1]
12192정성태3/14/202012006개발 환경 구성: 484. docker - Sybase Anywhere 16 컨테이너 실행
12191정성태3/14/202012358개발 환경 구성: 483. docker - OracleXE 컨테이너 실행 [1]
12190정성태3/14/20208528오류 유형: 606. Docker Desktop 업그레이드 시 "The process cannot access the file 'C:\Program Files\Docker\Docker\resources\dockerd.exe' because it is being used by another process."
12189정성태3/13/202013342개발 환경 구성: 482. Facebook OAuth 처리 시 상태 정보 전달 방법과 "유효한 OAuth 리디렉션 URI" 설정 규칙
12188정성태3/13/202015531Windows: 169. 부팅 시점에 실행되는 chkdsk 결과를 확인하는 방법
12187정성태3/12/20208293오류 유형: 605. NtpClient was unable to set a manual peer to use as a time source because of duplicate error on '...'.
12186정성태3/12/20209374오류 유형: 604. The SysVol Permissions for one or more GPOs on this domain controller and not in sync with the permissions for the GPOs on the Baseline domain controller.
12185정성태3/11/202010024오류 유형: 603. The browser service was unable to retrieve a list of servers from the browser master...
12184정성태3/11/202011493오류 유형: 602. Automatic certificate enrollment for local system failed (0x800706ba) The RPC server is unavailable. [3]
12183정성태3/11/20209820오류 유형: 601. Warning: DsGetDcName returned information for \\[...], when we were trying to reach [...].
12182정성태3/11/202011078.NET Framework: 901. C# Windows Forms - Vista/7 이후의 Progress Bar 업데이트가 느린 문제파일 다운로드1
12181정성태3/11/202011894기타: 76. 재현 가능한 최소한의 예제 프로젝트란? - 두 번째 예제파일 다운로드1
12180정성태3/10/20208494오류 유형: 600. "Docker Desktop for Windows" - EXPOSE 포트가 LISTENING 되지 않는 문제
12179정성태3/10/202019885개발 환경 구성: 481. docker - PostgreSQL 컨테이너 실행
12178정성태3/10/202011377개발 환경 구성: 480. Linux 운영체제의 docker를 위한 tcp 바인딩 추가 [1]
12177정성태3/9/202011042개발 환경 구성: 479. docker - MySQL 컨테이너 실행
12176정성태3/9/202010464개발 환경 구성: 478. 파일의 (sha256 등의) 해시 값(checksum) 확인하는 방법
12175정성태3/8/202010547개발 환경 구성: 477. "Docker Desktop for Windows"의 "Linux Container" 모드를 위한 tcp 바인딩 추가
12174정성태3/7/202010096개발 환경 구성: 476. DockerDesktopVM의 파일 시스템 접근 [3]
... 46  47  48  49  50  51  52  53  54  55  56  [57]  58  59  60  ...