Customer Support -- FAQ
 
Go back to:
Support

This page contains answers to common questions handled by our support staff, along with some tips and tricks that we have found useful and presented here as questions.

Your question is not listed? Email your question to Support at Entrek.



Entrek CodeSnitch 1.4 FAQ's

Entrek ProcMan 1.4 FAQ's

Entrek Toolbox 1.4 General FAQ's

Product: Entrek CodeSnitch 1.4

I get the error Unable to Create Online Manager component.

This occurs if you disconnect CodeSnitch from your target device, but it does not close down cleanly. You must reset your target device, or manually terminate the toolbox.exe process on the target device. One way to do that is to run this command on the target device: "toolbox /shutdown".
Back to Top

 


Product: Entrek CodeSnitch 1.4

How do I track API calls in a device driver or other DLL?

  1. In the Run Program dialog, enter the path of the DLL in the application path.
  2. Check the 'Instrument Only' option, as well as any desired tracking options and hit Go!.
  3. Leaving CodeSnitch connected, manually start your application that uses the DLL. When the DLL gets loaded, a new Event View window will pop up begin receiving events.
Back to Top

 


Product: Entrek CodeSnitch 1.4

Can I run my application in the debugger and track it in CodeSnitch at the same time?

Yes.

  1. Build and Download your application like you normally would from eMbedded Visual C++.
  2. Enter the application path in the Run Program Dialog.
  3. Check the desired tracking options.
  4. Check the 'Instrument Only' option, then hit Go!.
  5. In EVC, start the debugger. EVT will check the file, then report that it is up to date. Events should start appearing in a new window in CodeSnitch once the application loads.
Note: In order for this to work, you must not rebuild the application after you hit Go! in CodeSnitch, or EVT will download the new version over the instrumented version!
Back to Top

 


Product: Entrek CodeSnitch 1.4

CodeSnitch reports an address and DLL name instead of function and line number

CodeSnitch was unable to find symbolic information for a module, or no symbols
existed for the specified address.

Make sure you have debug symbols turned on in the project settings for your application or module. If you generated your application with the wizard, Debug configurations have symbols by default, but Release configurations do not.

To generate symbols:

  1. In your EVC workspace, click the "Project\Settings..." menu command.
  2. Select your project in the list, and pick the configuration in the combo box above it.
  3. Select the C/C++ tab.
  4. Select the "General" category, and make sure the combobox under Debug Info has Program database selected.
  5. For Static library projects, that's it. You still need to update your main DLL or EXE application, though.
  6. For the DLL or EXE projects, click the Link tab.
  7. In the "General" category, check the box labelled "Generate debug info".
  8. Select the "Customize" category, and check the box labelled "Use Program Database". Change the default PDB file if you wish.
  9. You're done. Save your project, rebuild, and try again.
Back to Top

 


Product: Entrek CodeSnitch 1.4

How do I get CodeSnitch to automatically scroll to the most recently added event?

You can get what you want a different way:

Do the following:

  • Select View | Preferences
  • Select the Columns Tab
  • Check the 'Sequence' column, then click OK.
  • Return to the Event Viewer (the main window where the events are)
  • Click the 'Sequence' column header twice, or until you see the down arrow (v). This sorts the events in descending order according to that column.
Now, as new events are added, they will appear at the top of the events instead of the bottom.

This also works with any of the other fields. If you sort by a field, when new events are added, the sort order is maintained.
Back to Top

 


Product: Entrek CodeSnitch 1.4

Can CodeSnitch connect to a device without RAM file system support?

No. CodeSnitch can connect to a MinKern configuration, but the fsysram module must be
included as part of the platform because it uses some file system APIs in order to instrument
modules and transfer information.

Of course, if you have no RAM file system, there are no modules that CodeSnitch would be able to instrument anyway.
Back to Top

 


Product: Entrek CodeSnitch 1.4

Can CodeSnitch report false positives for memory and resource leaks?

Yes. If you use APIs not supported by CodeSnitch to free memory allocated by APIs that are supported by CodeSnitch, a false memory leak will be reported. Here are some APIs that can cause this:

VariantClear (for vt equal to VT_ARRAY)
SafeArrayDestroy (for vt equal to VT_BSTR)
ReleaseStgMedium (for storage type equal to TYMED_HGLOBAL)

Back to Top

 


Product: Entrek CodeSnitch 1.4

I am getting what appears to be a false memory underwrite/overwrite error.

If you get a memory underwrite or overwrite error, but you are certain that no such error is actually occurring, you probably have a mixed instrumentation problem. That is, memory was allocated with an unsupported API and deallocated with a supported API, or vice-versa. The online help lists all APIs that are supported by CodeSnitch. In this case, usually the best thing to do is turn off 'detect memory underwrites and overwrites', because CodeSnitch may be corrupting the heap when a LocalFree is called. Here are some APIs to watch out for:

CeReadRecordProps (may perform a LocalAlloc)
GetClipboardDataAlloc (may perform a LocalAlloc)

These problems will go away as we release new API support for CodeSnitch.
Back to Top

 


Product: Entrek CodeSnitch 1.4

CodeSnitch hangs if I select File | Save or File | Open

A fix for this problem was provided in the February 6, 2002 service release of CodeSnitch.

For some installations of CodeSnitch, the program hangs when File | Save or File | Open is selected. This has been found to only occur on Windows 2000 with Internet Explorer version 6. If you have a different configuration than the above and you experience this problem, please submit a bug report or email support@entrek.com.

Back to Top

 


Product: Entrek CodeSnitch 1.4

Why don't I see an overwrite in my test code which intentionally overwrites memory?

Many people have tried this test or something like it:

char buf[3];
strcpy(buf, "Hello");

and have noted that no memory overwrite is detected,
though one is obviously present. The reason for this
is that CodeSnitch does not detect overwrites in
stack memory, only heap memory.

Secondly, CodeSnitch detects the overwrite at the time the
memory is freed, not at the moment it occurs. Example:

char *str = new char[3];
strcpy(str, "Hello");
free(str); // <-- error not reported until this line

The same applies to underwrites. This has to do with the way
CodeSnitch tracks the error: It intercepts the API call to allocate
memory, inserts fill bytes before and after the memory and returns
the modified memory block to the user. When the block is freed,
CodeSnitch checks the filled areas to see if it has changed. If it
has, it reports an underwrite or overwrite.
Back to Top

 


Product: Entrek CodeSnitch 1.4

I see Function() in [Unknown file], line 0 in the callstack pane

This happens if CodeSnitch found or the user specified symbols
that do not match the current event. You can usually fix the problem by clearing
the symbol path and ensuring only the correct symbols are selected for an event.

To do this:

  1. After gathering events, save your event log using File | Save.
  2. Close the event log.
  3. Go to View | Preferences, and select the 'Clear' button in the 'Settings' tab, then click OK.
  4. Return to the main screen, and open your saved event Log.
  5. When CodeSnitch needs to display a location, the Find File dialog will appear, requesting you to enter the location of the DLL that contains the symbols needed to resolve the location.
  6. When entering a DLL location, pay attention to the message displayed in the bottom of the Find File dialog. If the currently selected folder has a file with the right name but CodeSnitch says it is the wrong one, selecting it may cause the [Unknown file] problem.
  7. You may re-resolve symbols for an item in the callstack or event log at any time by right-clicking and selecting 'Locate Symbols' to bring up the Find File dialog again.
Back to Top

 


Product: Entrek CodeSnitch 1.4

I'm trying to run an application in the x86em emulator under CodeSnitch but when I run it the application doesn't start.

One or more redirector files (like $COREDLL.00) may be referenced by an instrumented application but are missing.

You can repair this condition by selecting 'Dependencies' for your application and unchecking ALL of the boxes that are not grayed, then clicking Go! and running the application. Then, close the application and try again. This time you should receive some events.

If this doesn't work, it is possible some old files are left behind from version 1.1 and lower ($000000.DLL, etc). Deleting the files will not do any good; you must redeploy any instrumented applications and modules in the emulator directory. To identify an instrumented application, run
the following command, assuming you have installed eMVT 3.0:

depends /imports *.dll > output.log
depends /imports *.exe > output2.log

Next, open the output.log and output2.log in Notepad, and search for the strings $CORE and $0000. If you find any occurrences of these files, you will need to redeploy the DLL or EXE that refers to it.
Back to Top

 


Product: Entrek CodeSnitch 1.4

CodeSnitch is not responding for a long time when viewing event logs in Windows XP.

There are some issues with the DBGHELP API supplied by Microsoft that requires CodeSnitch to contain code which works around these issues. On Windows ME, NT, and 2000, the workaround is fast and unnoticeable. On Windows XP, the DBGHelp API that comes with the OS seems to behave differently, causing the workaround to be many times slower. We are still researching this issue to determine if this is a bug in our code or a bug in Windows XP. However, there is a workaround:

If you use the old DBGHELP.DLL that ships with Windows 2000 or a certain older version of the Microsoft Platform SDK, this problem disappears. However, since it may introduce other problems still unknown as of yet, we feel it necessary to withhold the file from the TOOLBOX installer until we have determined it is safe to include it.

You can download the old DBGHELP.DLL from our FTP site at ftp://ftp.entrek.com/Unsupported/DBGHelp.dll .
DO NOT copy it into your system folder! Copy it directly into the C:\Program Files\Entrek\TOOLBOX\Bin directory.
Back to Top

 


Product: Entrek CodeSnitch 1.4

My application runs very slowly under CodeSnitch. Is there any way to get better performance?

CodeSnitch does send many events to the desktop, at least one for each API call it traps. In some cases, this may cause the application to run very slowly when running under CodeSnitch.

Here are a few ways to get better performance:
  1. Use the fastest possible connectivity mechanism between you desktop and target device. Ethernet, of course, yields best performace. Serial is not practical in many situations.

  2. Decrease the number of events reported. On the Professional edition, there is a "Runtime Options" button on the Run dialog. Use that to set the minimum level of error reporting you need to analyze the problem you are trying to solve. Alternatively, the number of events you see CodeSnitch report may cause alarm and raise the question "Does my application really use the heap that much?". You may determine better strategies for using the heap.

  3. CodeSnitch on the target device sends events to CodeSnitch on the desktop in batches. A batch is defined as “when the event buffer fills” or “when a timeout period” expires. Then, on the desktop, events are processed in batches (a batch defined the same way).

    Both parameters can be set in the registry.

    The buffer size is controlled by a value called EventQueueSize. On the target device, the default size is 20480 (20K) and the max size is 1048576 (1MB). On the desktop, the default size is 1MB and the max is 10MB.

    The timeout period is controlled by a value called WaitCycle. The default value is 1 second on both the target device and desktop.

    You should not have to adjust the desktop settings.

    On the device, first try setting the EventQueueSize to 51200 (bytes) and the WaitCycle to 10000 (milliseconds). If that looks like it’s helping, you might try increasing one or both values to get even better performance.

    The registry path is HKEY_LOCAL_MACHINE\Software\Entrek\TOOLBOX\CodeSnitch\EventQueue.

Back to Top

 


Product: Entrek CodeSnitch 1.4

My application works running outside of CodeSnitch, but hangs or crashes when testing with CodeSnitch. Why?

CodeSnitch effectively traps API calls your application makes through a shimming process at instrumentation time. CodeSnitch merely re-routes calls your application makes to system DLLs such as coredll.dll to a CodeSnitch DLL. Inside these hooks is where CodeSnitch, among other things, does parameter verification, heap corruption detection, and event reporting.

These API hooks affect the internal timing of an application. Especially if you have a multithreaded application, it is possible that there is a race condition being exposed that you wouldn't see outside of CodeSnitch. This can result in the program hanging or crashing.

Additionally, inside the API hooks, CodeSnitch creates objects from the heap, mainly for event reporting. It allocates these objects from the default process heap - the same one that is used by your application calls to LocalAlloc, new, malloc, etc. This sometimes exposes a problem in the program (unfortunately resulting in a crash or hang) when an app fails to, for example, initialize member variables in a class or zero-out an array or struct it allocates from the heap. Running outside of CodeSnitch, the program may get a block from the heap that has never been used, and is thus "initialized" - already zeroed-out. But in CodeSnitch, it gets back a block that has previously been used (perhaps internally by CodeSnitch) and has unpredictable contents.

To see how this can cause a problem:


  1. Download this small example program.
  2. Comment out line 16 that initializes m_pszString in the CString constructor.
  3. Build the program and set a breakpoint on line 17.
  4. Run the program from the debugger and note the value for m_pszString when you hit the breakpoint. It will be NULL, but not because the program initialized it to NULL, but rather because the heap block used has never been used before.
  5. Either allow the program to run until terminatation (hit F5 in the debugger to continue execution) or just stop debugging.
  6. Now connect CodeSnitch and instrument the test application. Use the "Instrument Only" option.
  7. Once instrumented, start the program from the debugger. Make sure the eVC / VS 2005 settings are such that the program will not be deployed when you run from the debugger. Otherwise it will copy the program from your hard drive, overwriting the instrumented program.
  8. When you reach the breakpoint on line 17, note that m_pszString has some random value. This is because the block allocated from the heap has been previously used (by CodeSnitch most likely to report the "Process Started" event). This can then cause problems later, for example, in the SetString() method.
These type of problems can be "benign" (the program is "working" fine) when executed outside of CodeSnitch, but can lead to a crash or hang when testing with CodeSnitch. If you have the Professional version of CodeSnitch, you may try using the "Heap Corruption” and "Report Critical Section usage" features (available on the Runtime Options screen). If it reports an underwrite, overwrite, or “bad signature” errors in the Results tab, try fixing those first. The next thing is to review your code for these potential problems. The problem illustrated in this example could only be determined by code review.

Back to Top

 


Product: Entrek ProcMan 1.4

How do I know which thread is which in the Threads view under a process?

If you write a device driver or ActiveX control, or other module that runs in
the process space of an application you did not write, your threads will be one
of many in the threads list. To identify your particular thread, try
inserting an API call in your thread when it is created that will give the
thread some distinguishing feature or characteristic visible from ProcMan.

For example, the default thread Quantum is 25 ms for versions before 3.0, and 100 ms
for versions after 3.0. You can call CeSetThreadQuantum(GetCurrentThread(), 99) from
each thread in your code, which would help distinguish from the other threads
in the system

Back to Top

 


Product: Entrek ProcMan 1.4

Can ProcMan connect to a device without RAM file system support.

Yes. You must have the CESH server component available, and have the Platform Builder 3.00 Add-on Pack installed. You must be running Platform Builder with an active connection to a development device.

In order to connect to a device, you must configure Platform Manager for that device. Here's how:

  1. Run ProcMan.
  2. Select Device | Configure Platform Manager
  3. Select your device in the tree under your platform, then click Properties.
  4. Select your transport method, for instance EDBG or TCP/IP, then click Advanced.
  5. Select CESH from the list of components, then click Configure.
  6. Specify the path to your flat release directory in the edit box provided.
  7. Check the box labelled "Use this server for all file operations." This will cause all remote tool components to be copied to the flat release directory and downloaded only when needed.
  8. Close the Platform Manager configuration and return to ProcMan. You should now be able to connect to the device and view your system.
Back to Top

 


Product: Entrek Toolbox 1.4 General

Does TOOLBOX support X86 emulation (x86em)?

TOOLBOX does not currently support the x86 emulators (x86em) for PocketPC or Handheld PC. We will have support for the x86 emulators in a future release.

Back to Top

 


Product: Entrek Toolbox 1.4 General

Does Entrek TOOLBOX support Windows Mobile 5.0 with Visual Studio 2005?

Yes, Entrek TOOLBOX does support Windows Mobile 5.0. However, there are a few important things you must do to enable it.

  1. There is a required patch you must install. See this Readme for details, including installation and Known Issues.
  2. In the Known Issues section on the patch readme is an item regarding CPU selection. For connecting to Windows CE 5.0 and Windows Mobile 5 devices, use the /targetcpu:armv4i to start ProcMan and CodeSnitch. You may want to create a shortcut on your Desktop or Start Menu to facilitate this.
  3. Entrek tools use an older connectivity mechanism (Platform Manager) than what is available in VS 2005. VS 2005 uses Core Connectivity, a new technology introduced in VS 2005. To use Entrek tools, you still need Platform Manager. The best way to get that is to install eMbedded Visual C++ 4.0 (eVC 4.0) from here. Also install eVC 4.0 Service Pack 4.
  4. Entrek ships a redistributable DLL from Microsoft (called dbghelp.dll) used for resolving addresses in your program to source code. That DLL is not compatible with symbols created by VS 2005. To workaround this, rename or delete the file shipped by Entrek, and then set a path to the version installed by VS 2005 (or copy it to the Entrek directory). The version shipped with Entrek TOOLBOX is typically located in C:\Program Files\Entrek\TOOLBOX\Bin. The version shipped with Visual Studio 2005 is typically located in C:\Program Files\Microsoft Visual Studio 8\Common7\IDE. NOTE: The latest version of the patch already includes this file, so you can skip this step if you've just installed the patch.
  5. Create a new Platform Manager Connection and configure it to use ActiveSync. To create a new connection, start either Entrek ProcMan or CodeSnitch, and click the "Configure Platform Manager..." item on the Device menu. Click the "Add Device" button on the "Windows CE Platform Manager Configuration" dialog that appears. Enter a name for the device, such as "Windows Mobile 5.0 device". Then click the "Properties" button. A "Device Properties" dialog will appear. Select ActiveSync for both the "Transport" and "Startup Server" properties.
  6. Now establish an ActiveSync connection with your target device. Once you have an ActiveSync connection, you can connect the Entrek tools to the target. Note that if you are targetting a Windows Mobile 5.0 emulator, you must first configure ActiveSync to allow DMA connections (right-click the ActiveSync icon in the taskbar tray and select the "Connection Settings..." item to configure this). You will then need to "cradle" the device emulator using the Device Emulator Manager in VS 2005 (on the Tools menu). In the Device Emulator Manager, right-click on your target emulator and select the "Connect" item that appears in the context menu. Then right-click again and select the "Cradle" item. ActiveSync will then automatically connect to the emulator device. You cannot have a physical device already connected to ActiveSync. If you do, first disconnect it before cradling the emulator device.


Back to Top

 


Product: Entrek Toolbox 1.4 General

Entrek tools hang when connecting to the target device. How can I resolve this issue?


  • You most likely need to install a required patch over the original installation. See www.entrek.com/products/readme.htm for information about installing this patch. Please note that the patch does not contain new versions of each file shipped in the original product, so do not delete the original files. Simply replace the installed files with the new version.
  • Entrek tools may select the wrong binaries to install on your target device. For example, it may select ARMV4T, when actually your target device is ARMV4 or ARMV4I. You can workaround this issue using the /targetcpu command line switch. See the Known Issues section of the following page for more information: www.entrek.com/products/readme.htm.


Back to Top

 


Product: Entrek Toolbox 1.4 General

Cannot connect to Pocket PC 2002 (or SmartPhone 2002) emulator

Note: The Pocket PC 2002 emulator does not use x86em, and the solutions listed here will not work for x86em.

There are a few reasons why you may not be able to connect:
  • TOOLBOX, or one of the Microsoft remote tools, crashed or was forced to terminate, and it left CEMGR.EXE or the remote tool in an invalid state. Simply kill the CEMGR.EXE process, close all apps, including the emulator, and try again. If it's really bad, reboot your machine.
  • The connection was lost somewhere in the middle of communication after connecting previously. This also can leave CEMGR.EXE or the remote tool in an invalid state. Close everything, kill cemgr.exe, reboot if necessary, and try again.
  • The transport being used is TCP/IP, but you do not have an active network connection on the system. The usual symptoms: The emulator starts up, it appears to download a few files, then it gets stuck when trying to connect with the server. What you need is the Microsoft Loopback Adapter. Follow these steps to install and configure it.
Windows XP:
  1. Run the Add Hardware wizard from the Control Panel.
  2. Click Next, and let the wizard search for hardware.
  3. When it comes back, select 'Yes I have already connected the hardware', then Next.
  4. In the installed hardware box, select 'Add a new hardware device', then Next.
  5. Select 'Install the hardware that I manually select from a list', then Next.
  6. Double-click 'Network adapters'
  7. From the Manufacturer list, select Microsoft, then select Microsoft Loopback Adapter, then click Next.
  8. click Next, then let it install.
  9. When it is finished, go to Control Panel | Network Connections (in Classic View) and verify a new Local Area Connection is present.
  10. IMPORTANT! You must now right-click on the new connection, select Properties, TCP/IP, then change the default IP address to be fixed instead of automatic. If you allow Windows XP to assign a private IP address, it won't work. I usually use 10.0.0.1, with a Net mask of 255.255.255.0, and NO gateway or DNS.
For Windows 2000, the install works essentially the same as above, except the wizard has somewhat different wording.

  • Now, make sure all remote tools are closed and CEMGR.EXE is not hanging around, then, run CodeSnitch or ProcMan and select Device | Configure Platform Manager.
  • Select Pocket PC 2002 | Pocket PC 2002 Emulation (or smartphone 2002) and click Properties. Depending on which version of platform manager is installed, you'll see Transport Components with one selected, and Server Components with one selected.
  • Make sure the Transport is TCP/IP and the Server is Emulator Startup Server. Then, click on TCP/IP and select 'Configure'. Make sure the transport is using a fixed host whose IP address is the same as your Microsoft Loopback Adapter (e.g. 10.0.0.1).
  • You should be ready to go. Click 'Test' to test the connection.
Back to Top

 


Product: Entrek Toolbox 1.4 General

I want to uninstall Entrek TOOLBOX files from my target device. What files can I delete?

Both CodeSnitch and Procman automatically install several files on your target device. We recommend that you leave these files installed while using these tools. If you remove them, then the files will need to be re-installed the next time you run either CodeSnitch or Procman. This isn't a problem. It just increases the initial start time of the tools.

Here is a list of files installed by CodeSnitch:

toolbox.exe, tbhelp.dll, onlinemanager.dll, apicore.dll, storemance.dll

Here is a list of files installed by Procman:

toolbox.exe, tbhelp.dll, procmance.dll, storemance.dll

Additionally, files necessary to use Microsoft Platform Manager are installed. These files are also used by tools installed by both Microsoft Platform Builder and Microsoft eMbeddeded Visual Tools. Again, if you remove these files, then they will need to be re-installed by the tools that use them.

Back to Top