Posts

RPC Debugging To use the dbgidl interface introduced in XP, the sytem hosting RPC services must be configured to maintain RPC troubleshooting state information. The 'RPC Troubleshooting State Information' GPO must be enabled, typically in the LGPO using gpedit.msc. "Computer Configuration->Administrative Templates->System->Remote Procedure Call." Then you can use rpcexts!* in windbg or dbgrpc.exe
Memory leak detection tools "gflags -i foobar.exe +ust" to enable stack tracing. "set _NT_SYMBOL_PATH= SRV*c:\symbols* http://msdl.microsoft.com/download/symbols" to set the symbol path. Download umdh tools from Microsoft . "umdh -p:124 -ffoobar.log" to take multiple snapshots. ""dhcmp foobar1.log foobar2.log" to compare the snapshots ie. leaks. And, then there is ftp://ftp.microsoft.com/ PSS/Tools/Developer%20Support%20Tools/LeakDiag/leakdiag125.msi - this can also be used to take debug dumps of any process.
Kernel debugger essentials .cache forcedecodeuser or .thread /p to translate PTEs to physical addresses. .process # | .thread to switch context to a specific process !process 0 0 to get list of processes. and of course, !analyze -v to get a quick summary of a crash dump.
Larry Ellison on open source The reasons for not buying JBoss/opensource is interesting read. FT interview with Larry Ellison
Java/J2EE - so many choices, but do you want all of them? Geronimo - no EJB3 support. With BEA's donation of Kodo it might change soon. JBoss - Usable J2EE server, just be careful not to tread on non-standard stuff. Glassfish - Sun never had good servers which you can run with limited resources. The beta builds looked ok. BEA - They 'had' an advantage a few years ago. What are they upto nowadays - Beehive? Oracle - They seems to be getting their stuff together with Project Fusion, but still noone wants to use their J2EE server. ADF Faces seemed good. Sun enterprise system - Free, but is anyone using it? Never trust any software which requires 1GB to work. Hibernate - Works, though there are complexities associated with getting it to work properly in a disconnected scenario. Has good tool support. Opt for EJB3 since it is based on standards. SCA/SDO - Good stuff in theory, I doubt if Tuscany or anyone can come up with an efficient implementation though. Dynamic model doesn...
Building and running Jboss from CVS set CVSROOT=:pserver:anonymous@anoncvs.forge.jboss.com:/cvsroot/jboss cvs co jboss-head cd jboss-head\build build.bat cd jboss-head\build\output\jboss-5.0.0alpha\bin run.bat
Oracle donates ADF Faces to Apache The first drop of ADF Faces including over 100 components and their source code is available at http://people.apache.org/~bdudney/apache-drop.zip The PPR support aka AJAX, process scope variables and the skinning support is the highlight of ADF Faces.
Mounting iso images in Windows XP Download the undocumented tool for Windows XP from Virtual CD-ROM Control Panel for Windows XP to mount .iso, .img files. Vista installation tips: You can use the above tool to install Vista Beta 1 on Virtual PC 2004 since the VPC will fail to recognize the DVD image if you try to mount it directly. Create a new partition and reboot to continue installation of Vista beta1. Install VPC additions to add the video driver.
Kernel debugging on one machine using Virtual PC 2004 SP1 & Windows XP You no longer need to buy another machine or a copy of SoftIce to do full kernel debugging using two machines. This is a good setup for learning & hobby projects. Setup target VM Go to My Computer -> Properties -> Advanced -> Settings (Startup and Recovery) -> Edit Add '/DEBUG /DEBUGPORT=COM1' to the end of the settings in the boot file. Setup host machine. Edit settings for VM, configure COM1 to use a named pipe. Eg. "bkslash-bkslash-dot-\pipe\debug" Start KD by running "kd -y SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols -k com:pipe,port=\\.\pipe\debug,resets=0,reconnect" or equivalent command. Restart target VM, you should see a message in KD saying "Connected to Windows XP..." Reference: http://blogs.msdn.com/virtual_pc_guy/archive/2005/10/20/482413.aspx
.NET Decompiler aka Disassembler aka Reflector This is the best .NET decompiler around and it is free. http://www.aisto.com/roeder/dotnet/ This will decompile .NET bytecode(including the base class library) into more than one language(C#, VB, J# etc).
Deadlock in CLR involving GC & OS Loader lock. When the Microsoft .NET Framework Execution Engine has to perform garbage collection (GC), the .NET Framework Execution Engine must first suspend all managed threads. In most circumstances, a managed thread must set itself so that it can be suspended before leaving its managed state to run unmanaged code. This thread state is named GC PreEmptable. The GC PreEmptable thread state must be entered by the managed thread before leaving the managed state.In this particular deadlock condition, three different threads are involved as follows: •Thread 1: This thread is waiting for the Windows NT Loader Lock to complete its task. •Thread 2: This thread is the owner of the Windows NT Loader Lock. This thread has been suspended by the garbage collection thread. This thread will not release the Windows NT Loader Lock until this thread is restarted by the .NET Framework Execution Engine after the garbage collection is completed. In this case, becaus...
Eclipse for Java Getting the right free plugins for Eclipse is important: 1. To develop J2EE programs, Tomcat web applications, browse and query database contents, edit Html, Xml, schema files etc. - http://www.eclipse.org/webtools/ The ' Getting Started ' site has installation information. Please note that this is still in beta but quite usable. This gives you pretty much everything for web development. 2. To develop Hibernate applications, edit mapping files & running queries. - http://www.jboss.com/products/overview/jbosside Here are the ' Download Instructions '. 3. The Spring IDE - http://www.springframework.org/spring-ide/eclipse/
XmlSerializer in .NET easier way to access xml than DOM. maps xsd types to CLR types. can only support datastructures that can be expressed in xsd. can be executed in unsafe environments. additionally support SOAP section-5 encoding used by ASP.NET webservices. generates and compiles code on the fly to do serialization and deserialization. uses code dom compilation which requires use of temporary files on disk. hence the process should have read/write permissions on the folder. use ' Filemon ' to diagnose issues.
Enabling JIT debugging for managed code. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ .NETFramework\DbgJIT\ DebugLaunchSetting =2 (=1 to disable)
Debugging service/process startup. Please refer to the excellent article: http://support.microsoft.com/kb/824344 Also, in Visual Studio set the 'Debugger' key to point to the VS solution as in "devenv.exe my.sln /run" Note that you can change the SCM timeout for the service startup in milliseconds at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control, ServicesPipeTimeout DWORD
Setting breakpoints in .NET webservice Put the following in a .ini file which has the same name as the assembly & run iisreset. [.NET Framework Debugging Control] GenerateTrackingInfo=1 AllowOptimize=0
Debugging XMLSerializer usage in .NET webservice. You can add a switch to the machine.config to keep compiler generated files: [system.diagnostics] [switches] [add name="XmlSerialization.Compilation" value="4"] [/switches] [/system.diagnostics] After this, the temp directory would have the generated files.
Running out of user ports under stress This is generally useful if you are creating and closing a lot of connections: \HKLM\System\CurrentControlSet\Services\Tcpip\Parameters MaxUserPort REG_DWORD 0xfffe \HKLM\System\CurrentControlSet\Services\Tcpip\Parameters TcpTimedWaitDelay REG_DWORD 0x2
Checking if client and server are the same machine. bool IsClientAndServerSame(HttpRequest request) { String remoteAddress = request.UserHostAddress; if (remoteAddress == null remoteAddress.Length == 0) return false; if (remoteAddress == "127.0.0.1" remoteAddress == "::1") return true; if (remoteAddress == request.LocalAddress) return true; return false; }
Dynamically loading .NET assemblies. It is not possible to unload a single assembly, so usually you have to load such assemblies in a separate appdomain to ensure proper cleanup. http://www.gotdotnet.com/team/clr/AppdomainFAQ.aspx#_Toc514058497 has additional information on how to load an assembly in another appdomain.