Bug 173829 - [GTK] Layout Tests imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_bits.worker.html crashes
Summary: [GTK] Layout Tests imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_k...
Status: RESOLVED DUPLICATE of bug 173589
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-26 00:33 PDT by Fujii Hironori
Modified: 2017-06-26 03:18 PDT (History)
2 users (show)

See Also:


Attachments
WIP patch (695 bytes, patch)
2017-06-26 00:53 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2017-06-26 00:33:41 PDT
[GTK] Layout Tests imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_bits.worker.html crashes

https://build.webkit.org/builders/GTK%20Linux%2064-bit%20Release%20%28Tests%29/builds/1946

>  imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_bits.worker.html [ Crash ]
>  imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_keys.worker.html [ Crash ]
>  imported/w3c/web-platform-tests/WebCryptoAPI/import_export/ec_importKey.worker.html [ Crash ]
>  imported/w3c/web-platform-tests/WebCryptoAPI/import_export/test_ec_importKey.https.html [ Crash ]

Callstack:

> Thread 1 (Thread 0x7ff0bffff700 (LWP 7982)):
> #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
> #1  0x00007ff1867153fa in __GI_abort () at abort.c:89
> #2  0x00007ff18b6e8224 in _gcry_logv () at /home/slave/webkitgtk/gtk-linux-64-release-tests/build/WebKitBuild/DependenciesGTK/Source/libgcrypt-1.7.6/src/misc.c:142
> #3  0x00007ff18b6e8634 in _gcry_log_bug () at /home/slave/webkitgtk/gtk-linux-64-release-tests/build/WebKitBuild/DependenciesGTK/Source/libgcrypt-1.7.6/src/misc.c:241
> #4  0x00007ff18b7a0a9c in _gcry_mpi_const () at /home/slave/webkitgtk/gtk-linux-64-release-tests/build/WebKitBuild/DependenciesGTK/Source/libgcrypt-1.7.6/mpi/mpiutil.c:741
> #5  0x00007ff1938b30fe in _ZN7WebCore11CryptoKeyEC18platformImportSpkiENS_25CryptoAlgorithmIdentifierENS0_10NamedCurveEON3WTF6VectorIhLm0ENS3_15CrashOnOverflowELm16EEEbi ()
> #6  0x00007ff1938b804a in _ZN7WebCore11CryptoKeyEC10importSpkiENS_25CryptoAlgorithmIdentifierERKN3WTF6StringEONS2_6VectorIhLm0ENS2_15CrashOnOverflowELm16EEEbi ()
> #7  0x00007ff193894e70 in _ZN7WebCore19CryptoAlgorithmECDH9importKeyENS_12SubtleCrypto9KeyFormatEON3WTF7VariantIJNS3_6VectorIhLm0ENS3_15CrashOnOverflowELm16EEENS_10JsonWebKeyEEEEOKSt10unique_ptrINS_25CryptoAlgorithmParametersESt14default_deleteISC_EEbiONS3_8FunctionIFvRNS_9CryptoKeyEEEEONSI_IFviEEE ()
> #8  0x00007ff192a41981 in _ZN7WebCore14JSSubtleCrypto9importKeyERN3JSC9ExecStateEON3WTF3RefINS_15DeferredPromiseEEE ()
> #9  0x00007ff190b25a0d in _ZN7WebCore40jsSubtleCryptoPrototypeFunctionImportKeyEPN3JSC9ExecStateE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
> #10 0x00007ff137720a08 in ?? ()
> #11 0x00007ff0bfffdc40 in ?? ()
> #12 0x00007ff18cff2aaf in llint_entry () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
> Backtrace stopped: frame did not save the PC

Log:

> STDERR: 
> STDERR: warning: core file may not match specified executable file.
> STDERR: 51	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
> STDERR: Ohhhh jeeee: MPI subsystem not initialized
> STDERR: fatal error in libgcrypt, file /home/slave/webkitgtk/gtk-linux-64-release-tests/build/WebKitBuild/DependenciesGTK/Source/libgcrypt-1.7.6/src/misc.c, line 140, function _gcry_logv: internal error (fatal or bug)
> STDERR: (WebKitTestRunner:31109): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
Comment 1 Fujii Hironori 2017-06-26 00:44:00 PDT
(In reply to Fujii Hironori from comment #0)
> > STDERR: Ohhhh jeeee: MPI subsystem not initialized
> > STDERR: fatal error in libgcrypt, file /home/slave/webkitgtk/gtk-linux-64-release-tests/build/WebKitBuild/DependenciesGTK/Source/libgcrypt-1.7.6/src/misc.c, line 140, function _gcry_logv: internal error (fatal or bug)

This message is output in _gcry_mpi_const of WebKitBuild/DependenciesGTK/Source/libgcrypt-1.7.6/mpi/mpiutil.c.

This means _gcry_mpi_init doesn's seem to be called.
_gcry_mpi_init is called from global_init of libgcrypt-1.7.6/src/global.c.
global_init has this comment.

> /* This is our handmade constructor.  It gets called by any function
>    likely to be called at startup.  The suggested way for an
>    application to make sure that this has been called is by using
>    gcry_check_version. */

gcry_check_version() needs to be called to initialize at startup.
Comment 2 Fujii Hironori 2017-06-26 00:53:34 PDT
Created attachment 313821 [details]
WIP patch

This WIP patch solves the crashes. But, two problems.

* I'm not sure this is the right place to call gcry_check_version().
* Solved Crash problem. But, the test cases still Failed. I think Bug 169272 looks the same.

Zan, do you have any idea?
Comment 3 Zan Dobersek 2017-06-26 02:53:24 PDT
Yes, libgcrypt has to be explicitly initialized. Otherwise the test relies on being run after other tests that force through the necessary initialization.

I'm handling this in bug #173589.

The ec_importKey.worker.html and test_ec_importKey.https.html tests still fail due to missing implementations. TestExpectations address that, but not the crashes.
Comment 4 Fujii Hironori 2017-06-26 03:18:53 PDT
Thank you. Closed this bug.

*** This bug has been marked as a duplicate of bug 173589 ***