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

psweb crash #95

Open
asoltys opened this issue Dec 20, 2024 · 2 comments
Open

psweb crash #95

asoltys opened this issue Dec 20, 2024 · 2 comments

Comments

@asoltys
Copy link

asoltys commented Dec 20, 2024

Running psweb v1.7.4 as a plugin for CLN 24.11.1 it seemed to work fine for a few minutes. I came back to look at it again hours later and found it had crashed:

2024/12/19 22:44:38 Polled peers for balances
fatal error: concurrent map read and map write

goroutine 661604 [running]:
peerswap-web/cmd/psweb/ln.CacheHTLCs({0xc0169be7d0, 0x50})
        /peerswap-web/cmd/psweb/ln/cln.go:521 +0x9a9
main.onSendPaySuccess.func1({0xc00511a280, 0x40})
        /peerswap-web/cmd/psweb/main-cln.go:111 +0x56
created by main.onSendPaySuccess in goroutine 661815
        /peerswap-web/cmd/psweb/main-cln.go:109 +0x70

goroutine 1 [syscall]:
syscall.Syscall(0x0, 0x0, 0xc00c452000, 0x800)
        /usr/local/go/src/syscall/syscall_linux.go:73 +0x25
syscall.read(0xc000054120?, {0xc00c452000?, 0xc000512bc0?, 0x419f05?})
        /usr/local/go/src/syscall/zsyscall_linux_amd64.go:736 +0x38
syscall.Read(...)
        /usr/local/go/src/syscall/syscall_unix.go:183
internal/poll.ignoringEINTRIO(...)
        /usr/local/go/src/internal/poll/fd_unix.go:745
internal/poll.(*FD).Read(0xc000054120, {0xc00c452000, 0x800, 0x800})
        /usr/local/go/src/internal/poll/fd_unix.go:161 +0x2ae
os.(*File).read(...)
        /usr/local/go/src/os/file_posix.go:29
os.(*File).Read(0xc00007a058, {0xc00c452000?, 0xc000512c38?, 0xc0000fe9c0?})
        /usr/local/go/src/os/file.go:124 +0x52
bufio.(*Scanner).Scan(0xc000512d40)
        /usr/local/go/src/bufio/scan.go:219 +0x81e
github.com/elementsproject/glightning/jrpc2.(*Server).listen(0xc00002a0f0, {0x168a040?, 0xc00007a058?})
        /root/go/pkg/mod/github.com/elementsproject/[email protected]/jrpc2/server.go:108 +0xfe
github.com/elementsproject/glightning/jrpc2.(*Server).StartUp(0xc00002a0f0, 0xc00007a058, 0xc00007a060)
        /root/go/pkg/mod/github.com/elementsproject/[email protected]/jrpc2/server.go:69 +0x92
github.com/elementsproject/glightning/glightning.(*Plugin).Start(0xc000318000, 0xc00007a058, 0xc00007a060)
        /root/go/pkg/mod/github.com/elementsproject/[email protected]/glightning/plugin.go:1294 +0x13e
main.main()
        /peerswap-web/cmd/psweb/main-cln.go:73 +0x3b8

@Impa10r
Copy link
Owner

Impa10r commented Dec 22, 2024

thanks, will investigate

@Impa10r
Copy link
Owner

Impa10r commented Dec 23, 2024

@asoltys Hi Adam. Thanks for catching this bug! Could you try building v1.7.5 and see if it runs fine? You can do that with:

rm -rf peerswap-web && \
git clone -b v1.7.5 https://github.com/Impa10r/peerswap-web && \
cd peerswap-web && \
make -j$(nproc) install-cln && \
lightning-cli -k plugin subcommand=stop plugin=${HOME}/go/bin/psweb && \
lightning-cli -k plugin subcommand=start plugin=${HOME}/go/bin/psweb

I only run a small CLN testnet node and don't know anyone else who uses PSWeb with CLN in production. Thanks a lot!

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