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

Desktop Username password #1111

Merged
merged 37 commits into from
Jul 19, 2024
Merged

Desktop Username password #1111

merged 37 commits into from
Jul 19, 2024

Conversation

jigar-f
Copy link
Contributor

@jigar-f jigar-f commented Jun 28, 2024

No description provided.

@jigar-f jigar-f self-assigned this Jul 1, 2024
@jigar-f jigar-f added the WIP label Jul 5, 2024
@jigar-f jigar-f marked this pull request as ready for review July 8, 2024 12:44
@jigar-f jigar-f requested a review from atavism July 9, 2024 11:48
@jigar-f
Copy link
Contributor Author

jigar-f commented Jul 9, 2024

@atavism You start reviewing this PR.

desktop/lib.go Outdated Show resolved Hide resolved
@jigar-f
Copy link
Contributor Author

jigar-f commented Jul 15, 2024

@atavism thanks for approving, Did you able to find out about the crash?

@atavism
Copy link
Contributor

atavism commented Jul 16, 2024

@jigar-f I haven't been able to figure out what's causing the app to crash. I actually haven't experienced the same issue in awhile testing the latest changes. So I think we can just wait to see if it resurfaces

@atavism
Copy link
Contributor

atavism commented Jul 16, 2024

I discovered an issue where it looks like the timer in the VPNChangeNotifier isn't being stopped when it reaches the max number of ticks..

Jul 16 16:34:43.809 - 0m20s DEBUG app.settings: settings.go:670 Could not get value for userPro
flutter: startup status proxy true config true success false
flutter: flashlight fail initialized
Jul 16 16:34:44.810 - 0m21s DEBUG app.settings: settings.go:670 Could not get value for userPro
flutter: startup status proxy true config true success false
flutter: flashlight fail initialized
Jul 16 16:34:45.809 - 0m22s DEBUG app.settings: settings.go:670 Could not get value for userPro
flutter: startup status proxy true config true success false
flutter: flashlight fail initialized
Jul 16 16:34:46.810 - 0m23s DEBUG app.settings: settings.go:670 Could not get value for userPro
flutter: startup status proxy true config true success false
flutter: flashlight fail initialized
Jul 16 16:34:47.810 - 0m24s DEBUG app.settings: settings.go:670 Could not get value for userPro
flutter: startup status proxy true config true success false
flutter: flashlight fail initialized
Jul 16 16:34:48.810 - 0m25s DEBUG app.settings: settings.go:670 Could not get value for userPro
flutter: startup status proxy true config true success false
flutter: flashlight fail initialized

@jigar-f
Copy link
Contributor Author

jigar-f commented Jul 17, 2024

t

This is not an issue, We run the timer till the flashlight is initialized.

@jigar-f
Copy link
Contributor Author

jigar-f commented Jul 17, 2024

signal 16 received but handler not on signal stack
mp.gsignal stack [0x14000084000 0x1400008c000], mp.g0 stack [0x16ba88000 0x16bc8b000], sp=0x14000857678
fatal error: non-Go code set up signal handler without SA_ONSTACK flag

@atavism I am still getting crash, Any idea whats going on?

@atavism
Copy link
Contributor

atavism commented Jul 18, 2024

@atavism I am still getting crash, Any idea whats going on?

No, I am still having trouble getting the app to crash again myself. What are you doing just before the crash happens -- switching tabs, turning the VPN on, etc? It might be helpful to add additional logging to try to pinpoint where the crash is happening

@jigar-f
Copy link
Contributor Author

jigar-f commented Jul 18, 2024

It crashes for me at random places, I have already added some logging to track it down.

@jigar-f
Copy link
Contributor Author

jigar-f commented Jul 18, 2024

@atavism This might be the issue

desktop/lib.go Outdated Show resolved Hide resolved
desktop/lib.go Outdated
@@ -122,7 +127,7 @@ func start() {
}()

golog.SetPrepender(logging.Timestamped)
handleSignals(a)
// handleSignals(a)
Copy link
Contributor

@atavism atavism Jul 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this code to handle signals is the problem area since it hasn't caused the app to crash previously. It's likely some code that changed recently..

For instance, I wonder if we maybe introduced a bug somewhere fetching and storing user data.. the fact we see this error consistently in the logs points to an issue where a thread may be attempting to re-lock a mutex without first unlocking it or something:

goroutine 283 gp=0x14000ba3a40 m=nil [sync.Mutex.Lock]:
runtime.gopark(0x14000622e48?, 0x2?, 0xa?, 0x0?, 0x14000622e1c?)
	runtime/proc.go:402 +0xc8 fp=0x14000622cd0 sp=0x14000622cb0 pc=0x15fa0f6b8
runtime.selectgo(0x14000622e48, 0x14000622e18, 0x14000622e08?, 0x0, 0x15fa19c70?, 0x1)
	runtime/select.go:327 +0x614 fp=0x14000622de0 sp=0x14000622cd0 pc=0x15fa22c34

have you tried commenting out the new code or calls that are being made to see if the app still crashes with those disabled?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we checked if the app crashes on main? Let me do that now..

Copy link
Contributor

@atavism atavism Jul 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, this is interesting: the app is crashing for me on main, but it no longer does if I go back to commit 4c7a68a. Looks like this started happening with 042186e?

So I'm pretty sure the crash is unrelated to the changes here. Given that, I guess we could re-enable the signal handling and continue using proxied.ParallelForIdempotent to get this merged?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I have re-enbale signal and added proxied.ParallelForIdempotent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with merging.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me it looks like this might be crash, Since this actually throws painc.

runtime stack:
runtime.throw({0x15c9fc20e?, 0x0?})
	runtime/panic.go:1023 +0x40 fp=0x14000051490 sp=0x14000051460 pc=0x15bce13a0
runtime.sigNotOnStack(0x10, 0x14000051538, 0x14000080008)
	runtime/signal_unix.go:1065 +0x118 fp=0x140000514c0 sp=0x14000051490 pc=0x15bcfbe08
runtime.adjustSignalStack(0x10, 0x14000080008, 0x14000051568)
	runtime/signal_unix.go:592 +0x25c fp=0x14000051530 sp=0x140000514c0 pc=0x15bcfac6c
runtime.sigtrampgo(0x10, 0x140000516d0, 0x14000051738)
	runtime/signal_unix.go:480 +0x8c fp=0x140000515b0 sp=0x14000051530 pc=0x15bcfa7ac
runtime.sigtrampgo(0x10, 0x140000516d0, 0x14000051738)
	<autogenerated>:1 +0x1c fp=0x140000515e0 sp=0x140000515b0 pc=0x15bd20adc
runtime.sigtramp()
	runtime/sys_darwin_arm64.s:227 +0x4c fp=0x140000516a0 sp=0x140000515e0 pc=0x15bd1f5ac

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @jigar-f! I will take a closer look at this over the weekend

@jigar-f
Copy link
Contributor Author

jigar-f commented Jul 19, 2024

@atavism All changes are added, SHould I go ahead and merge this?

@jigar-f jigar-f removed the WIP label Jul 19, 2024
@atavism
Copy link
Contributor

atavism commented Jul 19, 2024

@atavism All changes are added, SHould I go ahead and merge this?

Thanks for making those changes! Sounds great! Merging..

@atavism atavism merged commit 3334ce5 into main Jul 19, 2024
2 checks passed
@atavism atavism deleted the jigar/desktop-username-password branch July 19, 2024 22:21
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

Successfully merging this pull request may close these issues.

2 participants