dbcrypt icon indicating copy to clipboard operation
dbcrypt copied to clipboard

checkpw blocks infinitely when using flutter in release apk

Open devxpy opened this issue 8 years ago • 20 comments

Please refer to this gist for code and logs.

devxpy avatar Jul 13 '18 10:07 devxpy

Oops I didn't see this issue was created until now, sorry. I'll check it tomorrow, but bear in mind flutter uses a dev version of the Dart 2 SDK and the released version of dBCrypt doesn't support yet Dart 2 (a version that supports it, is almost ready)

Erly avatar Jul 31 '18 20:07 Erly

I can't reproduce this issue with an Xperia X Performance (Android 8.0) on Windows, with the same Flutter and Android toolchain version and dBCrypt 0.2.0 😕 Could you try with a different phone or the code from the master branch that is Dart 2 ready? I'm not sure I can get a Nexus 5 to try it but I'll try it with the Xperia on Linux tomorrow just in case, but shouldn't make any difference.

Erly avatar Aug 01 '18 19:08 Erly

I am experiencing the same issue on a OnePlus 5T. However, it does not block forever. It just takes a VERY long time to complete.

I think a good approach would be to make the API async, but off course also fix the performance issue ;-)

jeroentrappers avatar Sep 03 '18 10:09 jeroentrappers

Making the API async won't do much since it's a CPU bound task.

But, using a dart Isolate to create a new thread and then get the results back using the inbuilt messaging functionality would solve the issue

devxpy avatar Sep 03 '18 12:09 devxpy

I am experiencing the same; On the debug apk it takes around 3 seconds to complete a hash a string, whereas the release apk (no code changes) it takes 160 seconds! Any eta on the dart2 version?

metacomgd avatar Oct 24 '18 19:10 metacomgd

Can confirm this is still an issue.

NBTX avatar Dec 09 '18 02:12 NBTX

This issue is caused by: https://github.com/flutter/flutter/issues/24906

NBTX avatar Dec 17 '18 15:12 NBTX

@metacomgd Dart 2 version was released months ago. Thanks @NBTX let's hope that when the flutter team fixes that issue, this gets fixed too.

Erly avatar Dec 18 '18 15:12 Erly

It's not fix yet. WE ARE IN JULY 2019

louia avatar Jun 14 '19 13:06 louia

error not fixed

mbtolou avatar Jul 02 '19 18:07 mbtolou

Has anyone still being affected by this error opened an issue in the Flutter repo? If so, can you post it here?

NBTX avatar Jul 05 '19 08:07 NBTX

The issue is not that checkpw blocks infinitely, just that for a large cost factor it can take an incredible amount of time.

jeroentrappers avatar Jul 18 '19 07:07 jeroentrappers

With the last flutter stable version for me it takes 4 seconds to run the gist in the original post on my device, which may be too much but nowhere near blocking infinitely like it was originally reported. I think that problem was fixed in #https://github.com/flutter/flutter/issues/24906 and the problem right now it's related to #https://github.com/dart-lang/sdk/issues/37551 but can't try it yet since not even the dev channel has a SDK version with that fix yet.

Erly avatar Aug 12 '19 15:08 Erly

I have this issue too on recent versions. Sadly, can't do nothing bout it. If anyone needs information, I will kindly provide

flawnn avatar May 19 '21 22:05 flawnn

@flawnn i made a native implementation for this exact reason: https://pub.dev/packages/flutter_bcrypt

jeroentrappers avatar May 19 '21 22:05 jeroentrappers

@flawnn i made a native implementation for this exact reason: https://pub.dev/packages/flutter_bcrypt

It seems like this wasn't updated for a long time. Null safety seems also not supported, that's a bit of a bummer.

flawnn avatar May 19 '21 22:05 flawnn

It works for me :-) PR welcome if you like to update it, or put null safety support in it.

jeroentrappers avatar May 19 '21 22:05 jeroentrappers

It works for me :-) PR welcome if you like to update it, or put null safety support in it.

https://github.com/jeroentrappers/flutter_bcrypt/pull/6 here you go ;) works for me, migration was flawless

flawnn avatar May 19 '21 22:05 flawnn

It works for me :-) PR welcome if you like to update it, or put null safety support in it.

Kind reminder again to merge the PR, so other people can use the wonderful package too on higher SDK version :)

flawnn avatar May 21 '21 16:05 flawnn

Kind reminder again to merge the PR, so other people can use the wonderful package too on higher SDK version :)

Done

jeroentrappers avatar May 21 '21 18:05 jeroentrappers