SlideShare a Scribd company logo
1 of 119
 Mario Hewardt              Daniel Pravat
  Senior Development Lead     Senior Development Lead
  Microsoft Corporation       Microsoft Corporation




                                    …and we approve this message
We Need Reliable Software
 
 




 
 


       AWD PDC 2008 Feedback/Questions







Open source code




Source: Coverity White Paper
with examples
 

 
 
 

 
 






   http://www.microsoft.com/whdc/devtools/debug
    ging/default.mspx




    
    
    

    
    










    
    
    
    









 Daniel Pravat








    
    
    

    

    
    
    
    
    
    
    
    
    
 Daniel Pravat

    
    
    
    

    
    

    
    
    

    
    
    
 Daniel Pravat
 Daniel Pravat
Thread 0     cs_DB1      Acquisition order
             cs_DB1
                         is reversed
                         The length may be
           No progress   different
           = Deadlock    A,B,C = OK
                         B,C = OK
                         A,B = OK
                         A,C = OK
Thread 1     cs_DB2
                         B,C,A = Deadlock








Remote     Test
                 Test
     client       Test
              SystemTest
               SystemTest
                System       Smart
                  System
                   Systems   client



    Sources       Symbols    Sources





 Daniel Pravat
09async.exe
DisplayError calls    There is another thread smashing
      Sleep            the stack
Return address is     How to catch this async
     saved             operation?
   Sleep calls        What are the implications of this
    SleepEx            bug?
Return address is     Can the execution be controlled?
  changed to X
     saved            Can this execution be prevented?
        …             Welcome NX bit

Execution starts
     at X










Daniel Pravat







Build a    Extract
                      Index    Publish     Use
 new       public
                     symbols   symbols   symbols
version   symbols



    
    
    
    
    














    
    
    

    

    
    
    
    

















                                  Store the
                  Extract the   information
    Build a new                                Publish   Use the
                  source file    required to
      version                                  symbols   symbols
                      list      retrieve the
                                file from SC










C:>pdbstr –r –p:%_NT386TREE%sym.priretailexe03sample.pdb –s:srcsrv
SRCSRV: ini ------------------------
VERSION=1
INDEXVERSION=2
VERCTRL=Visual Source Safe
DATETIME=Mon Jan 8 00:04:15 2007
SRCSRV: variables ---------------------
SSDIR=C:AWDVSS
SRCSRVENV=SSDIR=%AWD%
VSSTRGDIR=%targ%%var2%%fnbksl%(%var3%)%var4%
VSS_EXTRACT_CMD=ss.exe get -GL”%vsstrgdir%” -GF- -I-Y -W “$/%var3%” -
V”%var4%”
VSS_EXTRACT_TARGET=%targ%%var2%%fnbksl%(%var3%)%var4%%fnfile%(%var1%
)
AWD=C:AWDVSS
SRCSRVTRG=%VSS_extract_target%
SRCSRVCMD=%VSS_extract_cmd%
SRCSRV: source files --------------------
c:awdchapter3spydbg.cpp*AWD*chapter3/spydbg.cpp*VERSION1
SRCSRV: end ------------------------










    

    
    
    
    
    





    
    
    




    










    
    
    











    
    
    



CreateEvent(
                              …
                             …);


                         WIN32 API
User
Kernel
                                             Header
             Ref Count    Obj Count Object
                                             Event
             1            1         <addr>
  EPROCESS   1            1         <addr>   Header
             3            1         <addr>
                                             Mutant
HANDLE hFile=CreateFile(
        pWorkerData->pszFileName,
        FILE_READ_DATA,
        FILE_SHARE_READ,
        NULL,
        OPEN_EXISTING,
        FILE_ATTRIBUTE_NORMAL,
        NULL);

// Use file handle

CloseHandle(hFile);


    


    
    
    
    

    
No   Done
  Leak?


 Type of
resource

  Initial
 Analysis


Use tools


Avoidance
 Strategy
Mario Hewardt
Mario Hewardt
Mario Hewardt






Application

Default
               C Runtime
Process                      Other Heaps
                  Heap
 Heap




              Heap Manager


          Virtual Memory Manager
BYTE* pMem=(BYTE*)
     HeapAlloc(GetProcessHeap(), 0, 100);

// Use memory

HeapFree(GetProcessHeap(), 0, pMem);

    
    


    
        
        
        
        
    

Mario Hewardt
Mario Hewardt

    

    


    





















                Web                    Database
Web client               Middle tier
             front-end                 back-end





    
    
    



    
    
The User Identity (principal)
  
  
  
  

  

  

  
0:000> !token 7bc -n
TS Session ID: 0
User: S-1-5-21-1060284298-2111687655-1957994488-1003 (User: XP-SP2TestAdmin)
Groups:
00 S-1-5-21-1060284298-2111687655-1957994488-513 (Group: XP-SP2None)
Attributes - Mandatory Default Enabled
01 S-1-1-0 (Well Known Group: localhostEveryone)
Attributes - Mandatory Default Enabled
02 S-1-5-32-544 (Alias: BUILTINAdministrators)
Attributes - Mandatory Default Enabled Owner
03 S-1-5-32-545 (Alias: BUILTINUsers)
Attributes - Mandatory Default Enabled
04 S-1-5-4 (Well Known Group: NT AUTHORITYINTERACTIVE)
Attributes - Mandatory Default Enabled
05 S-1-5-11 (Well Known Group: NT AUTHORITYAuthenticated Users)
Attributes - Mandatory Default Enabled
06 S-1-5-5-0-35778 (no name mapped)
Attributes - Mandatory Default Enabled LogonId
07 S-1-2-0 (Well Known Group: localhostLOCAL)
Attributes - Mandatory Default Enabled
Primary Group: S-1-5-21-1060284298-2111687655-1957994488-513 (Group: XP-SP2None)
Privs:
00 0x000000017 SeChangeNotifyPrivilege Attributes - Enabled Default
01 0x000000008 SeSecurityPrivilege Attributes -
...
17 0x000000009 SeTakeOwnershipPrivilege Attributes -
18 0x00000001e SeCreateGlobalPrivilege Attributes - Enabled Default
19 0x00000001d SeImpersonatePrivilege Attributes - Enabled Default
Auth ID: 0:1c3a8
Impersonation Level: Identification
TokenType: Impersonation
The Discretionary Access Control List (DACL)
  
  
  

  

  
  

  
0:000> !acl 000840ac
ACL is:
ACL is: ->AclRevision: 0x2
ACL is: ->Sbz1 : 0x0
ACL is: ->AclSize : 0x1c
ACL is: ->AceCount : 0x1
ACL is: ->Sbz2 : 0x0
ACL is: ->Ace[0]: ->AceType: ACCESS_ALLOWED_ACE_TYPE
ACL is: ->Ace[0]: ->AceFlags: 0x0
ACL is: ->Ace[0]: ->AceSize: 0x14
ACL is: ->Ace[0]: ->Mask : 0x00120089
ACL is: ->Ace[0]: ->SID: S-1-1-0
kd> !sd 00084098
->Revision: 0x1
->Sbz1 : 0x0
->Control : 0x8004
SE_DACL_PRESENT
SE_SELF_RELATIVE
->Owner : S-1-5-18
->Group : S-1-5-32-544
->Dacl :
->Dacl : ->AclRevision: 0x2
->Dacl : ->Sbz1 : 0x0
->Dacl : ->AclSize : 0x1c
->Dacl : ->AceCount : 0x1
->Dacl : ->Sbz2 : 0x0
->Dacl : ->Ace[0]: ->AceType: ACCESS_ALLOWED_ACE_TYPE
->Dacl : ->Ace[0]: ->AceFlags: 0x0
->Dacl : ->Ace[0]: ->AceSize: 0x14
->Dacl : ->Ace[0]: ->Mask : 0x00120089
->Dacl : ->Ace[0]: ->SID: S-1-1-0
->Sacl : is NULL
The Security Reference Monitor (SRM)
 
 
 
     
     
     
     
 
 
 Daniel Pravat
void MTAClientCall()
{
        COSERVERINFO si;
        MULTI_QI mqi;
        ...
        if (SUCCEEDED(CoCreateInstanceEx( CLSID_Calculator,
            NULL, CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER,
            &si, 1, &mqi )))
        {
            ICalculator * pCalculator = NULL;
            pCalculator = (ICalculator*)mqi.pItf;
            __int32 result = 0;
            wprintf(L"Calling SumSlow ...");
            pCalculator->SumSlow(1,2, &result);
            pCalculator->Release();
            wprintf(L"donen");
        }
}





              DCOM
    HOST OS            SCM
              Launch

    Remote    RPCSS    DCOM
     client   Server   server

              DCOM
              client
 Daniel Pravat












    
    
    
    
    
    














Application

Default
               C Runtime
Process                      Other Heaps
                  Heap
 Heap




              Heap Manager


          Virtual Memory Manager
Look aside Table
0                  Unused
1                  16
2                  24
3                  32
…                  …
127                1024
Free Lists                   Segment List
0            Variable Size       1
                                 2
1            unused              …
2            16                  X

3            24
…            …
127          1016







Free Block   Busy Block   Busy Block   Uncommitted range



    

    
Pre-allocation Metadata          User accessible part         Post-allocation Metadata




Pre-allocation Metadata
Current Previous       Seg                              Tag
                                 Flags      Unused                 User accessible part
 Size     Size        Index                            Index




Post-allocation Metadata

                              Suffix     Fill Area   Heap
     User accessible part
                              Bytes      (debug)     Extra








    Allocation Size: 16   Allocation Size: 32   Allocation Size: 16




                          Allocation Size: 64



    




    
Mario Hewardt
Mario Hewardt
Mario Hewardt





    
    


    
    
    
    
    


    




    
    
Windows Error Reporting Service
          Crash data over HTTPS



 Error
 Sent
  Dr.                                                               Query Fault
Watson               Fault response over HTTPS                      Data
Process
 Crash



                                                                 ISV
Mario Hewardt


       http://www.codeplex.com/wer/

    
    
    






Daniel Pravat
Debugging Tools for Windows
  

      
      
      
  
  
  
  
      
      
Debugging Tools for Windows
 
 
     
 
 
 
 
 
 
 
 
 
Debugging Tools for Windows
 
 
 
 
 
 
 
     
     
Main()
{
...
    int operationCount = 0;
    for (; ; )
    {
         operationCount++;
         HostInfo hi = HostInfo.GetDefault(hostAddress,
userName, password);
         IWSManSession session = GetSession(hi);
         string response =
session.Get("wmicimv2/Win32_OperatingSystem", 0);
         Console.Write("rNumber of calls: " +
operationCount);
     }
...
}
static public IWSManSession GetSession(HostInfo hi)
    {
        IWSManSession session = null;
        // Get a cached session
        string key = hi.GetKey();
        if (!sessionCache.TryGetValue(key, out session))
        {
            session = CreateSession(hi);
            sessionCache[key] = session;
        }
        return session;
    }
 Daniel Pravat








Debugging Tools for Windows
 
 
 
     
     

 
     
     
     









    



    


    




       Microsoft Advanced Windows Debugging and Troubleshooting
       Crash Dump Analysis
       If broken it is, fix it you should

    





© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market
     conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
                                          MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Reliable Software Development Approaches

More Related Content

What's hot

Bh Usa 07 Butler And Kendall
Bh Usa 07 Butler And KendallBh Usa 07 Butler And Kendall
Bh Usa 07 Butler And KendallKarlFrank99
 
Replication and Replica Sets
Replication and Replica SetsReplication and Replica Sets
Replication and Replica SetsMongoDB
 
Object Oriented Code RE with HexraysCodeXplorer
Object Oriented Code RE with HexraysCodeXplorerObject Oriented Code RE with HexraysCodeXplorer
Object Oriented Code RE with HexraysCodeXplorerAlex Matrosov
 
Riak at The NYC Cloud Computing Meetup Group
Riak at The NYC Cloud Computing Meetup GroupRiak at The NYC Cloud Computing Meetup Group
Riak at The NYC Cloud Computing Meetup Groupsiculars
 
Webinar: Replication and Replica Sets
Webinar: Replication and Replica SetsWebinar: Replication and Replica Sets
Webinar: Replication and Replica SetsMongoDB
 
Top five questions to ask when choosing a big data solution
Top five questions to ask when choosing a big data solutionTop five questions to ask when choosing a big data solution
Top five questions to ask when choosing a big data solutionjbellis
 
Thinking outside the box, learning a little about a lot
Thinking outside the box, learning a little about a lotThinking outside the box, learning a little about a lot
Thinking outside the box, learning a little about a lotMark Broadbent
 
Redis in Practice
Redis in PracticeRedis in Practice
Redis in PracticeNoah Davis
 
Reconstructing Gapz: Position-Independent Code Analysis Problem
Reconstructing Gapz: Position-Independent Code Analysis ProblemReconstructing Gapz: Position-Independent Code Analysis Problem
Reconstructing Gapz: Position-Independent Code Analysis ProblemAlex Matrosov
 
Cassandra Summit 2013 Keynote
Cassandra Summit 2013 KeynoteCassandra Summit 2013 Keynote
Cassandra Summit 2013 Keynotejbellis
 
Nick twitter
Nick twitterNick twitter
Nick twitterd0nn9n
 
Using Python3 to Build a Cloud Computing Service for my Superboard II
Using Python3 to Build a Cloud Computing Service for my Superboard IIUsing Python3 to Build a Cloud Computing Service for my Superboard II
Using Python3 to Build a Cloud Computing Service for my Superboard IIDavid Beazley (Dabeaz LLC)
 
Redis — The AK-47 of Post-relational Databases
Redis — The AK-47 of Post-relational DatabasesRedis — The AK-47 of Post-relational Databases
Redis — The AK-47 of Post-relational DatabasesKarel Minarik
 
Tokyo cassandra conference 2014
Tokyo cassandra conference 2014Tokyo cassandra conference 2014
Tokyo cassandra conference 2014jbellis
 
DevOpsDays Warsaw 2015: Running High Performance And Fault Tolerant Elasticse...
DevOpsDays Warsaw 2015: Running High Performance And Fault Tolerant Elasticse...DevOpsDays Warsaw 2015: Running High Performance And Fault Tolerant Elasticse...
DevOpsDays Warsaw 2015: Running High Performance And Fault Tolerant Elasticse...PROIDEA
 

What's hot (20)

Bh Usa 07 Butler And Kendall
Bh Usa 07 Butler And KendallBh Usa 07 Butler And Kendall
Bh Usa 07 Butler And Kendall
 
Replication and Replica Sets
Replication and Replica SetsReplication and Replica Sets
Replication and Replica Sets
 
Object Oriented Code RE with HexraysCodeXplorer
Object Oriented Code RE with HexraysCodeXplorerObject Oriented Code RE with HexraysCodeXplorer
Object Oriented Code RE with HexraysCodeXplorer
 
Django cryptography
Django cryptographyDjango cryptography
Django cryptography
 
Riak at The NYC Cloud Computing Meetup Group
Riak at The NYC Cloud Computing Meetup GroupRiak at The NYC Cloud Computing Meetup Group
Riak at The NYC Cloud Computing Meetup Group
 
Webinar: Replication and Replica Sets
Webinar: Replication and Replica SetsWebinar: Replication and Replica Sets
Webinar: Replication and Replica Sets
 
Medianet manual
Medianet manualMedianet manual
Medianet manual
 
分散式系統
分散式系統分散式系統
分散式系統
 
Top five questions to ask when choosing a big data solution
Top five questions to ask when choosing a big data solutionTop five questions to ask when choosing a big data solution
Top five questions to ask when choosing a big data solution
 
Hta w22
Hta w22Hta w22
Hta w22
 
Thinking outside the box, learning a little about a lot
Thinking outside the box, learning a little about a lotThinking outside the box, learning a little about a lot
Thinking outside the box, learning a little about a lot
 
Redis in Practice
Redis in PracticeRedis in Practice
Redis in Practice
 
Reconstructing Gapz: Position-Independent Code Analysis Problem
Reconstructing Gapz: Position-Independent Code Analysis ProblemReconstructing Gapz: Position-Independent Code Analysis Problem
Reconstructing Gapz: Position-Independent Code Analysis Problem
 
Cassandra Summit 2013 Keynote
Cassandra Summit 2013 KeynoteCassandra Summit 2013 Keynote
Cassandra Summit 2013 Keynote
 
Nick twitter
Nick twitterNick twitter
Nick twitter
 
Using Python3 to Build a Cloud Computing Service for my Superboard II
Using Python3 to Build a Cloud Computing Service for my Superboard IIUsing Python3 to Build a Cloud Computing Service for my Superboard II
Using Python3 to Build a Cloud Computing Service for my Superboard II
 
Binary Instance Loading
Binary Instance LoadingBinary Instance Loading
Binary Instance Loading
 
Redis — The AK-47 of Post-relational Databases
Redis — The AK-47 of Post-relational DatabasesRedis — The AK-47 of Post-relational Databases
Redis — The AK-47 of Post-relational Databases
 
Tokyo cassandra conference 2014
Tokyo cassandra conference 2014Tokyo cassandra conference 2014
Tokyo cassandra conference 2014
 
DevOpsDays Warsaw 2015: Running High Performance And Fault Tolerant Elasticse...
DevOpsDays Warsaw 2015: Running High Performance And Fault Tolerant Elasticse...DevOpsDays Warsaw 2015: Running High Performance And Fault Tolerant Elasticse...
DevOpsDays Warsaw 2015: Running High Performance And Fault Tolerant Elasticse...
 

Viewers also liked

A situación das mulleres galegas
A situación das mulleres galegasA situación das mulleres galegas
A situación das mulleres galegasLuisa
 
Integral Fusion
Integral FusionIntegral Fusion
Integral Fusionovaise
 
Erasmus+ hellas presentation
Erasmus+ hellas presentationErasmus+ hellas presentation
Erasmus+ hellas presentationelkarag
 
Crea8 demarzo
Crea8 demarzoCrea8 demarzo
Crea8 demarzoLuisa
 
Comenius meeting in poland
Comenius meeting in polandComenius meeting in poland
Comenius meeting in polandLuisa
 
Diamond Holiday, Ru
Diamond Holiday, RuDiamond Holiday, Ru
Diamond Holiday, RuOlga
 
Esixe Dignidade
Esixe DignidadeEsixe Dignidade
Esixe DignidadeLuisa
 
Unesco polonia
Unesco poloniaUnesco polonia
Unesco poloniaLuisa
 
Grupo cultura de paz2
Grupo cultura de paz2Grupo cultura de paz2
Grupo cultura de paz2Luisa
 
Presentación igualdade
Presentación igualdadePresentación igualdade
Presentación igualdadeLuisa
 
Pea unesco
Pea unescoPea unesco
Pea unescoLuisa
 
細說咖啡的歷史與沖泡方式
細說咖啡的歷史與沖泡方式細說咖啡的歷史與沖泡方式
細說咖啡的歷史與沖泡方式funnyshian
 
2 topic. food packaging materials
2 topic. food packaging materials2 topic. food packaging materials
2 topic. food packaging materialselkarag
 
Polonia unesco
Polonia unescoPolonia unesco
Polonia unescoLuisa
 
สมุนไพรไทยในครัวเรือน
สมุนไพรไทยในครัวเรือนสมุนไพรไทยในครัวเรือน
สมุนไพรไทยในครัวเรือนguest0299389a
 

Viewers also liked (17)

A situación das mulleres galegas
A situación das mulleres galegasA situación das mulleres galegas
A situación das mulleres galegas
 
Integral Fusion
Integral FusionIntegral Fusion
Integral Fusion
 
Erasmus+ hellas presentation
Erasmus+ hellas presentationErasmus+ hellas presentation
Erasmus+ hellas presentation
 
Crea8 demarzo
Crea8 demarzoCrea8 demarzo
Crea8 demarzo
 
Conysinphotoshop
ConysinphotoshopConysinphotoshop
Conysinphotoshop
 
Mangalore
MangaloreMangalore
Mangalore
 
Comenius meeting in poland
Comenius meeting in polandComenius meeting in poland
Comenius meeting in poland
 
Diamond Holiday, Ru
Diamond Holiday, RuDiamond Holiday, Ru
Diamond Holiday, Ru
 
Esixe Dignidade
Esixe DignidadeEsixe Dignidade
Esixe Dignidade
 
Unesco polonia
Unesco poloniaUnesco polonia
Unesco polonia
 
Grupo cultura de paz2
Grupo cultura de paz2Grupo cultura de paz2
Grupo cultura de paz2
 
Presentación igualdade
Presentación igualdadePresentación igualdade
Presentación igualdade
 
Pea unesco
Pea unescoPea unesco
Pea unesco
 
細說咖啡的歷史與沖泡方式
細說咖啡的歷史與沖泡方式細說咖啡的歷史與沖泡方式
細說咖啡的歷史與沖泡方式
 
2 topic. food packaging materials
2 topic. food packaging materials2 topic. food packaging materials
2 topic. food packaging materials
 
Polonia unesco
Polonia unescoPolonia unesco
Polonia unesco
 
สมุนไพรไทยในครัวเรือน
สมุนไพรไทยในครัวเรือนสมุนไพรไทยในครัวเรือน
สมุนไพรไทยในครัวเรือน
 

Similar to Reliable Software Development Approaches

Swug July 2010 - windows debugging by sainath
Swug July 2010 - windows debugging by sainathSwug July 2010 - windows debugging by sainath
Swug July 2010 - windows debugging by sainathDennis Chung
 
Swift Install Workshop - OpenStack Conference Spring 2012
Swift Install Workshop - OpenStack Conference Spring 2012Swift Install Workshop - OpenStack Conference Spring 2012
Swift Install Workshop - OpenStack Conference Spring 2012Joe Arnold
 
Data Grids with Oracle Coherence
Data Grids with Oracle CoherenceData Grids with Oracle Coherence
Data Grids with Oracle CoherenceBen Stopford
 
How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...
How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...
How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...DevOpsDays Tel Aviv
 
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...Emery Berger
 
DTrace Topics: Introduction
DTrace Topics: IntroductionDTrace Topics: Introduction
DTrace Topics: IntroductionBrendan Gregg
 
How logging makes a private cloud a better cloud - OpenStack最新情報セミナー(2016年12月)
How logging makes a private cloud a better cloud - OpenStack最新情報セミナー(2016年12月)How logging makes a private cloud a better cloud - OpenStack最新情報セミナー(2016年12月)
How logging makes a private cloud a better cloud - OpenStack最新情報セミナー(2016年12月)VirtualTech Japan Inc.
 
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)JiandSon
 
Fundamentals of Physical Memory Analysis
Fundamentals of Physical Memory AnalysisFundamentals of Physical Memory Analysis
Fundamentals of Physical Memory AnalysisDmitry Vostokov
 
Debugging linux kernel tools and techniques
Debugging linux kernel tools and  techniquesDebugging linux kernel tools and  techniques
Debugging linux kernel tools and techniquesSatpal Parmar
 
Drupal MySQL Cluster
Drupal MySQL ClusterDrupal MySQL Cluster
Drupal MySQL ClusterKris Buytaert
 
Logical volume manager xfs
Logical volume manager xfsLogical volume manager xfs
Logical volume manager xfsSarwar Javaid
 
Dmitriy D1g1 Evdokimov - DBI Intro
Dmitriy D1g1 Evdokimov - DBI IntroDmitriy D1g1 Evdokimov - DBI Intro
Dmitriy D1g1 Evdokimov - DBI IntroDefconRussia
 
.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and TechniquesBala Subra
 
.Net Debugging Techniques
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging TechniquesBala Subra
 
Advanced Replication
Advanced ReplicationAdvanced Replication
Advanced ReplicationMongoDB
 
Accelerated .NET Memory Dump Analysis training public slides
Accelerated .NET Memory Dump Analysis training public slidesAccelerated .NET Memory Dump Analysis training public slides
Accelerated .NET Memory Dump Analysis training public slidesDmitry Vostokov
 

Similar to Reliable Software Development Approaches (20)

Swug July 2010 - windows debugging by sainath
Swug July 2010 - windows debugging by sainathSwug July 2010 - windows debugging by sainath
Swug July 2010 - windows debugging by sainath
 
Swift Install Workshop - OpenStack Conference Spring 2012
Swift Install Workshop - OpenStack Conference Spring 2012Swift Install Workshop - OpenStack Conference Spring 2012
Swift Install Workshop - OpenStack Conference Spring 2012
 
Data Grids with Oracle Coherence
Data Grids with Oracle CoherenceData Grids with Oracle Coherence
Data Grids with Oracle Coherence
 
How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...
How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...
How We Analyzed 1000 Dumps in One Day - Dina Goldshtein, Brightsource - DevOp...
 
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
 
DTrace Topics: Introduction
DTrace Topics: IntroductionDTrace Topics: Introduction
DTrace Topics: Introduction
 
How logging makes a private cloud a better cloud - OpenStack最新情報セミナー(2016年12月)
How logging makes a private cloud a better cloud - OpenStack最新情報セミナー(2016年12月)How logging makes a private cloud a better cloud - OpenStack最新情報セミナー(2016年12月)
How logging makes a private cloud a better cloud - OpenStack最新情報セミナー(2016年12月)
 
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
 
Fundamentals of Physical Memory Analysis
Fundamentals of Physical Memory AnalysisFundamentals of Physical Memory Analysis
Fundamentals of Physical Memory Analysis
 
Debugging linux kernel tools and techniques
Debugging linux kernel tools and  techniquesDebugging linux kernel tools and  techniques
Debugging linux kernel tools and techniques
 
Drupal MySQL Cluster
Drupal MySQL ClusterDrupal MySQL Cluster
Drupal MySQL Cluster
 
淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道 淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道
 
Logical volume manager xfs
Logical volume manager xfsLogical volume manager xfs
Logical volume manager xfs
 
Dmitriy D1g1 Evdokimov - DBI Intro
Dmitriy D1g1 Evdokimov - DBI IntroDmitriy D1g1 Evdokimov - DBI Intro
Dmitriy D1g1 Evdokimov - DBI Intro
 
.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques
 
.Net Debugging Techniques
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging Techniques
 
Nodejs Session01
Nodejs Session01Nodejs Session01
Nodejs Session01
 
Advanced Replication
Advanced ReplicationAdvanced Replication
Advanced Replication
 
Data race
Data raceData race
Data race
 
Accelerated .NET Memory Dump Analysis training public slides
Accelerated .NET Memory Dump Analysis training public slidesAccelerated .NET Memory Dump Analysis training public slides
Accelerated .NET Memory Dump Analysis training public slides
 

More from Bala Subra

Serverless architectures: APIs, Serverless Functions, Microservices - How to ...
Serverless architectures: APIs, Serverless Functions, Microservices - How to ...Serverless architectures: APIs, Serverless Functions, Microservices - How to ...
Serverless architectures: APIs, Serverless Functions, Microservices - How to ...Bala Subra
 
Windows Azure Sdk
Windows Azure SdkWindows Azure Sdk
Windows Azure SdkBala Subra
 
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...Bala Subra
 
Dean Keynote Ladis2009
Dean Keynote Ladis2009Dean Keynote Ladis2009
Dean Keynote Ladis2009Bala Subra
 
Scalable Resilient Web Services In .Net
Scalable Resilient Web Services In .NetScalable Resilient Web Services In .Net
Scalable Resilient Web Services In .NetBala Subra
 
Driver Debugging Basics
Driver Debugging BasicsDriver Debugging Basics
Driver Debugging BasicsBala Subra
 
What is new in WCF 4.0?
What is new in WCF 4.0?What is new in WCF 4.0?
What is new in WCF 4.0?Bala Subra
 
System Center: Virtual Machine Manager 2008 Version 2.0
System Center: Virtual Machine Manager 2008 Version 2.0System Center: Virtual Machine Manager 2008 Version 2.0
System Center: Virtual Machine Manager 2008 Version 2.0Bala Subra
 
Parallel Computing For Managed Developers
Parallel Computing For Managed DevelopersParallel Computing For Managed Developers
Parallel Computing For Managed DevelopersBala Subra
 
IT Management Firestarter
IT Management FirestarterIT Management Firestarter
IT Management FirestarterBala Subra
 
Demystifying Windows Communication Foundation
Demystifying Windows Communication FoundationDemystifying Windows Communication Foundation
Demystifying Windows Communication FoundationBala Subra
 
Basics &amp; Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2
Basics &amp; Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2Basics &amp; Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2
Basics &amp; Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2Bala Subra
 
Denny Lee\'s Data Camp v1.0 talk on SSRS Best Practices for IT
Denny Lee\'s Data Camp v1.0 talk on SSRS Best Practices for ITDenny Lee\'s Data Camp v1.0 talk on SSRS Best Practices for IT
Denny Lee\'s Data Camp v1.0 talk on SSRS Best Practices for ITBala Subra
 
BizTalk 2010 with Appfabric Hosting in the Cloud: WCF Services vs BT2010
BizTalk 2010 with Appfabric Hosting in the Cloud: WCF Services vs BT2010BizTalk 2010 with Appfabric Hosting in the Cloud: WCF Services vs BT2010
BizTalk 2010 with Appfabric Hosting in the Cloud: WCF Services vs BT2010Bala Subra
 
How to ace your .NET technical interview :: .Net Technical Check Tuneup
How to ace your .NET technical interview :: .Net Technical Check TuneupHow to ace your .NET technical interview :: .Net Technical Check Tuneup
How to ace your .NET technical interview :: .Net Technical Check TuneupBala Subra
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance TuningBala Subra
 
Ssrs 2005 Reporting Services
Ssrs 2005 Reporting ServicesSsrs 2005 Reporting Services
Ssrs 2005 Reporting ServicesBala Subra
 

More from Bala Subra (18)

Serverless architectures: APIs, Serverless Functions, Microservices - How to ...
Serverless architectures: APIs, Serverless Functions, Microservices - How to ...Serverless architectures: APIs, Serverless Functions, Microservices - How to ...
Serverless architectures: APIs, Serverless Functions, Microservices - How to ...
 
Windows Azure Sdk
Windows Azure SdkWindows Azure Sdk
Windows Azure Sdk
 
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...
Mobile Development Architecture Ppt with Slides, Book Notes on using Web Silv...
 
Dean Keynote Ladis2009
Dean Keynote Ladis2009Dean Keynote Ladis2009
Dean Keynote Ladis2009
 
Scalable Resilient Web Services In .Net
Scalable Resilient Web Services In .NetScalable Resilient Web Services In .Net
Scalable Resilient Web Services In .Net
 
Driver Debugging Basics
Driver Debugging BasicsDriver Debugging Basics
Driver Debugging Basics
 
What is new in WCF 4.0?
What is new in WCF 4.0?What is new in WCF 4.0?
What is new in WCF 4.0?
 
System Center: Virtual Machine Manager 2008 Version 2.0
System Center: Virtual Machine Manager 2008 Version 2.0System Center: Virtual Machine Manager 2008 Version 2.0
System Center: Virtual Machine Manager 2008 Version 2.0
 
Parallel Computing For Managed Developers
Parallel Computing For Managed DevelopersParallel Computing For Managed Developers
Parallel Computing For Managed Developers
 
IT Management Firestarter
IT Management FirestarterIT Management Firestarter
IT Management Firestarter
 
Demystifying Windows Communication Foundation
Demystifying Windows Communication FoundationDemystifying Windows Communication Foundation
Demystifying Windows Communication Foundation
 
Basics &amp; Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2
Basics &amp; Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2Basics &amp; Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2
Basics &amp; Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2
 
Denny Lee\'s Data Camp v1.0 talk on SSRS Best Practices for IT
Denny Lee\'s Data Camp v1.0 talk on SSRS Best Practices for ITDenny Lee\'s Data Camp v1.0 talk on SSRS Best Practices for IT
Denny Lee\'s Data Camp v1.0 talk on SSRS Best Practices for IT
 
BizTalk 2010 with Appfabric Hosting in the Cloud: WCF Services vs BT2010
BizTalk 2010 with Appfabric Hosting in the Cloud: WCF Services vs BT2010BizTalk 2010 with Appfabric Hosting in the Cloud: WCF Services vs BT2010
BizTalk 2010 with Appfabric Hosting in the Cloud: WCF Services vs BT2010
 
Biz talk BI
Biz talk BIBiz talk BI
Biz talk BI
 
How to ace your .NET technical interview :: .Net Technical Check Tuneup
How to ace your .NET technical interview :: .Net Technical Check TuneupHow to ace your .NET technical interview :: .Net Technical Check Tuneup
How to ace your .NET technical interview :: .Net Technical Check Tuneup
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance Tuning
 
Ssrs 2005 Reporting Services
Ssrs 2005 Reporting ServicesSsrs 2005 Reporting Services
Ssrs 2005 Reporting Services
 

Reliable Software Development Approaches

  • 1.  Mario Hewardt  Daniel Pravat Senior Development Lead Senior Development Lead Microsoft Corporation Microsoft Corporation …and we approve this message
  • 2.
  • 3. We Need Reliable Software    
  • 4.
  • 5.    AWD PDC 2008 Feedback/Questions    
  • 6. Open source code Source: Coverity White Paper
  • 7. with examples      
  • 8.        http://www.microsoft.com/whdc/devtools/debug ging/default.mspx   
  • 9.          
  • 10.          
  • 14.              
  • 16.               
  • 19. Thread 0 cs_DB1 Acquisition order cs_DB1 is reversed The length may be No progress different = Deadlock A,B,C = OK B,C = OK A,B = OK A,C = OK Thread 1 cs_DB2 B,C,A = Deadlock
  • 21. Remote Test Test client Test SystemTest SystemTest System Smart System Systems client Sources Symbols Sources   
  • 23. 09async.exe DisplayError calls  There is another thread smashing Sleep the stack Return address is  How to catch this async saved operation? Sleep calls  What are the implications of this SleepEx bug? Return address is  Can the execution be controlled? changed to X saved  Can this execution be prevented? …  Welcome NX bit Execution starts at X
  • 25.
  • 27.    Build a Extract Index Publish Use new public symbols symbols symbols version symbols
  • 28.         
  • 30.          
  • 32.     Store the Extract the information Build a new Publish Use the source file required to version symbols symbols list retrieve the file from SC
  • 34. C:>pdbstr –r –p:%_NT386TREE%sym.priretailexe03sample.pdb –s:srcsrv SRCSRV: ini ------------------------ VERSION=1 INDEXVERSION=2 VERCTRL=Visual Source Safe DATETIME=Mon Jan 8 00:04:15 2007 SRCSRV: variables --------------------- SSDIR=C:AWDVSS SRCSRVENV=SSDIR=%AWD% VSSTRGDIR=%targ%%var2%%fnbksl%(%var3%)%var4% VSS_EXTRACT_CMD=ss.exe get -GL”%vsstrgdir%” -GF- -I-Y -W “$/%var3%” - V”%var4%” VSS_EXTRACT_TARGET=%targ%%var2%%fnbksl%(%var3%)%var4%%fnfile%(%var1% ) AWD=C:AWDVSS SRCSRVTRG=%VSS_extract_target% SRCSRVCMD=%VSS_extract_cmd% SRCSRV: source files -------------------- c:awdchapter3spydbg.cpp*AWD*chapter3/spydbg.cpp*VERSION1 SRCSRV: end ------------------------
  • 36.
  • 37.
  • 38.         
  • 39.     
  • 40.     
  • 42.       
  • 44.     
  • 45. CreateEvent( … …); WIN32 API User Kernel Header Ref Count Obj Count Object Event 1 1 <addr> EPROCESS 1 1 <addr> Header 3 1 <addr> Mutant
  • 46. HANDLE hFile=CreateFile( pWorkerData->pszFileName, FILE_READ_DATA, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); // Use file handle CloseHandle(hFile);
  • 47.         
  • 48. No Done Leak? Type of resource Initial Analysis Use tools Avoidance Strategy
  • 53. Application Default C Runtime Process Other Heaps Heap Heap Heap Manager Virtual Memory Manager
  • 54. BYTE* pMem=(BYTE*) HeapAlloc(GetProcessHeap(), 0, 100); // Use memory HeapFree(GetProcessHeap(), 0, pMem);
  • 55.          
  • 58.    
  • 59.
  • 60.
  • 61.    
  • 63.       Web Database Web client Middle tier front-end back-end
  • 64.         
  • 65.  
  • 66. The User Identity (principal)       
  • 67. 0:000> !token 7bc -n TS Session ID: 0 User: S-1-5-21-1060284298-2111687655-1957994488-1003 (User: XP-SP2TestAdmin) Groups: 00 S-1-5-21-1060284298-2111687655-1957994488-513 (Group: XP-SP2None) Attributes - Mandatory Default Enabled 01 S-1-1-0 (Well Known Group: localhostEveryone) Attributes - Mandatory Default Enabled 02 S-1-5-32-544 (Alias: BUILTINAdministrators) Attributes - Mandatory Default Enabled Owner 03 S-1-5-32-545 (Alias: BUILTINUsers) Attributes - Mandatory Default Enabled 04 S-1-5-4 (Well Known Group: NT AUTHORITYINTERACTIVE) Attributes - Mandatory Default Enabled 05 S-1-5-11 (Well Known Group: NT AUTHORITYAuthenticated Users) Attributes - Mandatory Default Enabled 06 S-1-5-5-0-35778 (no name mapped) Attributes - Mandatory Default Enabled LogonId 07 S-1-2-0 (Well Known Group: localhostLOCAL) Attributes - Mandatory Default Enabled Primary Group: S-1-5-21-1060284298-2111687655-1957994488-513 (Group: XP-SP2None) Privs: 00 0x000000017 SeChangeNotifyPrivilege Attributes - Enabled Default 01 0x000000008 SeSecurityPrivilege Attributes - ... 17 0x000000009 SeTakeOwnershipPrivilege Attributes - 18 0x00000001e SeCreateGlobalPrivilege Attributes - Enabled Default 19 0x00000001d SeImpersonatePrivilege Attributes - Enabled Default Auth ID: 0:1c3a8 Impersonation Level: Identification TokenType: Impersonation
  • 68. The Discretionary Access Control List (DACL)       
  • 69. 0:000> !acl 000840ac ACL is: ACL is: ->AclRevision: 0x2 ACL is: ->Sbz1 : 0x0 ACL is: ->AclSize : 0x1c ACL is: ->AceCount : 0x1 ACL is: ->Sbz2 : 0x0 ACL is: ->Ace[0]: ->AceType: ACCESS_ALLOWED_ACE_TYPE ACL is: ->Ace[0]: ->AceFlags: 0x0 ACL is: ->Ace[0]: ->AceSize: 0x14 ACL is: ->Ace[0]: ->Mask : 0x00120089 ACL is: ->Ace[0]: ->SID: S-1-1-0
  • 70. kd> !sd 00084098 ->Revision: 0x1 ->Sbz1 : 0x0 ->Control : 0x8004 SE_DACL_PRESENT SE_SELF_RELATIVE ->Owner : S-1-5-18 ->Group : S-1-5-32-544 ->Dacl : ->Dacl : ->AclRevision: 0x2 ->Dacl : ->Sbz1 : 0x0 ->Dacl : ->AclSize : 0x1c ->Dacl : ->AceCount : 0x1 ->Dacl : ->Sbz2 : 0x0 ->Dacl : ->Ace[0]: ->AceType: ACCESS_ALLOWED_ACE_TYPE ->Dacl : ->Ace[0]: ->AceFlags: 0x0 ->Dacl : ->Ace[0]: ->AceSize: 0x14 ->Dacl : ->Ace[0]: ->Mask : 0x00120089 ->Dacl : ->Ace[0]: ->SID: S-1-1-0 ->Sacl : is NULL
  • 71. The Security Reference Monitor (SRM)         
  • 73. void MTAClientCall() { COSERVERINFO si; MULTI_QI mqi; ... if (SUCCEEDED(CoCreateInstanceEx( CLSID_Calculator, NULL, CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER, &si, 1, &mqi ))) { ICalculator * pCalculator = NULL; pCalculator = (ICalculator*)mqi.pItf; __int32 result = 0; wprintf(L"Calling SumSlow ..."); pCalculator->SumSlow(1,2, &result); pCalculator->Release(); wprintf(L"donen"); } }
  • 74.     DCOM HOST OS SCM Launch Remote RPCSS DCOM client Server server DCOM client
  • 77.
  • 78.
  • 79.       
  • 80.
  • 83. Application Default C Runtime Process Other Heaps Heap Heap Heap Manager Virtual Memory Manager
  • 84. Look aside Table 0 Unused 1 16 2 24 3 32 … … 127 1024
  • 85. Free Lists Segment List 0 Variable Size 1 2 1 unused … 2 16 X 3 24 … … 127 1016
  • 87. Free Block Busy Block Busy Block Uncommitted range
  • 88.     
  • 89. Pre-allocation Metadata User accessible part Post-allocation Metadata Pre-allocation Metadata Current Previous Seg Tag Flags Unused User accessible part Size Size Index Index Post-allocation Metadata Suffix Fill Area Heap User accessible part Bytes (debug) Extra
  • 90.     Allocation Size: 16 Allocation Size: 32 Allocation Size: 16 Allocation Size: 64
  • 91.      
  • 95.
  • 96.
  • 97.      
  • 98.     
  • 99.       
  • 100. Windows Error Reporting Service Crash data over HTTPS Error Sent Dr. Query Fault Watson Fault response over HTTPS Data Process Crash ISV
  • 102.    http://www.codeplex.com/wer/     
  • 104.
  • 106. Debugging Tools for Windows          
  • 107. Debugging Tools for Windows            
  • 108. Debugging Tools for Windows         
  • 109. Main() { ... int operationCount = 0; for (; ; ) { operationCount++; HostInfo hi = HostInfo.GetDefault(hostAddress, userName, password); IWSManSession session = GetSession(hi); string response = session.Get("wmicimv2/Win32_OperatingSystem", 0); Console.Write("rNumber of calls: " + operationCount); } ... }
  • 110. static public IWSManSession GetSession(HostInfo hi) { IWSManSession session = null; // Get a cached session string key = hi.GetKey(); if (!sessionCache.TryGetValue(key, out session)) { session = CreateSession(hi); sessionCache[key] = session; } return session; }
  • 113. Debugging Tools for Windows         
  • 115.      Microsoft Advanced Windows Debugging and Troubleshooting  Crash Dump Analysis  If broken it is, fix it you should  
  • 117.
  • 118. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.