whatscli icon indicating copy to clipboard operation
whatscli copied to clipboard

Segmentation fault when using `/upload`

Open siddhpant opened this issue 4 years ago • 9 comments

Here is the screenshot of the same.

image

An attempt to format the output (I don't know Go):

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

goroutine 27 [running]:
    io.ReadAll({0x0, 0x0})
        /usr/local/Cellar/go/1.17.2/libexec/src/io/io.go:633 +0xd4

    io/ioutil.ReadAll(...)
        /usr/local/Cellar/go/1.17.2/libexec/src/io/ioutil/ioutil.go:27

        github.com/Rhymen/go-whatsapp.(*Conn).Upload(0x0, {0x0, 0x0}, {0x9b3471, 0x16})
            /Users/normenhansen/go/pkg/mod/github.com/!rhymen/[email protected]/media.go:144 +0x5c

        github.com/Rhymen/go-whatsapp.(*Conn).Send(0xc000210000, {0x983200, 0xc00024ac60})
            /Users/normenhansen/go/pkg/mod/github.com/!rhymen/[email protected]/message.go:50 +0x5bd

        github.com/normen/whatscli/messages.(*SessionManager).execCommand(0xc000113080, {{0xc000325261, 0x6}, {0xc000063bb0, 0x1, 0x1}})
            /Users/normenhansen/Dev/GoCode/whatscli/messages/session_manager.go:405 +0xec5

        github.com/normen/whatscli/messages.(*SessionManager).runManager(0xc000113080)
            /Users/normenhansen/Dev/GoCode/whatscli/messages/session_manager.go:145 +0x116a

        created by github.com/normen/whatscli/messages.(*SessionManager).StartManager
            /Users/normenhansen/Dev/GoCode/whatscli/messages/session_manager.go:65 +0x70

siddhpant avatar Dec 10 '21 09:12 siddhpant

Are you sure the file exists? Whats the path you gave, note there should be no quotes or backspaces in the name.

normen avatar Dec 10 '21 10:12 normen

Yes, I copied the path after using ls. It was a PDF. There were no quotes in the path.

I also tried on an image file - /sendimage worked on it, but /upload segfaulted like above.

siddhpant avatar Dec 10 '21 13:12 siddhpant

No idea, the error happens in io.ReadAll so technically this is a bug in go itself as the go-whatsapp library just seems to read the file at that point and correctly checks for errors. Is this a self-compiled version or did you download it from here?

Edit: The debug symbols even have my paths in it - silly question, sorry. Yeah, no idea really, maybe check the go-whatsapp tracker if the issue came up?

normen avatar Dec 10 '21 22:12 normen

maybe check the go-whatsapp tracker if the issue came up?

There isn't one... Should I open one, or maybe it is an issue just here?

siddhpant avatar Dec 12 '21 09:12 siddhpant

I'm having the same behavior. Segfault when /upload

slarrain avatar Mar 04 '22 21:03 slarrain

for me this reproduces just on launch, Linux mint 21

FROL256 avatar Nov 02 '22 05:11 FROL256

Same here on Ubuntu when I launch the executable downloaded github.

gicappa avatar Dec 21 '22 14:12 gicappa

for me this reproduces just on launch, Linux mint 21

my case on ubuntu, are there some information about distro-compibility?

VERSION="22.04.2 LTS (Jammy Jellyfish)"

Thank you advance.

oscarenzo avatar Mar 13 '23 15:03 oscarenzo

for me this reproduces just on launch, Linux mint 21

Issue persists.

FallCheetah7373 avatar Nov 06 '23 06:11 FallCheetah7373