JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc
General

Frequently Asked Questions

This section answers frequently asked questions.

Searching and Warnings

Build/Analysis Runs

Hub and User Accounts

Other


Which of my warnings is the most serious?
Each warning has an associated Score, intended to suggest a review order for warnings: warnings with a higher Score value before warnings with a lower Score value.

Score is based on several factors, including the severity of the problem being warned about and the likelihood that the warning represents a true positive.

You can view warning Score values in tables of warnings (in Analysis: Warnings Tab, Warning Cluster, or Warning Search Results).

For more information, see Warnings: Instances and Groups: Score.

Where can I find some search examples?
Search examples are available in the Warning Search Language: Usage and Examples section, and in several of the Typical CodeSonar Tasks:
How do I find only new warnings?
See Task: Show New Warnings.
Why don't my search results include all the warnings I expected to see?
There are several possibilities.
How do I assign responsibility for all warnings in a source directory to some user?
Perform a search for the warnings in that directory, and use Change Multiple Warnings to assign them to the user. See Task: Assign All Warnings In A Directory To One User for step-by-step instructions.
Why is CodeSonar changing my search language expressions?
CodeSonar normalizes user-specified search expressions into equivalent expressions that conform to a standard format. This makes it easier to identify and remove redundant conditions, which in turn improves search speeds.

For example, if you search with warning search language expression

A!=B & class:C

CodeSonar will normalize it to the equivalent expression

-A=B class:C
Some of my warning annotations are not rendering properly: how can I fix that?

Annotation encoding problems may occur in certain hubs that have been directly or gradually upgraded from CodeSonar 6.0 hub (or earlier) to CodeSonar 6.1 (or later).

CodeSonar 6.1 introduced UTF8 encoding for all hub annotations. Hubs with ASCII-only annotations will have their annotations automatically transcoded to UTF8 as part of the upgrade from (or past) CodeSonar 6.0. For hubs whose annotations used other encodings, perform the steps for Updating Hub Annotation Encoding to ensure all hub annotations are fully transcoded to UTF8

I think I see a vulnerability that CodeSonar hasn't found, how can that happen?
There are several possibilities.
What settings should I change to obtain a more thorough analysis?
There are several configuration file parameters whose settings can be changed in order to obtain a more thorough analysis at the expense of time or other resources. See section Performing a More Thorough Analysis for details.
My analysis seems to be stuck in the "Building over; Awaiting analysis or more building" phase. What do I do?
See Task: Resolve "Building Over..." Status.
My analysis seems to be stuck in the "Building over; Native build failed" phase. What do I do?
See Task: Resolve "Building Over..." Status.
How do I specify that the build/analysis should communicate with the hub using IPv4 only?

On legacy operating systems, you may not be able to run a build/analysis that uses IPv6 to communicate with the hub. On these machines, the CodeSonar build/analysis will fail unless you specify it should only use IPv4 for communication.

To do this, set environment variable GT_DISABLE_IPV6 to 1 in your build/analysis environment.

Windows note: if you are running the build/analysis as a service, set GT_DISABLE_IPV6 using the control panel rather than in your command environment: services are not part of the process tree. You may need to restart your machine for this change to take effect.

My build/analysis is failing with a Anticipated prj_files size will exceed the launchd's quota error: how can I resolve that?
This issue can occur with remote-managed analysis and daemon mode only.

As part of the data and control transfer for a remote-managed analysis, CodeSonar estimates the the final size of the analysis directory. The error message shown here is issued when the estimated size is greater than the entire space quota for the specified launch daemon.

There are three options for resolution.

My build/analysis is failing with a To analyze this project, you must increase the launchd's quota or decrease the anticipated prj_files_size error: how can I resolve that?
This issue can occur with remote-managed analysis.

As part of the data and control transfer for a remote-managed analysis, CodeSonar estimates the the final size of the analysis directory. The error message shown here is issued when the specified remote launch daemon cannot accommodate a directory of this estimated size because of other remote analysis directories also managed by the same launch daemon.

There are four options for resolution.

My build/analysis is failing with a cslaunchd reported CS_ERROR_LAUNCHD_QUOTA_EXCEEDED error: how can I resolve that?
This issue can occur with remote-managed analysis.

The error message shown here is displayed when the specified remote launch daemon has no more room in its home directory and so cannot accommodate any more remote analyses.

There are three options for resolution.

My build/analysis is failing with a Error connecting to http://host:port/cli/31/start_v77/. r=CS_OUT_OF_ELEMENTS. Response Code was 200. error: how can I resolve that?
This can occur if you are using a reverse proxy (such as NGINX) whose configuration is preventing communication between the analysis and the hub. For information on configuring your reverse proxy to work with CodeSonar, see Task: Use CodeSonar with a Reverse Proxy.
My build/analysis is failing with a Request slaves from hub cluster No slaves have connected to this analysis master. In order to make progress, at least one slave is required. This typically occurs because the analysis cloud has no online nodes with non-zero values for "Max Processes" [...] error: how can I resolve that?
The analysis has requested slaves but none have connected, so the analysis cannot proceed. This can occur for a number of different reasons: the best way to find out what is causing the problem in this case, and how to resolve it, is to look at the corresponding alert in the CodeSonar GUI.
  1. Navigate to the relevant Analysis page.
  2. Click on the Analysis Stuck (No Slaves) alert.
    A new page will open with detailed information about what has occurred along with resolution advice.

In general, a launch daemon D can only contribute to an analysis if all of the following are true.

I am running out of memory when I try to run the CodeSonar build/analysis. What can I do?

Out-of-memory (OOM) problems can occur if system resource limits are too low. In particular, you might encounter OOM problems when analyzing projects with large amounts of Java or C# code, such as AOSP projects.

You can use ulimit if you need to increase system resource limits. We recommend the following ulimit arguments.

You may prefer to use very high concrete values in place of unlimited: choose limits at which you prefer the analysis to fail rather than use more resources.

For detailed information about ulimit consult the documentation (such as man pages) for your local system.

I'm seeing a large number of cprocess processes when the analysis is in the "Parsing Translation Units" phase, and they're using a lot of memory. How can I resolve this?
Depending on your system resources, your resolution can involve one or both of the following.
[Windows only] How can I switch between the different CodeSonar installations on my machine?
If you have multiple installations of CodeSonar on a machine and want to change which installation is used for building, install the device driver from the installation you wish to use. This must be performed by a user with (Windows) Administrator privileges.
hookcs.exe --uninstall --install
(The hookcs.exe executable is located in %CSONAR%/bin. If this directory is not in your PATH, you will need to specify the path to hookcs.exe in your command.)
What is a hub?
The CodeSonar hub is a web server that manages CodeSonar analysis results.

diagram: CodeSonar analysis and UI interact with the hub database through the hub process

For complete information, see The CodeSonar Hub.

Can I download a GUI page directly from the command line?
Yes: see Accessing GUI Pages for details.
When I try to view a Source Listing page, I get an error like "Cannot find required file: path/to/codesonar/bin/cslaunchd Perhaps the CodeSonar installation that originally ran this analysis has been removed?": how can I view this file?
This can occur if you performed an analysis and then upgraded CodeSonar on the analysis machine, removing the previous CodeSonar installation. Source Listing information is kept in the analysis directory and recovered via the launch daemon when there is a request for the information: if the launch daemon cannot be restarted because it has been uninstalled, you will not be able to view the Source Listing page.

In this case, reanalyze the project with the upgraded CodeSonar installation to get access to Source Listing pages.

If you want to avoid reanalysis after future upgrades, install each new version of CodeSonar in a new directory and do not uninstall the previous version.

What kind of web server is the hub?
The CodeSonar hub is a homegrown, pure-Python web server, based in part on CherryPy.
How do I get a user account on a hub?
Depending on the hub configuration, you may be able to set up an account for yourself. See Task: Add a New User Account for Yourself for step-by-step instructions. Otherwise, you will need to ask a hub administrator to create an account for you.
How do I access a hub from a different machine?
See Task: Access the Web GUI Remotely for step-by-step instructions.
In some cases, you may wish to set up a satellite hub.
How do I allow hub access through a firewall?
This depends on the type of firewall you have and your system privilege level.
My build/analysis is failing with a "Failed to initialize hub communications." error, but there is a hub running on the specified machine and port: how can I resolve that?
There are four main possibilities.
How can I find out whether a hub is running at a particular location?
To check whether a hub is running at location host:port, use a web browser to open the URL
http://host:port
If a hub is running at host:port, the Web GUI Home page will be displayed.
How can I relocate a hub?
See Moving A Hub for step-by-step instructions.
How can I run my hub server and hub database on separate machines?
The recommended and supported mechanism is to use a satellite hub, as follows.
  1. Start the primary hub on the machine where you want to store the hub database.
  2. Start a satellite hub on the machine where you want your users to access the hub.
  3. Instruct your users to access the satellite hub location for all their hub interactions, including analyses and uses of the CodeSonar Web GUI.
  4. Inform the hub administrator of the primary hub location: some administrative tasks can only be performed on the primary hub.

The use of a database cluster that is not managed by the CodeSonar hub is neither supported nor recommended.

Why won't PostgreSQL start when I try to start a hub?
The two most frequent reasons are: (Note that satellite hubs do not have their own hub databases, so starting a satellite hub will not cause PostgreSQL to start.)
How do I specify that my hub should only use IPv4?

On legacy operating systems, you may not be able to run a hub that uses IPv6. On these machines, you will not be able to start a hub unless you specify it should only use IPv4.

To do this, set environment variable GT_DISABLE_IPV6 to 1 in the environment in which you are starting the hub. If you are using the configuration tool to start the hub, this is the environment in which you are running the configuration tool.

Windows note: if you are running the hub as a service, set GT_DISABLE_IPV6 using the control panel rather than in your command environment: services are not part of the process tree. You may need to restart your machine for this change to take effect.

I get a "daemonize_start: StartService failed with 1069: The service did not start due to a logon failure." error when I try to start a hub: how can I resolve that?
This problem can arise when you are trying to start a hub as a Windows service. There are several possibilities.
I get a "Hub directory dirname is not allowed inside the codesonar installation [...] " error when I try to start a hub: how can I resolve that?

This problem arises when you try to start a hub whose hub directory is located inside the CodeSonar installation directory. For security reasons, CodeSonar will not start a hub in this case.

To start a hub, specify a different hub directory: one located outside the CodeSonar installation directory.

[Windows only] I get a "Could not open file for writing at "path\to\hubdir\.check_file.num": Access is denied." error when I try to start a hub: how can I resolve that?
This error indicates that the Windows user account that owns your hub service (that is, the Windows user account whose credentials you used to authenticate the hub service) does not have the required full control of the specified hub directory.

To resolve this, either:

[Windows only] My hub service can't restart automatically because it requires two-factor authentication (2FA): how can I resolve that?
If the Windows account that owns your hub service (that is, the Windows user account whose credentials you used to authenticate the hub service) requires 2FA or some other interactive authentication mechanism, the service will not be able to restart automatically.

To resolve this, change the hub service owner to a different Windows user account that does not have these requirements (for example, a system account).

I don't remember where I put my hub: how can I find it?
There are three possible cases.

CodeSonar may prompt you for user name and password when you run the hub-info command. If so, enter the username and password for Administrator (or another hub user account with G_HUB_INFO permission).

I can't start a hub and I can't figure out why: what can I do?

Work through the following steps to see if any of them apply.

  1. Was there an error message when you tried to start the hub?
    If so, the error message may provide enough information to resolve the problem. Two common error messages are covered by individual FAQ entries:
  2. Did PostgreSQL fail to start when you tried to start the hub?
    If so, see Why won't PostgreSQL start when I try to start a hub?.
  3. Are you using a legacy operating system?
    If so, the problem may be that you cannot run a hub that uses IPv6. See How do I specify that my hub should only use IPv4?
My hub is running very slowly: what can I do?
If you have been using your hub for some time, the hub database may need to be vacuumed.
This functionality is only available to users with G_HUB_VACUUM permission (such as Administrator, or any other user with the special Administrator role).
  1. Go to the Other Links tab of the Settings page.
  2. Click the Vacuum Database link.
    CodeSonar will display a dialog warning that vacuuming will take a long time and asking for confirmation.
  3. Click Vacuum Database in the dialog to perform the vacuum full operation (described in the PostgreSQL documentation), or Cancel to close the dialog without vacuuming the database.

It may also be useful to increase the limit on the number of hub processes.
This functionality is only available to users with G_ADMINISTER_HTTP_SETTINGS permission (such as Administrator, or any other user with the special Administrator role).

  1. [Windows hubs only] If your hub is running on a Windows system, you will need to increase the size of the "desktop heap" in order to accommodate additional hub processes.
    • Follow the instructions in the MSDN blog on Desktop Heap Overview to edit the registry and increase the size of the noninteractive desktop heap.
    • Start by adding 30kB for each additional process you want to run (some systems may require more, others less).
  2. Go to the HTTP tab of the Settings page.
  3. Increase the Max Processes Setting
  4. Click the Update button.
How can I back up my hub?
See Back Up and Restore a Hub Database: Unencrypted Communication and Back Up and Restore a Hub Database: TLS Communication.
How can I copy my hub?
Follow the instructions in Relocating the Hub (Different Machine). (Note that the source and destination machines do not have to be different).
How can I verify that the hub is installed and set up correctly?
Run
codesonar hub-info interface:port

or

codesonar hub-info path/to/hubdir

CodeSonar may prompt you for user name and password when you run the hub-info command. If so, enter the username and password for Administrator (or another hub user account with G_HUB_INFO permission).

If a hub is running with the location/directory you specified, CodeSonar will print a table of hub information. If the values in the table are as you expected, the hub should be running correctly.

How do I change hub settings?
Hub settings can be changed from various tabs of the Settings page.
I set up my hub to use HTTPS, but now I'm getting browser warnings: how can I make them go away?

Many web browsers (along with other HTTPS clients such as the analysis) are configured to issue warnings when they access sites with self-signed certificates. If you have configured the hub to use a self-signed hub server certificate or client authentication certificate, it will fit this description.

See Browser Warnings and Self-Signed Certificates for more information about this issue and how to resolve it.

My browser won't generate me a user certificate, how do I get one?

If the Generate and Save Certificate functionality is not available when you view the User Certificates page, your browser does not support in-browser generation and storage of user certificates. Instead, use the process for Manually Generating and Uploading User Certificates.

I am seeing a "Limited Access: ..." notification at the bottom of every GUI page. What does it mean and how can I make it go away?
This message appears to notify you that full licensed hub functionality will not be available to your current GUI session because a licensed session limit has been exceeded. There are two situations in which this message may appear.

This reduced functionality persists for the entire session. If a licensed slot becomes available, you can claim it by starting a new session.

If the problem is that there is no license at all, you will also have a "No valid license found" notification. Both notifications will go away once you have configured a license and started a new session that claims a licensed session slot.

I am seeing a "No valid license found: ..." notification at the bottom of every GUI page. What does it mean and how can I make it go away?

This message appears when the hub does not have a suitable license key configured. Full licensed hub functionality will not be available to any user of this hub until a suitable license key is configured.

You can resolve this by configuring a license key: click the configure the CodeSonar license link to navigate to the License Utilization page, then follow the instructions on that page to obtain an unsigned license key, have it signed, and install it. For detailed instructions, see Installation: Hub Setup: Hub License Key.

I am seeing a "License heartbeat failure..." notification at the bottom of every GUI page. What does it mean and how can I make it go away?

This message indicates that the hub is having difficulty interacting with the license key correctly. For example, this can occur if there is a network failure, or if a user deletes or replaces the license key lock file (perhaps because an automated job is deleting temporary directories). If heartbeat failure persists for too long, full licensed hub functionality will become unavailable until license key access is restored.

If you are not sure what is causing the problems, open the hub processes log and look for messages that include the string 'license'.

The message will go away when you restart the hub.

I am seeing a "One or more licensed resources has been [completely] exhausted." notification at the bottom of every GUI page. What does it mean and how can I make it go away?

This message appears when at least one licensed resource (other than anonymous or user session slots) has been exhausted. Full licensed hub functionality will not be available to any user of the hub until a license key with higher resource limits is configured.

Once such a license key is configured, the message will go away.

I am seeing a "Utilization of one or more licensed resources is above 90%." notification at the bottom of every GUI page. What does it mean and how can I make it go away?

This message appears when at least one licensed resource (other than anonymous or user session slots) has utilization above 90%, but no licensed resource is yet above 100%. It is informative only: the goal is to provide hub administrators with advance warning that they may need to increase one or more licensed limits. There is no effect on full licensed hub functionality.

If the hub license key is upgraded to increase limits so that utilization for all resources is below 90%, the notification will go away.

If the hub license key is not upgraded and utilization of one or more resources reaches 100% of the licensed limit, the 90% notification will be replaced by the "One or more licensed resources has been [completely] exhausted." notification.

I am seeing a "The web server's process pool was exhausted... " notification at the bottom of every GUI page. What does it mean and how can I make it go away?

This message appears if the hub runs out of processes for servicing HTTP connections.

If you have sufficient capacity on the hub machine, increase the Max Processes setting to address this problem. If your Max Processes setting is already as high as the hub machine can accommodate, you may need to move the hub to a machine with more processing power or introduce one or more satellite hubs to distribute the hub load.

The message will go away when you restart the hub.

I am seeing a "The web server's process pool ran out of idle processes..." notification at the bottom of every GUI page. What does it mean and how can I make it go away?

This message appears if the hub runs out of idle processes for servicing HTTP connections. When this happens, some incoming requests are delayed while new processes are started to service them.

The message will go away when you restart the hub.

I am seeing a "The web server experienced an exception... " notification at the bottom of every GUI page. What does it mean and how can I make it go away?

There was an internal exception in the hub. Consult the hub log for more information. If necessary, contact CodeSecure support for assistance.

The message will go away when you restart the hub.

The manual just flickers on an empty window when I try to view it: how can I fix that?

For security reasons, certain browsers suppress functionality in local files (but not in files delivered by web servers). For these browsers, the manual is configured to use an HTML-only rendering when files are opened directly from disk.

If the manual is flickering when you open a manual page from disk, it is likely that you are using one of these browsers but the HTML-only rendering is not being used for some reason. You have three options in this case.

Why is the manual less attractive when I view it from disk ?

Certain browsers suppress functionality in local files (but not in files delivered by web servers). For these browsers, the manual is configured to use an HTML-only rendering when files are opened directly from disk.

The HTML-only version is less attractive, but provides all the same navigation and content as the full version.

The previous FAQ section describes your options for viewing manual content on Chrome and other such browsers.

How do I make the manual index work in Chrome/Safari?
Selecting index terms with multiple associated references has no effect in these browsers (index terms with exactly one reference have no problems). To work around this problem, disable JavaScript for viewing the manual. The manual index and table of contents will "fall back" to the HTML-only version.

If the index does not display at all, you may have opened the manual directly from disk: see The manual just flickers on an empty window when I try to view it: how can I fix that? for more information.

Why does the manual search show a "Searching...." progress bar, but never display search results?

A successful search should return either a list of appropriate search results, or "No Topics Found". If the manual search feature stalls while displaying a progress bar and never displays expected results, this may indicate that your browser is caching stale search information, for example because it was used with an earlier version of CodeSonar that was subsequently upgraded.

Perform a browser hard refresh to clear old search information from the browser cache and restore proper search functionality. The following table contains the hard refresh commands for supported platforms and browsers.

Platform Browser Command
Windows/Linux Chrome, Firefox, Edge Control+F5
MacOS Safari Option+Command+E
MacOS Chrome, Firefox Command+Shift+R
What is Microsoft libc command line encoding?

The MS libc command line encoding is a way of encoding a list of strings as a single string. By convention, it is the encoding used by most programs on Microsoft Windows for converting command lines to lists of arguments (argv) and vice versa. CodeSonar applies the MS libc rules for parsing command-line arguments to convert configuration values using this encoding into lists of strings.

Note in particular the interpretation of backslash characters followed by a quotation mark. Where configuration file variables are described as using MS libc command line encoding, this applies on all systems (not just Windows).

The following table contains examples of string encoding:

Raw String Encoding
plain plain
another arg "another arg"
" \"
\" \\\"
-DFOO="HELLO TO THE\nWORLD" "-DFOO=\"HELLO TO THE\nWORLD\""
\" lovely "\\\" lovely"
\ \
\\ \\
\\" \\\\\"
(empty string) ""
(string consisting of single space) " "
Can I run CodeSonar in Docker?
Yes, with the following caveats.

For more information, see Using CodeSonar With Continuous Integration Tools: Running CodeSonar in Docker.

Can I run CodeSonar with a reverse proxy (such as NGINX)?
Yes, provided that the proxy configuration permits communication between the CodeSonar analysis and the hub. For more information, see Task: Use CodeSonar with a Reverse Proxy.
What environment variables can affect CodeSonar processes?
See Environment Variables for CodeSonar for information about various environment variables and their influence on CodeSonar processes.
 

To report problems with this documentation, please visit https://support.codesecure.com/.