Skip to content

chacha20: regression #25318

Description

@einar-hjortdal

Describe the bug

commit 89a2495 broke chacha20. A firebirdsql server using chacha20 is unable to communicate with a v client using chacha20 @blackshirt

Reproduction Steps

I do not have a small self-contained example. But this is what I experience when running the project I am working on:

Program runs correctly before the commit

~/.cache/oldv/v_at_5d98162960b8d7893eb304f6bd683ff5e410a401/v run .
2025-09-16T07:28:29.283993Z [INFO ] [provider_blob_blobly] ready
2025-09-16T07:28:29.344345Z [INFO ] Store created at 2025-09-05 07:22:09
[veb] Running app on http://localhost:8080/

Program fails to communicate with the firebird server after the commit

~/.cache/oldv/v_at_89a24958a171c5227aded3ae8ea4916b1e3478e6/v run .
2025-09-16T07:24:49.252290Z [INFO ] [provider_blob_blobly] ready
V panic: [firebird] Invalid clumplet buffer structure: buffer end before end of clumplet - clumplet too long (190)

v hash: 89a2495
/tmp/v_1000/peony_starter.01K58PJTFMZC3ZJDWYQYWB50X1.tmp.c:32219: at builtin___v_panic: Backtrace
/tmp/v_1000/peony_starter.01K58PJTFMZC3ZJDWYQYWB50X1.tmp.c:16726: by einar_hjortdal__peony__new_peony_app
/tmp/v_1000/peony_starter.01K58PJTFMZC3ZJDWYQYWB50X1.tmp.c:19300: by main__main
/tmp/v_1000/peony_starter.01K58PJTFMZC3ZJDWYQYWB50X1.tmp.c:24598: by main

I believe this would also happen when trying to run firebird tests, since tests open connections to the firebird server.

Expected Behavior

Successful stream encryption

Current Behavior

Failure to communicate with a server utilizing chacha20 encryption

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.11 0dbbed7

Environment details (OS name and version, etc.)

|V full version      |V 0.4.11 214628a939d744768e5bba9b49699ea81a8d3f83.0dbbed7
|:-------------------|:-------------------
|OS                  |linux, "openmamba release 2025.8.1 for x86_64 (rolling)"
|Processor           |8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
|Memory              |14.83GB/31.16GB
|                    |
|V executable        |/home/einar/.local/lib64/v/v
|V last modified time|2025-09-16 07:12:51
|                    |
|V home dir          |OK, value: /home/einar/.local/lib64/v
|VMODULES            |OK, value: /home/einar/.vmodules
|VTMP                |OK, value: /tmp/v_1000
|Current working dir |OK, value: /home/einar/Documents/projects/vlang/active/peony_starter
|                    |
|Git version         |git version 2.51.0
|V git status        |weekly.2025.38-5-g0dbbed7b
|.git/config present |true
|                    |
|cc version          |cc (GCC) 15.2.1 20250818
|gcc version         |gcc (GCC) 15.2.1 20250818
|clang version       |N/A
|tcc version         |tcc version 0.9.28rc 2025-02-13 HEAD@f8bd136d (x86_64 Linux)
|tcc git status      |thirdparty-linux-amd64 696c1d84
|emcc version        |N/A
|glibc version       |ldd (GNU libc) 2.42

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugThis tag is applied to issues which reports bugs.

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions