SIGSEGV: invalid memory address or nil pointer dereference #99

Closed
opened 2018-08-04 21:01:20 +00:00 by kardan · 4 comments

collected some null pointers although ~/.cwtch/user.json is present:

2018/08/03 03:26:51 NewApp(/home/user/.cwtch, /usr/bin/tor)                                                      
2018/08/03 03:26:51 starting local tor proxy
cwtch [unset]> info
Profile needs to be set
cwtch [unset]> load-profile user
Enter a password to decrypt the profile: Error loading profile for user: open user.json: no such file or directory
cwtch [unset]> groups
panic: runtime error: invalid memory address or nil pointer dereference                                         
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x8308597]                                        

goroutine 1 [running]:
main.main()
        /home/user/go/src/cwtch.im/cwtch/app/cli/main.go:283 +0xf37                                              
exit status 2
cwtch [unset]> info
Profile needs to be set
cwtch [unset]> load-profile user
Enter a password to decrypt the profile: Error loading profile for user: open user.json: no such file or directory
cwtch [unset]> quit
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x8308063]

goroutine 1 [running]:
main.main()
        /home/user/go/src/cwtch.im/cwtch/app/cli/main.go:201 +0xa03
exit status 2
2018/08/04 22:59:11 NewApp(/home/user/.cwtch, /usr/bin/tor)
2018/08/04 22:59:11 using existing tor proxy
cwtch [unset]> groups
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x8308597]

goroutine 1 [running]:
main.main()
        /home/user/go/src/cwtch.im/cwtch/app/cli/main.go:283 +0xf37
exit status 2

It does however not seem to be related to the profile:

2018/08/04 22:56:55 NewApp(/home/user/.cwtch, /usr/bin/tor)
2018/08/04 22:56:55 using existing tor proxy
cwtch [unset]> quit
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x8308063]

goroutine 1 [running]:
main.main()
        /home/user/go/src/cwtch.im/cwtch/app/cli/main.go:201 +0xa03
exit status 2
collected some null pointers although `~/.cwtch/user.json` is present: ``` 2018/08/03 03:26:51 NewApp(/home/user/.cwtch, /usr/bin/tor) 2018/08/03 03:26:51 starting local tor proxy cwtch [unset]> info Profile needs to be set cwtch [unset]> load-profile user Enter a password to decrypt the profile: Error loading profile for user: open user.json: no such file or directory cwtch [unset]> groups panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x8308597] goroutine 1 [running]: main.main() /home/user/go/src/cwtch.im/cwtch/app/cli/main.go:283 +0xf37 exit status 2 ``` ``` cwtch [unset]> info Profile needs to be set cwtch [unset]> load-profile user Enter a password to decrypt the profile: Error loading profile for user: open user.json: no such file or directory cwtch [unset]> quit panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x8308063] goroutine 1 [running]: main.main() /home/user/go/src/cwtch.im/cwtch/app/cli/main.go:201 +0xa03 exit status 2 ``` ``` 2018/08/04 22:59:11 NewApp(/home/user/.cwtch, /usr/bin/tor) 2018/08/04 22:59:11 using existing tor proxy cwtch [unset]> groups panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x8308597] goroutine 1 [running]: main.main() /home/user/go/src/cwtch.im/cwtch/app/cli/main.go:283 +0xf37 exit status 2 ``` It does however not seem to be related to the profile: ``` 2018/08/04 22:56:55 NewApp(/home/user/.cwtch, /usr/bin/tor) 2018/08/04 22:56:55 using existing tor proxy cwtch [unset]> quit panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x8308063] goroutine 1 [running]: main.main() /home/user/go/src/cwtch.im/cwtch/app/cli/main.go:201 +0xa03 exit status 2 ```
Author

and two more:

2018/08/04 23:07:01 NewApp(/home/user/.cwtch, /usr/bin/tor)                                                      
2018/08/04 23:07:01 using existing tor proxy
cwtch [unset]> new-group 53gt5ixjrfzoik5i
Setting up a new group on server:53gt5ixjrfzoik5i
panic: runtime error: invalid memory address or nil pointer dereference                                         
[signal SIGSEGV: segmentation violation code=0x1 addr=0x5c pc=0x8309788]                                        

goroutine 1 [running]:
main.main()
        /home/user/go/src/cwtch.im/cwtch/app/cli/main.go:330 +0x2128                                             
exit status 2
2018/08/04 23:08:22 NewApp(/home/user/.cwtch, /usr/bin/tor)                                                      
2018/08/04 23:08:22 using existing tor proxy
cwtch [unset]> servers
panic: runtime error: invalid memory address or nil pointer dereference                                         
[signal SIGSEGV: segmentation violation code=0x1 addr=0x34 pc=0x8308b0f]                                        

goroutine 1 [running]:
main.main()
        /home/user/go/src/cwtch.im/cwtch/app/cli/main.go:272 +0x14af                                             
exit status 2

I assume in all cases Peer is undefined:

201: app.Peer.Save()
272: servers := app.Peer.GetServers()
283: for _, gid := range app.Peer.GetGroups() {
330: id, _, err := app.Peer.StartGroup(commands[1])
and two more: ``` 2018/08/04 23:07:01 NewApp(/home/user/.cwtch, /usr/bin/tor) 2018/08/04 23:07:01 using existing tor proxy cwtch [unset]> new-group 53gt5ixjrfzoik5i Setting up a new group on server:53gt5ixjrfzoik5i panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x5c pc=0x8309788] goroutine 1 [running]: main.main() /home/user/go/src/cwtch.im/cwtch/app/cli/main.go:330 +0x2128 exit status 2 ``` ``` 2018/08/04 23:08:22 NewApp(/home/user/.cwtch, /usr/bin/tor) 2018/08/04 23:08:22 using existing tor proxy cwtch [unset]> servers panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x34 pc=0x8308b0f] goroutine 1 [running]: main.main() /home/user/go/src/cwtch.im/cwtch/app/cli/main.go:272 +0x14af exit status 2 ``` I assume in all cases Peer is undefined: ``` 201: app.Peer.Save() 272: servers := app.Peer.GetServers() 283: for _, gid := range app.Peer.GetGroups() { 330: id, _, err := app.Peer.StartGroup(commands[1]) ```
sarah referenced this issue from a commit 2018-08-04 21:19:29 +00:00
sarah referenced this issue from a commit 2018-08-04 21:20:56 +00:00
Author

Confirm fix in branch clifix. That was fast!

2018/08/04 23:24:29 NewApp(/home/user/.cwtch, /usr/bin/tor)
2018/08/04 23:24:29 using existing tor proxy
cwtch [unset]> load-profile user.js
Enter a password to decrypt the profile: 
Error loading profile for user.js: open user.js.json: no such file or directory
cwtch [unset]> load-profile user.json
Enter a password to decrypt the profile: 
Error loading profile for user.json: open user.json.json: no such file or directory
cwtch [unset]> load-profile user
Enter a password to decrypt the profile: 
Error loading profile for user: open user.json: no such file or directory
cwtch [unset]> groups
Profile needs to be set
cwtch [unset]> quit
Shutting down Tor process...
Confirm fix in branch clifix. That was fast! ``` 2018/08/04 23:24:29 NewApp(/home/user/.cwtch, /usr/bin/tor) 2018/08/04 23:24:29 using existing tor proxy cwtch [unset]> load-profile user.js Enter a password to decrypt the profile: Error loading profile for user.js: open user.js.json: no such file or directory cwtch [unset]> load-profile user.json Enter a password to decrypt the profile: Error loading profile for user.json: open user.json.json: no such file or directory cwtch [unset]> load-profile user Enter a password to decrypt the profile: Error loading profile for user: open user.json: no such file or directory cwtch [unset]> groups Profile needs to be set cwtch [unset]> quit Shutting down Tor process... ```
Owner

Thanks for reporting!

Thanks for reporting!
Owner

Fixed in #100, to be followed up in #101

Fixed in #100, to be followed up in #101
sarah closed this issue 2018-08-04 22:11:43 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cwtch.im/cwtch#99
No description provided.