Skip to content

coroutines C error found. #23587

@kuchaguangjie

Description

@kuchaguangjie

Describe the bug

coroutine_learn.v:

fn echo() {
	println("echo")
	$if is_coroutine ? {
		println("coroutine")
	}
}

fn main() {
	go echo()
}

run:

v -use-coroutines run ./coroutine_learn.v

output:

coroutines .so not found, downloading...
done!
================== C compilation error (from tcc): ==============
cc: /tmp/v_1000/coroutine_learn.01JJHGK3ZCB9N2GGW5VQ659HW9.tmp.c:5633: warning: implicit declaration of function 'delete_photon_work_pool'
cc: /mnt/star/program/vlang/v0.4.9/thirdparty/tcc/lib/libgc.a: error: 'GC_noop1_ptr' defined twice
cc: tcc: error: undefined symbol 'photon_thread_create_and_migrate_to_work_pool'
cc: tcc: error: undefined symbol 'delete_photon_work_pool'
... (the original output was 5 lines long, and was truncated to 4 lines)
=================================================================
(You can pass `-cg`, or `-show-c-output` as well, to print all the C error messages).
builder error: 
==================
C error found. It should never happen, when compiling pure V code.
This is a V compiler bug, please report it using `v bug file.v`,
or goto https://github.com/vlang/v/issues/new/choose .
You can also use #help on Discord: https://discord.gg/vlang .

Reproduction Steps

Run the code above on ubuntu 24.04

Expected Behavior

no error

Current Behavior

error

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.9 801600c

Environment details (OS name and version, etc.)

V full version V 0.4.9 d313355.801600c
OS linux, Linux Mint 22
Processor 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz
Memory 2.29GB/15.54GB
V executable /mnt/star/program/vlang/v0.4.9/v
V last modified time 2025-01-26 14:38:08
V home dir OK, value: /mnt/star/program/vlang/v0.4.9
VMODULES OK, value: /home/eric/.vmodules
VTMP OK, value: /tmp/v_1000
Current working dir OK, value: /mnt/star/git_repos/vlearn/src/learn/coroutine
Git version git version 2.43.0
V git status weekly.2025.04-1-g801600c0
.git/config present true
cc version cc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
gcc version gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
clang version N/A
tcc version tcc version 0.9.28rc 2024-07-31 HEAD@1cee0908 (x86_64 Linux)
tcc git status N/A
emcc version N/A
glibc version ldd (Ubuntu GLIBC 2.39-0ubuntu8.3) 2.39

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.BuildV build error on any OS/CPU architecture.CoroutinesProblems related to V's coroutine implementation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions