Cothread beyond version 2.18.2 can break long string handling in affected servers

Open
#53 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c
Domain
backend

Research direction

Review commit 1ec3579761d4b1901bf65d0c1e58b063191273df and PR #32, then trace the current puts handling for long strings. Determine whether compatibility requires an unconditional trailing null or a configurable behavior, and verify the chosen behavior against the affected servers.

Written by the indexing model from the issue text.

Description

Commit 1ec3579761d4b1901bf65d0c1e58b063191273df of PR #32 changes the behaviour of puts to "long strings" (arrays of char) so that a trailing null is no longer sent. This makes the length of the string (as reported by .NORD) truthful, but unfortunately can trigger bugs in string length calculations in certain servers.

Either cothread should unconditionally append an extra null (making all strings one character longer than is truthful) or this could be done conditionally on something like an environment variable.

Dominant language
C
Stars
13
Forks
11
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DiamondLightSource/cothread

All issues in DiamondLightSource/cothread

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.