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

bug: net/http server not working on linux #4346

Open
ldemailly opened this issue Jul 18, 2024 · 3 comments
Open

bug: net/http server not working on linux #4346

ldemailly opened this issue Jul 18, 2024 · 3 comments

Comments

@ldemailly
Copy link
Contributor

package main

import (
    "net/http"
    "log"
)

func helloHandler(w http.ResponseWriter, r *http.Request) {
    w.Write([]byte("Hello, TinyGo!"))
}

func main() {
    mux := http.NewServeMux()
    mux.HandleFunc("/", helloHandler)
    log.Fatal(http.ListenAndServe(":8080", mux))
}
tinygo run .
panic: runtime error at 0x0000000000233e7f: nil pointer dereference
error: failed to run compiled binary /tmp/tinygo1722875622/main: signal: aborted (core dumped)
@dkegel-fastly
Copy link
Contributor

dkegel-fastly commented Jul 19, 2024

This is, alas, documented not to work at https://tinygo.org/docs/reference/lang-support/stdlib/#nethttp

@ldemailly
Copy link
Contributor Author

ldemailly commented Jul 19, 2024

well there should be a way to isolate the crypto part no?

http is pretty basic

also... runtime error not build time?

@dkegel-fastly
Copy link
Contributor

Yeah, that page needs some updating. If the problem is still crypto related, as I think dgryski mentioned, a stub of the offending crypto module might at least let plain old http work.

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

No branches or pull requests

2 participants