bogdanfinn / helheim-go Goto Github PK
View Code? Open in Web Editor NEWGo Wrapper for VeNoMouSNZ Helheim
Go Wrapper for VeNoMouSNZ Helheim
I used the gin web framework to set a route, started the helleimClient in the route, and then the program crashed. The following is the detailed error message:
fatal: morestack on g0
SIGTRAP: trace trap
PC=0x4066782 m=3 sigcode=1
signal arrived during cgo execution
goroutine 8 [syscall]:
runtime.cgocall(0x433c9c0, 0xc00005d4b0)
/usr/local/go/src/runtime/cgocall.go:157 +0x5c fp=0xc00005d488 sp=0xc00005d450 pc=0x400735c
github.com/bogdanfinn/helheim-go._Cfunc_auth(0x4d04120, 0x0)
_cgo_gotypes.go:71 +0x4d fp=0xc00005d4b0 sp=0xc00005d488 pc=0x423804d
github.com/bogdanfinn/helheim-go.(*helheim).Auth(0xc0003a1f40)
/Users/gxk/go/pkg/mod/github.com/bogdanfinn/[email protected]/helheim.go:105 +0x105 fp=0xc00005d570 sp=0xc00005d4b0 pc=0x42386e5
github.com/bogdanfinn/helheim-go.newHelheim({0x43fceb9, 0x24}, 0x0, 0x1, {0x4495ef8?, 0x4706120?})
/Users/gxk/go/pkg/mod/github.com/bogdanfinn/[email protected]/helheim.go:74 +0xcd fp=0xc00005d5c8 sp=0xc00005d570 pc=0x42384cd
github.com/bogdanfinn/helheim-go.NewClient({0x43fceb9?, 0x0?}, 0x0?, 0x0?, {0x0?, 0x0?})
/Users/gxk/go/pkg/mod/github.com/bogdanfinn/[email protected]/client.go:51 +0x4f fp=0xc00005d638 sp=0xc00005d5c8 pc=0x42375ef
github.com/bogdanfinn/helheim-go.ProvideClient({0x43fceb9?, 0x0?}, 0x0?, 0x0?, {0x0?, 0x0?})
/Users/gxk/go/pkg/mod/github.com/bogdanfinn/[email protected]/client.go:35 +0x118 fp=0xc00005d6b8 sp=0xc00005d638 pc=0x42373d8
main.main.func2.1()
/Users/gxk/project/go-collect-test/main.go:42 +0x95 fp=0xc00005d7e0 sp=0xc00005d6b8 pc=0x433c355
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1571 +0x1 fp=0xc00005d7e8 sp=0xc00005d7e0 pc=0x4066901
created by main.main.func2
/Users/gxk/project/go-collect-test/main.go:28 +0x76
goroutine 1 [IO wait]:
internal/poll.runtime_pollWait(0xce00f08, 0x72)
/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc00043e080?, 0x4?, 0x0)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Accept(0xc00043e080)
/usr/local/go/src/internal/poll/fd_unix.go:614 +0x22c
net.(*netFD).accept(0xc00043e080)
/usr/local/go/src/net/fd_unix.go:172 +0x35
net.(*TCPListener).accept(0xc000404198)
/usr/local/go/src/net/tcpsock_posix.go:139 +0x28
net.(*TCPListener).Accept(0xc000404198)
/usr/local/go/src/net/tcpsock.go:288 +0x3d
net/http.(*Server).Serve(0xc0004660e0, {0x4495678, 0xc000404198})
/usr/local/go/src/net/http/server.go:3039 +0x385
net/http.(*Server).ListenAndServe(0xc0004660e0)
/usr/local/go/src/net/http/server.go:2968 +0x7d
net/http.ListenAndServe(...)
/usr/local/go/src/net/http/server.go:3222
github.com/gin-gonic/gin.(*Engine).Run(0xc0004484e0, {0x0, 0x0, 0x0})
/Users/gxk/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:382 +0x20e
main.main()
/Users/gxk/project/go-collect-test/main.go:93 +0xbd
goroutine 18 [semacquire]:
sync.runtime_Semacquire(0xc0003d10d0?)
/usr/local/go/src/runtime/sema.go:56 +0x25
sync.(*WaitGroup).Wait(0xbcedad9f?)
/usr/local/go/src/sync/waitgroup.go:136 +0x52
main.main.func2(0xc0001296f8?)
/Users/gxk/project/go-collect-test/main.go:90 +0x85
github.com/gin-gonic/gin.(*Context).Next(...)
/Users/gxk/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:173
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1(0xc0001c5000)
/Users/gxk/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:101 +0x82
github.com/gin-gonic/gin.(*Context).Next(...)
/Users/gxk/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:173
github.com/gin-gonic/gin.LoggerWithConfig.func1(0xc0001c5000)
/Users/gxk/go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:240 +0xe7
github.com/gin-gonic/gin.(*Context).Next(...)
/Users/gxk/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:173
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc0004484e0, 0xc0001c5000)
/Users/gxk/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:616 +0x671
github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc0004484e0, {0x4495828?, 0xc0003ab260}, 0xc00047a500)
/Users/gxk/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:572 +0x1dd
net/http.serverHandler.ServeHTTP({0xc000402e10?}, {0x4495828, 0xc0003ab260}, 0xc00047a500)
/usr/local/go/src/net/http/server.go:2916 +0x43b
net/http.(*conn).serve(0xc00041abe0, {0x4495de0, 0xc000402d20})
/usr/local/go/src/net/http/server.go:1966 +0x5d7
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:3071 +0x4db
goroutine 20 [IO wait]:
internal/poll.runtime_pollWait(0xce00d28, 0x72)
/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc00043e180?, 0xc000486000?, 0x0)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0xc00043e180, {0xc000486000, 0x1000, 0x1000})
/usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a
net.(*netFD).Read(0xc00043e180, {0xc000486000?, 0xc0000686a0?, 0x420d385?})
/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc000408060, {0xc000486000?, 0x43e8b24?, 0x4?})
/usr/local/go/src/net/net.go:183 +0x45
net/http.(*connReader).Read(0xc000403020, {0xc000486000, 0x1000, 0x1000})
/usr/local/go/src/net/http/server.go:780 +0x16d
bufio.(*Reader).fill(0xc000400360)
/usr/local/go/src/bufio/bufio.go:106 +0x103
bufio.(*Reader).ReadSlice(0xc000400360, 0x0?)
/usr/local/go/src/bufio/bufio.go:371 +0x2f
bufio.(*Reader).ReadLine(0xc000400360)
/usr/local/go/src/bufio/bufio.go:400 +0x27
net/textproto.(*Reader).readLineSlice(0xc000403050)
/usr/local/go/src/net/textproto/reader.go:57 +0x99
net/textproto.(*Reader).ReadLine(...)
/usr/local/go/src/net/textproto/reader.go:38
net/http.readRequest(0xc000408060?)
/usr/local/go/src/net/http/request.go:1029 +0x79
net/http.(*conn).readRequest(0xc00041ac80, {0x4495d38, 0xc00040c440})
/usr/local/go/src/net/http/server.go:988 +0x24a
net/http.(*conn).serve(0xc00041ac80, {0x4495de0, 0xc000402d20})
/usr/local/go/src/net/http/server.go:1891 +0x32b
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:3071 +0x4db
goroutine 7 [IO wait]:
internal/poll.runtime_pollWait(0xce00e18, 0x72)
/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc00043e100?, 0xc000402e21?, 0x0)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0xc00043e100, {0xc000402e21, 0x1, 0x1})
/usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a
net.(*netFD).Read(0xc00043e100, {0xc000402e21?, 0x0?, 0x0?})
/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc000408058, {0xc000402e21?, 0x0?, 0x0?})
/usr/local/go/src/net/net.go:183 +0x45
net/http.(*connReader).backgroundRead(0xc000402e10)
/usr/local/go/src/net/http/server.go:672 +0x3f
created by net/http.(*connReader).startBackgroundRead
/usr/local/go/src/net/http/server.go:668 +0xca
rax 0x17
rbx 0x70000059bcd8
rcx 0xc00005e900
rdx 0x0
rdi 0x2
rsi 0x70000059bc80
rbp 0x316e0790
rsp 0x70000059bd28
r8 0xc00005e900
r9 0xc000000000000000
r10 0x70000059bcd8
r11 0x202
r12 0x70000059df10
r13 0x31749290
r14 0xc000002ea0
r15 0x70000059bd40
rip 0x4066782
rflags 0x206
cs 0x2b
fs 0x0
gs 0x0
It would be a lot better if the client was same as http.Client, which would save time when porting current code written with that to helheim.
I used the helleim-0.9.9-py310 library and golang 1.18.1 to test. Once I used Redis or MySQL before the request, the program would crash. The following is the request code:
func main() {
rds := connect.GetRedis()
defer rds.Close()
//Get a message from Redis
str, err := redis.String(rds.Do("rpop",“test_key”))
if err != nil {
log.Println(err)
return
}
log.Println(str)
apiKey := "my_Key"
helheimClient, err := helheim_go.ProvideClient(apiKey, false, true, nil)
if err != nil {
log.Println(err)
return
}
// check possible options in the python examples
options := helheim_go.CreateSessionOptions{
Browser: helheim_go.BrowserOptions{
Browser: "chrome",
Mobile: false,
Platform: "windows",
},
Captcha: helheim_go.CaptchaOptions{
Provider: "vanaheim",
},
}
session, err := helheimClient.NewSession(options)
if err != nil {
log.Println(err)
return
}
reqOpts := helheim_go.RequestOptions{
Method: http.MethodGet,
Url: "https://www.genx.co.nz/iuam/",
Options: make(map[string]string),
}
resp, err := session.Request(reqOpts)
if err != nil {
log.Println(err)
return
}
log.Println(resp.Response.Body)
}
Error message:
fatal: morestack on g0
SIGTRAP: trace trap
PC=0x4065702 m=7 sigcode=1
signal arrived during cgo execution
goroutine 1 [syscall]:
runtime.cgocall(0x4393c10, 0xc00012dc70)
/usr/local/go/src/runtime/cgocall.go:157 +0x5c fp=0xc00012dc48 sp=0xc00012dc10 pc=0x400715c
github.com/bogdanfinn/helheim-go._Cfunc_auth(0xc504130, 0x0)
_cgo_gotypes.go:71 +0x4d fp=0xc00012dc70 sp=0xc00012dc48 pc=0x425222d
github.com/bogdanfinn/helheim-go.(*helheim).Auth(0xc000290040)
/Users/gxk/go/pkg/mod/github.com/bogdanfinn/[email protected]/helheim.go:105 +0x105 fp=0xc00012dd30 sp=0xc00012dc70 pc=0x4252f25
github.com/bogdanfinn/helheim-go.newHelheim({0x4443837, 0x24}, 0x0, 0x1, {0x44dbde8?, 0x473ddd8?})
/Users/gxk/go/pkg/mod/github.com/bogdanfinn/[email protected]/helheim.go:74 +0xcd fp=0xc00012dd88 sp=0xc00012dd30 pc=0x4252d0d
github.com/bogdanfinn/helheim-go.NewClient({0x4443837?, 0xc00007e0d0?}, 0x60?, 0xe4?, {0x0?, 0x0?})
/Users/gxk/go/pkg/mod/github.com/bogdanfinn/[email protected]/client.go:51 +0x4f fp=0xc00012ddf8 sp=0xc00012dd88 pc=0x424f4af
github.com/bogdanfinn/helheim-go.ProvideClient({0x4443837?, 0x52?}, 0x0?, 0x0?, {0x0?, 0x0?})
/Users/gxk/go/pkg/mod/github.com/bogdanfinn/[email protected]/client.go:35 +0x118 fp=0xc00012de78 sp=0xc00012ddf8 pc=0x424f298
main.main()
/Users/gxk/project/go-collect-test/main.go:54 +0x192 fp=0xc00012df80 sp=0xc00012de78 pc=0x43938b2
runtime.main()
/usr/local/go/src/runtime/proc.go:250 +0x212 fp=0xc00012dfe0 sp=0xc00012df80 pc=0x4038f32
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1571 +0x1 fp=0xc00012dfe8 sp=0xc00012dfe0 pc=0x4065881
goroutine 6 [select]:
database/sql.(*DB).connectionOpener(0xc000211450, {0x44dbb80, 0xc000212f40})
/usr/local/go/src/database/sql/sql.go:1226 +0x8d
created by database/sql.OpenDB
/usr/local/go/src/database/sql/sql.go:794 +0x18d
goroutine 18 [select]:
github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher.func1()
/Users/gxk/go/pkg/mod/github.com/go-sql-driver/[email protected]/connection.go:614 +0xaa
created by github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher
/Users/gxk/go/pkg/mod/github.com/go-sql-driver/[email protected]/connection.go:611 +0xfe
goroutine 34 [select]:
database/sql.(*DB).connectionCleaner(0xc000211450, 0xc000212f40?)
/usr/local/go/src/database/sql/sql.go:1069 +0xa7
created by database/sql.(*DB).startCleanerLocked
/usr/local/go/src/database/sql/sql.go:1056 +0xff
rax 0x17
rbx 0x7000041f2cd8
rcx 0xc00017fb00
rdx 0x0
rdi 0x2
rsi 0x7000041f2c80
rbp 0x316f0790
rsp 0x7000041f2d28
r8 0xc00017fb00
r9 0xc000000000000000
r10 0x7000041f2cd8
r11 0x202
r12 0x7000041f4f10
r13 0x31759290
r14 0xc000117d40
r15 0x7000041f2d40
rip 0x4065702
rflags 0x206
cs 0x2b
fs 0x0
gs 0x0
Hi,
I tried every step to run the example file, But I get this error
Undefined symbols for architecture x86_64:
"_helheimVersion", referenced from:
__cgo_3b7158d1755a_Cfunc_helheimVersion in _x002.o
(maybe you meant: __cgo_3b7158d1755a_Cfunc_helheimVersion)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I'm using MacOS M1 Pro. Not sure about Architecture
Installed this helheim-0.8.6-py310-darwin.x86_64
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.