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

Segmentation violation on HandleMessage #26

Open
forthommel opened this issue Nov 22, 2022 · 3 comments
Open

Segmentation violation on HandleMessage #26

forthommel opened this issue Nov 22, 2022 · 3 comments

Comments

@forthommel
Copy link

Dear developers,

First, let me thank you a lot for this bridge! It has been very useful so far.

However, I am encountering issues at bridge startup (as if the user/password storage in DB introduced in #14 does not work properly): I need to manually regenerate the connection token.
Furthermore, after an umpteenth of these (where all latest conversation pop up all at once in a fantastic notifications firework) it looks like the first messages display in a conversation is unevitably leading to this segfault:

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

goroutine 285 [running]:
maunium.net/go/mautrix/appservice.(*IntentAPI).EnsureJoined(0x0, {0xc000029f50, 0x27})
	/opt/go-skype-bridge/go/pkg/mod/github.com/pidongqianqian/mautrix-go@v0.10.4-0.20211208080648-321c4f849adb/appservice/intent.go:70 +0x2a
maunium.net/go/mautrix/appservice.(*IntentAPI).RedactEvent(0x0, {0xc000029f50, 0x27}, {0xc000029f20, 0x2c}, {0x0, 0x0, 0x0})
	/opt/go-skype-bridge/go/pkg/mod/github.com/pidongqianqian/mautrix-go@v0.10.4-0.20211208080648-321c4f849adb/appservice/intent.go:226 +0x4b
main.(*MatrixHandler).HandleMessage.func1()
	/opt/go-skype-bridge/matrix.go:405 +0x88
created by main.(*MatrixHandler).HandleMessage
	/opt/go-skype-bridge/matrix.go:402 +0x2ec

Could you please have a look and see if something requires a bit more attention?

Thanks in advance!
L.F.

@czen
Copy link

czen commented Mar 17, 2023

Encountered the same issue. Bridge synced a lot of personal and group chats, then crashed with this errror. Every restart and login now leads to the same error.

@forthommel
Copy link
Author

Same for me, and as no update was made on this ticket I completely (and sadly) dropped this solution.

@aostanin
Copy link

I encountered this same issue and was able to work around it by removing these lines from matrix.go:

go-skype-bridge/matrix.go

Lines 401 to 410 in 59e2790

if strings.HasPrefix(content.Body, "login") == true {
go func() {
time.Sleep(time.Second * 10)
customPuppet := user.bridge.GetPuppetByJID(user.JID)
_, err := customPuppet.customIntent.RedactEvent(evt.RoomID, evt.ID)
if err != nil {
mx.log.Debugfln("HandleMessage RedactEvent: %+v", err)
}
}()
}

The bot waits for 10 seconds after login then tries to remove the login message with your username and password from the chat history. That's where the crash occurs. I don't know the root cause, but at least this workaround makes the bridge usable.

czen added a commit to czen/go-skype-bridge that referenced this issue May 16, 2023
kelaresg#26 (comment) try to prevent it from crashing by removing the code that tries to redact login message
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

3 participants