Comments (7)
package main
import (
"fmt"
"time"
)
func main() {
for _, v := range []int{1, 2, 3, 4, 5} {
go func(v int) {
for {
time.Sleep(time.Second)
}
}(v)
}
fmt.Println(11)
select {}
}
from goloader.
以上代码。使用goloader加载运行时,因为select{} ,会报错unresolve external:runtime.block
from goloader.
还有使用了第三方库里面。。应该也是有哪个关键字吧。。。会报unresolve external:runtime.chanrecv2
from goloader.
以上代码。使用goloader加载运行时,因为select{} ,会报错unresolve external:runtime.block
你要在动态时候使用select的特性,则需要loader也使用,这样运行时才有这个函数符号,因为这个是go的系统内部函数,所以无法使用register来注册它
例如这个runtime.block 你需要在loader里边也有select{}
from goloader.
runtime.chanrecv2是什么没有注册进去呢?搜索出来是chan的底层会用到runtime.chanrecv2,可是我在loader中声明并初始化了一个chan后,还是报这个错误
from goloader.
runtime.chanrecv2是什么没有注册进去呢?搜索出来是chan的底层会用到runtime.chanrecv2,可是我在loader中声明并初始化了一个chan后,还是报这个错误
只声明没有用,需要使用这个channel, 应该recv一下就会底层用到runtime.chanrecv2这个函数
from goloader.
c := make(chan bool, 2)
c <- true
v, ok := <-c
fmt.Println(v, ok)
调试下来发现,使用v := <-c还是会报runtime.chanrecv2,必须使用第三行的v, ok := <-c,底层才会调用runtime.chanrecv2这个函数,才不会报错了。。。谢谢大神指点!
from goloader.
Related Issues (20)
- fatal error: unreachable method called. linker bug? HOT 19
- Mac M1 Load error: syscall.Mmap: permission denied HOT 6
- linker 是不是设计成main.xx导出方法 HOT 3
- 在运行的golang代码如果使用指针会报错 HOT 5
- macos Lstat使用报index out of range HOT 12
- Load error: symName:database/sql.(*DB).Close offset:139266851392960 is overflow! HOT 2
- 有一个想法 HOT 1
- Do I have to build the host program with `-w`? HOT 3
- support golang 1.20
- Can't get example to run using Go 1.20 HOT 3
- how to use it in other program HOT 1
- Load error: unresolve external:runtime.writeBarrier HOT 7
- 你好, 请问这个项目是怎么保持跟随 Go 最新版本的呢 HOT 13
- 实现 MarshalJSON 接口方法, 不会被执行 HOT 16
- Will panic soon when visit pprof web page HOT 7
- the handle of inline is incorrect HOT 11
- the usage of `copy2Slice` here seems to be incorrect, PutInt64 should be used instead HOT 30
- the `addfuncdata` rewrite `0` to `^uint32(0)`, but ignoring the case where 0 represents a normal offset value. HOT 5
- during module unloading, removing the itab can lead to runtime error HOT 1
- `getitab` alloc memory for `itab` by `persistentalloc`, and that couldnt be free HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goloader.