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

[help want] the program is hangup when read my net file system #2208

Closed
shynome opened this issue May 18, 2024 · 1 comment
Closed

[help want] the program is hangup when read my net file system #2208

shynome opened this issue May 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@shynome
Copy link

shynome commented May 18, 2024

Describe the bug

the program is hangup when read my net file system (like bash /dev/tcp/127.0.0.1/0)

To Reproduce

// wasm guest
package main

import "github.com/shynome/go-fsnet/dev"

func init() {
	http.DefaultClient = &http.Client{Transport: dev.Transport}
}

func main() {
	go func() {
		for {
			time.Sleep(time.Second)
			log.Println("not hangup")
		}
	}()
	time.Sleep(5 * time.Second)
	addr := fmt.Sprintf("http://%s", os.Args[1])
	resp := try.To1(http.Get(addr))
	io.Copy(os.Stdout, resp.Body)
}
// host server
func TestMain(m *testing.M) {
	l = try.To1(net.Listen("tcp", "127.0.0.1:0"))
	defer l.Close()
	go http.Serve(l, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		log.Println("get request")
		time.Sleep(5 * time.Second)
		io.WriteString(w, word)
	}))

	m.Run()
}

Run this test you will see the log is stop when request response hangup
TestWasiFsNet

2024/05/18 19:53:50 not hangup
2024/05/18 19:53:51 not hangup
2024/05/18 19:53:52 not hangup
2024/05/18 19:53:53 not hangup
2024/05/19 03:53:54 get request
PASS

Expected behavior

2024/05/18 19:53:50 not hangup
2024/05/18 19:53:51 not hangup
2024/05/18 19:53:52 not hangup
2024/05/18 19:53:53 not hangup
2024/05/19 03:53:54 get request
2024/05/18 19:53:55 not hangup
2024/05/18 19:53:56 not hangup
2024/05/18 19:53:57 not hangup
2024/05/18 19:53:58 not hangup
PASS

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the relevant information):

  • Go version: 1.22.3
  • wazero Version: v1.7.2
  • Host architecture: linux/amd64
  • Runtime mode: interpreter and compiler both trigger

Additional context

#1500

I feel this is about nonblock file flag, but I don't know how to add nonblock file flag to my net file system

I found poll-method, maybe I should implement this?

@shynome shynome added the bug Something isn't working label May 18, 2024
@shynome
Copy link
Author

shynome commented May 18, 2024

oh the nonblock file implement function is not public now, waiting it....

@shynome shynome closed this as completed May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant