Open Bug 1951673 Opened 21 days ago Updated 6 days ago

Guess alt-text doesn't work in the pdf viewer with a local artifact build

Categories

(Core :: Machine Learning, defect, P1)

defect

Tracking

()

People

(Reporter: calixte, Unassigned, NeedInfo)

Details

On Windows 11, with a local artifact build:

# my mozconfig
ac_add_options --enable-artifact-builds
ac_add_options --enable-debug

and the pref pdfjs.enableAltText set to true, most of the time the promise returned by createEngine:
https://searchfox.org/mozilla-central/source/toolkit/components/pdfjs/content/PdfjsParent.sys.mjs#484
never resolves.

console.debug: ML:EngineParent: "Creating a new engine"
console.debug: ML:EngineParent: "Using runtime ort-wasm-simd-threaded.jsep.wasm@3.0.0" ({name:"ort-wasm-simd-threaded.jsep.wasm", schema:1732665611321, version:"3.0.0", attachment:{hash:"185b0861a6cd6cbdfb057289338090436483cc59e10a7bc83bd167b15531a51b", size:21663894, filename:"ort-wasm-simd-threaded.jsep.wasm", location:"main-workspace/ml-onnx-runtime/cd84fa91-44f7-45a4-b04c-4b83afa5181a.wasm", mimetype:"application/wasm"}, id:"faa79bf3-2ae4-4217-a58c-f2d1cf11b65d", last_modified:1732905275303})
console.debug: ML:EngineParent: "Creating model hub instance"
console.debug: ML:EngineParent: "Creating model hub instance"
console.debug: ML:EngineParent: "Creating model hub instance"
console.debug: ML:EngineParent: "Creating model hub instance"
console.debug: ML:ModelHub: "Getting model file from https://model-hub.mozilla.org/mozilla/distilvit/v0.5.0/config.json?download=true"
console.debug: ML:ModelHub: "Getting model file from https://model-hub.mozilla.org/mozilla/distilvit/v0.5.0/tokenizer.json?download=true"
console.debug: ML:ModelHub: "Getting model file from https://model-hub.mozilla.org/mozilla/distilvit/v0.5.0/tokenizer_config.json?download=true"
console.debug: ML:ModelHub: "Getting model file from https://model-hub.mozilla.org/mozilla/distilvit/v0.5.0/preprocessor_config.json?download=true"
[Parent 30036, IndexedDB IO #4] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80630001 (NS_ERROR_STORAGE_BUSY): file /builds/worker/checkouts/gecko/storage/mozStorageConnection.cpp:1204
[Parent 30036, IndexedDB IO #4] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80630001 (NS_ERROR_STORAGE_BUSY): file /builds/worker/checkouts/gecko/storage/mozStorageService.cpp:684
[Parent 30036, IndexedDB IO #4] WARNING: QM_TRY failure (ERROR): '::mozilla::ToResultInvoke< nsCOMPtr<mozIStorageConnection>>( ::std::mem_fn( &::mozilla::detail::DerefedType<decltype(aStorageService)>::OpenDatabaseWithFileURL), (aStorageService), &aFileURL, telemetryFilename, mozIStorageService::CONNECTION_INTERRUPTIBLE) failed with resultCode 0x80630001, resultName NS_ERROR_STORAGE_BUSY', file dom/indexedDB/ActorsParent.cpp:738
[Parent 30036, IndexedDB IO #4] WARNING: QM_TRY failure (WARNING): '"OpenDatabase(aStorageService, aFileURL, aTelemetryId) .map([](auto connection) -> ConnectionType { return Some(std::move(connection)); })" failed with resultCode 0x80630001, resultName NS_ERROR_STORAGE_BUSY', file dom/indexedDB/ActorsParent.cpp:762
[Parent 30036, IndexedDB IO #4] WARNING: Received NS_ERROR_STORAGE_BUSY when attempting to open database '3797145237msoedleilF.sqlite', retrying for up to 10 seconds: file /builds/worker/checkouts/gecko/dom/indexedDB/ActorsParent.cpp:774
console.debug: ML:ModelHub: "Cache Hit for https://model-hub.mozilla.org/mozilla/distilvit/v0.5.0/config.json?download=true"
console.debug: ML:ModelHub: "Cache Hit for https://model-hub.mozilla.org/mozilla/distilvit/v0.5.0/tokenizer.json?download=true"
console.debug: ML:ModelHub: "Cache Hit for https://model-hub.mozilla.org/mozilla/distilvit/v0.5.0/tokenizer_config.json?download=true"
console.debug: ML:ModelHub: "Cache Hit for https://model-hub.mozilla.org/mozilla/distilvit/v0.5.0/preprocessor_config.json?download=true"
[Parent 30036, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/PartitioningExceptionList.cpp:172
[Parent 30036, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/PartitioningExceptionList.cpp:172
[Parent 30036, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/PartitioningExceptionList.cpp:172
[Parent 30036, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/PartitioningExceptionList.cpp:172
[Parent 30036, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/PartitioningExceptionList.cpp:172
[Parent 30036, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/PartitioningExceptionList.cpp:172
console.debug: ML:EngineParent: "Model mozilla/distilvit was fetched from /mozilla/distilvit/v0.5.0/config.json, size 0MiB"
console.debug: ML:EngineParent: "Model mozilla/distilvit was fetched from /mozilla/distilvit/v0.5.0/tokenizer.json, size 2MiB"
console.debug: ML:EngineParent: "Model mozilla/distilvit was fetched from /mozilla/distilvit/v0.5.0/tokenizer_config.json, size 0MiB"
console.debug: ML:EngineParent: "Model mozilla/distilvit was fetched from /mozilla/distilvit/v0.5.0/preprocessor_config.json, size 0MiB"
console.debug: ML:ModelHub: "Getting model file from https://model-hub.mozilla.org/mozilla/distilvit/v0.5.0/onnx/encoder_model_quantized.onnx?download=true"
console.debug: ML:ModelHub: "Getting model file from https://model-hub.mozilla.org/mozilla/distilvit/v0.5.0/onnx/decoder_model_merged_quantized.onnx?download=true"
console.debug: ML:ModelHub: "Getting model file from https://model-hub.mozilla.org/mozilla/distilvit/v0.5.0/generation_config.json?download=true"
console.debug: ML:ModelHub: "Cache Hit for https://model-hub.mozilla.org/mozilla/distilvit/v0.5.0/onnx/encoder_model_quantized.onnx?download=true"
console.debug: ML:ModelHub: "Cache Hit for https://model-hub.mozilla.org/mozilla/distilvit/v0.5.0/onnx/decoder_model_merged_quantized.onnx?download=true"
console.debug: ML:ModelHub: "Cache Hit for https://model-hub.mozilla.org/mozilla/distilvit/v0.5.0/generation_config.json?download=true"
console.debug: ML:EngineParent: "Model mozilla/distilvit was fetched from /mozilla/distilvit/v0.5.0/onnx/encoder_model_quantized.onnx, size 83MiB"
console.debug: ML:EngineParent: "Model mozilla/distilvit was fetched from /mozilla/distilvit/v0.5.0/onnx/decoder_model_merged_quantized.onnx, size 95MiB"
console.debug: ML:EngineParent: "Model mozilla/distilvit was fetched from /mozilla/distilvit/v0.5.0/generation_config.json, size 0MiB"
[Parent 30036, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/PartitioningExceptionList.cpp:172
[Parent 30036, IPC I/O Parent] WARNING: Call to Send() failed: file /builds/worker/checkouts/gecko/ipc/glue/NodeChannel.cpp:195
[Parent 30036, IPC I/O Parent] WARNING: [1.1]: Dropping message '<null>'; no connection to unknown peer AF16515857BB6267.989F15E707DE9CBD: file /builds/worker/checkouts/gecko/ipc/glue/NodeController.cpp:364
[Parent 30036, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/PartitioningExceptionList.cpp:172
[Parent 30036, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/PartitioningExceptionList.cpp:172
[Parent 30036, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/PartitioningExceptionList.cpp:172
[Parent 30036, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/PartitioningExceptionList.cpp:172
[Parent 30036, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/PartitioningExceptionList.cpp:172
[Parent 30036, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/PartitioningExceptionList.cpp:172

Rarely it resolves but then, the promise here never resolves:
https://searchfox.org/mozilla-central/source/toolkit/components/pdfjs/content/PdfjsParent.sys.mjs#315

The model works correctly in about:inference and I don't have any problem in nightly.

Priority: -- → P1

I am not sure if this is related to the bug. But here are a couple things we should double-check

This line https://hg.mozilla.org/mozilla-central/file/73340dad529243c691d0896cac80527bea1a98aa/toolkit/components/ml/content/ModelHub.sys.mjs#l383 should be in the function defined here https://hg.mozilla.org/mozilla-central/file/73340dad529243c691d0896cac80527bea1a98aa/toolkit/components/ml/content/ModelHub.sys.mjs#l221. If i remember, onversionchange is only call if you have an open connection to the db for version 5. And then, there is a new connection request (without closing version 5) for version 6. Then onversionchange will be called only on the open connection for the db version 5. It won't be called on the new version 6.
In particular, if no existing open connection exists, onversionchange is not called even when onupgradeneeded is called.

Let's also double-check that the request.onupgradeneeded and the other db events waits/support async function. I have a feeling it doesn't actually await for the completion of the async function if the async is not immediate.

The severity field is not set for this bug.
:tarek, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(tziade)
You need to log in before you can comment on or make changes to this bug.