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

Crash on startup (SIGSEGV) #116

Open
rothn opened this issue Jul 29, 2023 · 8 comments
Open

Crash on startup (SIGSEGV) #116

rothn opened this issue Jul 29, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@rothn
Copy link

rothn commented Jul 29, 2023

I followed the instructions on https://docs.mau.fi/bridges/go/imessage/mac/setup.html
Similar to: mautrix/whatsapp#180

Crash on startup (iMessage).

Stack Trace + Logs:

nicholas@Nicholass-MacBook-Air mautrix-imessage-universal % ./mautrix-imessage 
2023-07-29T09:26:31-07:00 INF Initializing bridge built_at="Jul 28 2023, 20:45:36" go_version=go1.20.6 name=mautrix-imessage version=0.1.0+dev.807b62d1
2023-07-29T09:26:31-07:00 DBG Initializing database connection
2023-07-29T09:26:31-07:00 DBG Initializing state store
2023-07-29T09:26:31-07:00 DBG Initializing Matrix event processor
2023-07-29T09:26:31-07:00 DBG Initializing Matrix event handler
2023-07-29T09:26:31-07:00 DBG Bridge built with end-to-bridge encryption, but disabled in config
2023-07-29T09:26:31-07:00 DBG Initializing iMessage connector
2023-07-29T09:26:31-07:00 INF Contact access is allowed module=iMessage/Mac
2023-07-29T09:26:31-07:00 INF Bridge initialization complete, starting...
2023-07-29T09:26:31-07:00 DBG Running database upgrades
2023-07-29T09:26:31-07:00 INF Database is up to date current_version=21 db_section=main latest_known_version=21 oldest_compatible_version=21
2023-07-29T09:26:31-07:00 INF Database is up to date current_version=5 db_section=matrix_state latest_known_version=5 oldest_compatible_version=5
2023-07-29T09:26:31-07:00 DBG Starting application service websocket
2023-07-29T09:26:31-07:00 DBG Checking connection to homeserver
2023-07-29T09:26:31-07:00 DBG Appservice transaction websocket opened
2023-07-29T09:26:31-07:00 DBG Starting handling of transaction content={"pdu":0} req_id=0 ws_command=
2023-07-29T09:26:31-07:00 DBG Finished dispatching events from transaction req_id=0 ws_command=
2023-07-29T09:26:31-07:00 DBG Sent response to transaction req_id=0 ws_command=
2023-07-29 09:26:32.189 mautrix-imessage[590:4826] XXX: countOfStores: 1, countOfAccounts: 1
2023-07-29T09:26:32-07:00 DBG Request completed as_user_id=@imessagebot:[nicholasroth.net](http://nicholasroth.net/) duration=594.450732 method=GET req_id=1 response_length=857 response_mime=application/json status_code=200 url=https://matrix.nicholasroth.net/_matrix/client/versions?user_id=%40imessagebot%3Anicholasroth.net
2023-07-29T09:26:32-07:00 DBG Request completed as_user_id=@imessagebot:[nicholasroth.net](http://nicholasroth.net/) duration=41.372467 method=GET req_id=2 response_length=60 response_mime=application/json status_code=200 url=https://matrix.nicholasroth.net/_matrix/client/v3/account/whoami?user_id=%40imessagebot%3Anicholasroth.net
2023-07-29T09:26:32-07:00 DBG Websocket mode: no need to check status of homeserver -> bridge connection
2023-07-29T09:26:32-07:00 DBG Starting event processor
2023-07-29T09:26:32-07:00 DBG Finding bridge user
2023-07-29T09:26:32-07:00 DBG Updating bot profile
2023-07-29T09:26:32-07:00 DBG Logging in with shared secret module=User/@nicholasroth:[nicholasroth.net](http://nicholasroth.net/)
2023-07-29T09:26:32-07:00 DBG Request completed as_user_id=@imessagebot:[nicholasroth.net](http://nicholasroth.net/) duration=58.614954 method=GET req_id=4 response_length=59 response_mime=application/json status_code=200 url=https://matrix.nicholasroth.net/_matrix/client/v3/profile/@imessagebot:nicholasroth.net/avatar_url?user_id=%40imessagebot%3Anicholasroth.net
2023-07-29T09:26:32-07:00 DBG Request completed as_user_id=@imessagebot:[nicholasroth.net](http://nicholasroth.net/) duration=108.653296 method=GET req_id=3 response_length=26 response_mime=application/json status_code=200 url=https://matrix.nicholasroth.net/_matrix/media/v3/config?user_id=%40imessagebot%3Anicholasroth.net
2023-07-29T09:26:32-07:00 DBG Request completed as_user_id=@imessagebot:[nicholasroth.net](http://nicholasroth.net/) duration=113.868711 method=GET req_id=6 response_length=37 response_mime=application/json status_code=200 url=https://matrix.nicholasroth.net/_matrix/client/v3/profile/@imessagebot:nicholasroth.net/displayname?user_id=%40imessagebot%3Anicholasroth.net
2023-07-29T09:26:32-07:00 DBG Request completed as_user_id=@nicholasroth:[nicholasroth.net](http://nicholasroth.net/) duration=364.834563 method=POST req_body="<sensitive content omitted>" req_id=5 response_length=64 response_mime=application/json status_code=403 url=https://matrix.nicholasroth.net/_matrix/client/v3/login
2023-07-29T09:26:32-07:00 WRN Failed to switch to auto-logined custom puppet: failed to log in with shared secret: failed to POST /_matrix/client/v3/login: M_FORBIDDEN (HTTP 403): Invalid username or password module=User/@nicholasroth:[nicholasroth.net](http://nicholasroth.net/)
2023-07-29T09:26:32-07:00 DBG Connecting to iMessage
2023-07-29T09:26:32-07:00 DBG Starting iMessage handler
2023-07-29T09:26:32-07:00 DBG Sending bridge status to server: {StateEvent:CONNECTED Timestamp:0 TTL:0 Source: Error: Message: UserID: RemoteID:unknown RemoteName: Info:map[]}
2023-07-29T09:26:32-07:00 DBG Starting IPC loop
2023-07-29T09:26:32-07:00 INF Initialization complete
2023-07-29T09:26:32-07:00 INF Bridge started!
2023-07-29T09:26:32-07:00 DBG Periodic sync is enabled
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x10050b836]

goroutine 50 [running]:
[maunium.net/go/mautrix/util/configupgrade.(*Helper).Set(0x0](http://maunium.net/go/mautrix/util/configupgrade.(*Helper).Set(0x0)?, 0x0?, {0x100a04a78, 0x5}, {0xc0004dde10?, 0x2, 0x100fde640?})
	/Users/tulir/go/pkg/mod/[maunium.net/go/mautrix@v0.15.5-0.20230722173405-ab9d6e5eb5b9/util/configupgrade/helper.go:275](http://maunium.net/go/mautrix@v0.15.5-0.20230722173405-ab9d6e5eb5b9/util/configupgrade/helper.go:275) +0xd6
[maunium.net/go/mautrix/bridge.(*Bridge).ResendBridgeInfo.func1(0xc0004f3680](http://maunium.net/go/mautrix/bridge.(*Bridge).ResendBridgeInfo.func1(0xc0004f3680)?)
	/Users/tulir/go/pkg/mod/[maunium.net/go/mautrix@v0.15.5-0.20230722173405-ab9d6e5eb5b9/bridge/bridge.go:659](http://maunium.net/go/mautrix@v0.15.5-0.20230722173405-ab9d6e5eb5b9/bridge/bridge.go:659) +0x6e
[maunium.net/go/mautrix/util/configupgrade.SimpleUpgrader.DoUpgrade(0x10000e756](http://maunium.net/go/mautrix/util/configupgrade.SimpleUpgrader.DoUpgrade(0x10000e756)?, 0x1013cf058?)
	/Users/tulir/go/pkg/mod/[maunium.net/go/mautrix@v0.15.5-0.20230722173405-ab9d6e5eb5b9/util/configupgrade/upgrade.go:48](http://maunium.net/go/mautrix@v0.15.5-0.20230722173405-ab9d6e5eb5b9/util/configupgrade/upgrade.go:48) +0x1f
[maunium.net/go/mautrix/util/configupgrade.(*Helper).apply(0xc0002aa000](http://maunium.net/go/mautrix/util/configupgrade.(*Helper).apply(0xc0002aa000)?, {0x100b825e0, 0x100a85480})
	/Users/tulir/go/pkg/mod/[maunium.net/go/mautrix@v0.15.5-0.20230722173405-ab9d6e5eb5b9/util/configupgrade/upgrade.go:52](http://maunium.net/go/mautrix@v0.15.5-0.20230722173405-ab9d6e5eb5b9/util/configupgrade/upgrade.go:52) +0x32
[maunium.net/go/mautrix/util/configupgrade.Do({0x100a0c282](http://maunium.net/go/mautrix/util/configupgrade.Do(%7B0x100a0c282), 0xb}, 0x1, {0x100b83a98?, 0xc000169e60}, {0xc0004ddfa8, 0x1, 0x1004184fe?})
	/Users/tulir/go/pkg/mod/[maunium.net/go/mautrix@v0.15.5-0.20230722173405-ab9d6e5eb5b9/util/configupgrade/upgrade.go:83](http://maunium.net/go/mautrix@v0.15.5-0.20230722173405-ab9d6e5eb5b9/util/configupgrade/upgrade.go:83) +0x2b2
[maunium.net/go/mautrix/bridge.(*Bridge).ResendBridgeInfo(0xc000232a00)](http://maunium.net/go/mautrix/bridge.(*Bridge).ResendBridgeInfo(0xc000232a00))
	/Users/tulir/go/pkg/mod/[maunium.net/go/mautrix@v0.15.5-0.20230722173405-ab9d6e5eb5b9/bridge/bridge.go:658](http://maunium.net/go/mautrix@v0.15.5-0.20230722173405-ab9d6e5eb5b9/bridge/bridge.go:658) +0x7f
created by [maunium.net/go/mautrix/bridge.(*Bridge).start](http://maunium.net/go/mautrix/bridge.(*Bridge).start)
	/Users/tulir/go/pkg/mod/[maunium.net/go/mautrix@v0.15.5-0.20230722173405-ab9d6e5eb5b9/bridge/bridge.go:646](http://maunium.net/go/mautrix@v0.15.5-0.20230722173405-ab9d6e5eb5b9/bridge/bridge.go:646) +0x52a
@rothn rothn added the bug Something isn't working label Jul 29, 2023
@tulir
Copy link
Member

tulir commented Jul 29, 2023

That probably happens if you set resend_bridge_info: true, because that config option doesn't exist in this bridge. Did you accidentally try to use the config from another bridge or something?

@skug67
Copy link

skug67 commented Jul 30, 2023

I'm having the exact same problem -- no "resend_bridge_info" setting in config.yaml

@skug67
Copy link

skug67 commented Jul 30, 2023

I reverted to the version from 2 weeks ago and it works fine

@rothn
Copy link
Author

rothn commented Jul 31, 2023

I also think it's strange that this seems to trigger a failed authentication attempt even though my Synapse server shows that it processes the registration in its startup logs.

@tulir
Copy link
Member

tulir commented Aug 1, 2023

Double puppeting auth isn't related to the registration file

I reverted to the version from 2 weeks ago and it works fine

The last commit on master is 3 weeks old 🧐

@rothn
Copy link
Author

rothn commented Aug 21, 2023

@tulir I use the stock config from the repo, modified according to the instructions in https://docs.mau.fi/bridges/go/imessage/mac/setup.html

@rothn
Copy link
Author

rothn commented Aug 22, 2023

I downloaded the latest binary and no more segfault. Seems like I just got a bad build.

@rothn
Copy link
Author

rothn commented Aug 22, 2023

FWIW, if you encounter this issue, https://mau.dev/mautrix/imessage/-/pipelines/11573 is known-good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants