mrusme / neonmodem

Neon Modem Overdrive
https://neonmodem.com
GNU General Public License v3.0
582 stars 22 forks source link

loadSystems crashes with wrong Lemmy password #18

Closed joshnb closed 4 months ago

joshnb commented 1 year ago

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x80 pc=0x563d981d6ad1]

goroutine 1 [running]: github.com/mrusme/neonmodem/cmd.loadSystems(0xc000456000) github.com/mrusme/neonmodem/cmd/root.go:98 +0xf1 github.com/mrusme/neonmodem/cmd.glob..func1(0x563d98b4a1c0?, {0x563d981dbc8c?, 0x0?, 0x0?}) github.com/mrusme/neonmodem/cmd/root.go:115 +0xdc github.com/spf13/cobra.(Command).execute(0x563d98b4a1c0, {0xc000024240, 0x0, 0x0}) github.com/spf13/cobra@v1.6.1/command.go:920 +0x847 github.com/spf13/cobra.(Command).ExecuteC(0x563d98b4a1c0) github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd github.com/spf13/cobra.(*Command).Execute(...) github.com/spf13/cobra@v1.6.1/command.go:968 github.com/mrusme/neonmodem/cmd.Execute(0xc0000061a0?) github.com/mrusme/neonmodem/cmd/root.go:127 +0x3e main.main() github.com/mrusme/neonmodem/neonmodem.go:13 +0x25

can find the file to try to figure out what its not working.. Any ideas?

VincentYing commented 1 year ago

This error occurs for me too after connecting hackernews.

Running program initially with only lobsters works.

joshnb commented 1 year ago

Dang! To bad I don't use lobster. Looks like an error at line 98 in root.go.. I can not find that file anywhere in my system.. Hope it gets corrected soon. Would love to use this client! :)

On Fri, Jun 9, 2023 at 10:10 PM VincentYing @.***> wrote:

This error occurs for me too after connecting hackernews.

Running program initially with only lobsters works.

— Reply to this email directly, view it on GitHub https://github.com/mrusme/neonmodem/issues/18#issuecomment-1585442204, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYILY5C57YHWUA76DI2CD6TXKPQSZANCNFSM6AAAAAAZAGZNGY . You are receiving this because you authored the thread.Message ID: @.***>

mrusme commented 1 year ago

Did you run any of the connect commands upfront?

joshnb commented 1 year ago

Did you run any of the connect commands upfront?

Yes, i ran 'neonmodem connect --type lemmy --url https://lemmy.ml' , entered my user and pass and got "Successfully added new connection!". Then neonmodem returnes panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x80 pc=0x55d0b9d74ad1]

goroutine 1 [running]: github.com/mrusme/neonmodem/cmd.loadSystems(0xc0000bc000) github.com/mrusme/neonmodem/cmd/root.go:98 +0xf1 github.com/mrusme/neonmodem/cmd.glob..func1(0x55d0ba6e81c0?, {0x55d0b9d79c8c?, 0x0?, 0x0?}) github.com/mrusme/neonmodem/cmd/root.go:115 +0xdc github.com/spf13/cobra.(Command).execute(0x55d0ba6e81c0, {0xc000024240, 0x0, 0x0}) github.com/spf13/cobra@v1.6.1/command.go:920 +0x847 github.com/spf13/cobra.(Command).ExecuteC(0x55d0ba6e81c0) github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd github.com/spf13/cobra.(*Command).Execute(...) github.com/spf13/cobra@v1.6.1/command.go:968 github.com/mrusme/neonmodem/cmd.Execute(0xc0000061a0?) github.com/mrusme/neonmodem/cmd/root.go:127 +0x3e main.main() github.com/mrusme/neonmodem/neonmodem.go:13 +0x25

epl692 commented 1 year ago

Same issue,

[epl692@iceland:.config] $ neonmodem
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x80 pc=0xd307a6]

goroutine 1 [running]:
github.com/mrusme/neonmodem/cmd.loadSystems(0xc0004040a0)
        /home/runner/work/neonmodem/neonmodem/cmd/root.go:98 +0x4e6
github.com/mrusme/neonmodem/cmd.glob..func1(0x173bec0?, {0xe7b182?, 0x0?, 0x0?})
        /home/runner/work/neonmodem/neonmodem/cmd/root.go:115 +0xdc
github.com/spf13/cobra.(*Command).execute(0x173bec0, {0xc00009e1f0, 0x0, 0x0})
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:920 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0x173bec0)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
github.com/mrusme/neonmodem/cmd.Execute(0xc0000061a0?)
        /home/runner/work/neonmodem/neonmodem/cmd/root.go:127 +0x3e
main.main()
        /home/runner/work/neonmodem/neonmodem/neonmodem.go:13 +0x25

eliminating my connection to lemmy allows the program to... uselessly start.

I should note, there seems to be a non-standard go installed on the system in question (sdf.org public access unix system running NetBSD)

[epl692@ma.sdf.org:neonmodem] $ ./neonmodem
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x80 pc=0xd4f811]

goroutine 1 [running]:
github.com/mrusme/neonmodem/cmd.loadSystems(0xc00068e000)
        /meta/e/epl692/neonmodem/cmd/root.go:104 +0xf1
github.com/mrusme/neonmodem/cmd.glob..func1(0x17676a0?, {0xea3838?, 0x0?, 0x0?})
        /meta/e/epl692/neonmodem/cmd/root.go:121 +0xdc
github.com/spf13/cobra.(*Command).execute(0x17676a0, {0xc000024240, 0x0, 0x0})
        /meta/e/epl692/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:920 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0x17676a0)
        /meta/e/epl692/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        /meta/e/epl692/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
github.com/mrusme/neonmodem/cmd.Execute(0xc0000061a0?)
        /meta/e/epl692/neonmodem/cmd/root.go:133 +0x3e
main.main()
        /meta/e/epl692/neonmodem/neonmodem.go:13 +0x25

Also tried building from source on our linux system here. $ uname -a Linux ma.sdf.org 4.19.0-23-amd64 #1 SMP Debian 4.19.269-1 (2022-12-20) x86_64 GNU/Linux

mrusme commented 1 year ago

Thanks for reporting! Could anyone of you give it a try with the latest master branch?

joshnb commented 1 year ago

Thanks for reporting! Could anyone of you give it a try with the latest master branch?

Just downloaded the arm64 placed in user/local/bin, chmod +x neonmodem.

neonmodem connect --type lemmy --url https://lemmy.ml 02:35:43 Please enter your username or email: Please enter your password (will not echo): Successfully added new connection! ~|⇒ neonmodem 02:35:57 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x80 pc=0xd45616]

goroutine 1 [running]: github.com/mrusme/neonmodem/cmd.loadSystems(0xc0000ba000) /home/runner/work/neonmodem/neonmodem/cmd/root.go:105 +0xb6 github.com/mrusme/neonmodem/cmd.glob..func1(0x1770140?, {0xe9628b?, 0x0?, 0x0?}) /home/runner/work/neonmodem/neonmodem/cmd/root.go:122 +0xdc github.com/spf13/cobra.(Command).execute(0x1770140, {0xc00010a1f0, 0x0, 0x0}) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:944 +0x847 github.com/spf13/cobra.(Command).ExecuteC(0x1770140) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3bd github.com/spf13/cobra.(*Command).Execute(...) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992 github.com/mrusme/neonmodem/cmd.Execute(0xc0000061a0?) /home/runner/work/neonmodem/neonmodem/cmd/root.go:134 +0x3e main.main() /home/runner/work/neonmodem/neonmodem/neonmodem.go:13 +0x25

still not working for me.

tedwardd commented 1 year ago

@joshnb Can you provide some additional information about your environment? Specifically OS and GO version but any other details you think might be relevant to your environment would be helpful in tracking this down.

joshnb commented 1 year ago

@joshnb Can you provide some additional information about your environment? Specifically OS and GO version but any other details you think might be relevant to your environment would be helpful in tracking this down.

go version go1.20.5 linux/amd64 EndeavourOS Linux x86_64 Plasma 5.27.5 Intel i7-6600U (4) @ 3.

error seems to be in the loadSystems function at line 105 of the root.go file in the neonmodem/cmd. I can not find this file to try to fix the nil value for memory.

tedwardd commented 1 year ago

@joshnb Please run neonmodem --debug and provide the output in ~/.cache/neonmodem.log. There's some debugging calls available in loadSystems() and I'd like to see what they have to say.

joshnb commented 1 year ago

@joshnb Please run neonmodem --debug and provide the output in ~/.cache/neonmodem.log. There's some debugging calls available in loadSystems() and I'd like to see what they have to say.

after running the --debug, I saw my mistake. and neonmodem is now working! Thanks for the help! It was just my password was incorrect. got some yolk on my face...

mrusme commented 1 year ago

Well well, thank you for reporting, because this shouldn't happen nevertheless! I will change the issue's title accordingly, so that it can be fixed sometime. :-)

albert-tomanek commented 1 year ago

Just bumping to say that it might be necessary to delete ~/.config/neonmodem.toml before changing your password as currently the file is changed to contain 2 sets of credentials and I think the program only looks at the first (original) ones.

mrusme commented 4 months ago

This was fixed in #63, NMO now soft-fails to load systems and outputs everything important in its log (~/.cache/neonmodem.log).