Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux error:signal: killed #149

Closed
andy-hsiung opened this issue Sep 9, 2023 · 21 comments · Fixed by #150
Closed

linux error:signal: killed #149

andy-hsiung opened this issue Sep 9, 2023 · 21 comments · Fixed by #150

Comments

@andy-hsiung
Copy link

"In macOS, this is no issue. However, when running on Linux, the following error occurs: signal: killed."
Code:
`package main

import (
"fmt"
"github.com/showwin/speedtest-go/speedtest"
)

func main() {
var speedtestClient = speedtest.New()

// Use a proxy for the speedtest. eg: socks://127.0.0.1:7890
// speedtest.WithUserConfig(&speedtest.UserConfig{Proxy: "socks://127.0.0.1:7890"})(speedtestClient)

// Select a network card as the data interface.
// speedtest.WithUserConfig(&speedtest.UserConfig{Source: "192.168.1.101"})(speedtestClient)

// Get user's network information
// user, _ := speedtestClient.FetchUserInfo()

// Get a list of servers near a specified location
// user.SetLocationByCity("Tokyo")
// user.SetLocation("Osaka", 34.6952, 135.5006)

// Search server using serverID.
// eg: fetch server with ID 28910.
// speedtest.ErrServerNotFound will be returned if the server cannot be found.
// server, err := speedtest.FetchServerByID("28910")

serverList, _ := speedtestClient.FetchServers()
targets, _ := serverList.FindServer([]int{})

for _, s := range targets {
	// Please make sure your host can access this test server,
	// otherwise you will get an error.
	// It is recommended to replace a server at this time
	s.PingTest(nil)
	s.DownloadTest()
	s.UploadTest()
	fmt.Printf("Latency: %s, Download: %f, Upload: %f\n", s.Latency, s.DLSpeed, s.ULSpeed)
}

}`

@r3inbowari
Copy link
Collaborator

Hi, @pabcxyz, Can I use strace or dmesg for debugging.

@andy-hsiung
Copy link
Author

@r3inbowari https://github.com/showwin/speedtest-go/issues/95 ,In this issue, you mentioned a .zip file that worked for me. Where can I find the corresponding code?

@r3inbowari
Copy link
Collaborator

@r3inbowari https://github.com/showwin/speedtest-go/issues/95 ,In this issue, you mentioned a .zip file that worked for me. Where can I find the corresponding code?

They use almost the same code. use [email protected]

@r3inbowari
Copy link
Collaborator

var speedtestClient = speedtest.New()
# Try adding debug line, can you see anything?
speedtest.WithUserConfig(&speedtest.UserConfig{Debug: true})(speedtestClient)

@r3inbowari
Copy link
Collaborator

r3inbowari commented Sep 9, 2023

speedtest-go_linux_amd64.zip I compiled this, you can try it.

@andy-hsiung
Copy link
Author

@r3inbowari This .zip file doesn't work; it has the same issue as the one I mentioned.

@andy-hsiung
Copy link
Author

@r3inbowari server A is configured with 4 vCPUs and 8 GiB of RAM, server B is configured with 4 vCPUs and 16 GiB of RAM. When I run the program on server A, it throws this error, but it works fine on server B. I believe this program has specific memory requirements. I hope for a quick fix.now,What should I do now to be able to use this package? Could you please advise?

@r3inbowari
Copy link
Collaborator

r3inbowari commented Sep 9, 2023

Can you provide server A system information

@andy-hsiung
Copy link
Author

@r3inbowari Sure, but what specific system information do you need?

@r3inbowari
Copy link
Collaborator

kernel and os release

@andy-hsiung
Copy link
Author

CentOS Linux release 7.6.1810 (Core)

@r3inbowari
Copy link
Collaborator

A and B are same?

@andy-hsiung
Copy link
Author

Yes, apart from the system configuration。

@r3inbowari
Copy link
Collaborator

Any clues about dmesg?

Hi, @pabcxyz, Can I use strace or dmesg for debugging.

@andy-hsiung
Copy link
Author

image image I only captured a fragment.

@r3inbowari
Copy link
Collaborator

where is the kill signal you mentioned?

@andy-hsiung
Copy link
Author

image

@r3inbowari
Copy link
Collaborator

oom?

@r3inbowari
Copy link
Collaborator

Any clues about dmesg?

Hi, @pabcxyz, Can I use strace or dmesg for debugging.

dmesg | egrep -i -B100 'killed process'

@andy-hsiung
Copy link
Author

Sorry, I didn't quite understand what you meant. Currently, this is all I can provide.

@r3inbowari
Copy link
Collaborator

This issue seems to occur after #142.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants