Skip to content

Can not use commnad line parameters longer than 255 on second Chronos #294

@HashidaTKS

Description

@HashidaTKS

Describe the bug

If the following condition is satisfied, the command line parameters are ignored.

  • "Allow multiple instances" is OFF
  • A Chronos instance is already running, and we launch the second or subsequent Chronos
  • The command line parameters are 256 bytes or longer
    • For URL-only specification: when the length is 256 bytes or more
    • For URL specification plus display parameter specification: when the combined length of the two is 252 bytes or more
      • Because Chronos internally combines the parameters with "|@@|", so 4 bytes are added to the parameters.

When "Allow multiple instances" is OFF, the following process sends a message to the existing instance:

https://github.com/ThinBridge/Chronos/blob/master/Sazabi.cpp#L888

In this process, GlobalAddAtom is used. However, since GlobalAddAtom only supports strings up to 255 bytes in length, if the length exceeds this limit, it results in an empty string. This is the cause of the problem.

To Reproduce

  • Specify "Allow multiple instances" true
  • Start Chronos
  • Start a second Chronos with Chronos.exe https://example.com/path/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  • A new tab or window is created and the URL of that is not https://example.com/.... but the default URL.

Expected behavior

https://example.com/path/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa is opened in a new tab or window

Your Environment

- Chronos version: 15.0.131.0
- ThinApps version: 2503

Your Configuration

N/A

Your TRACE log (Chronos_trace.log)

N/A

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions