Bug 1634341 Comment 10 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I hate to reopen this, but I am still seeing this with 78.4.2 thunderbird (32bit)  under Windows10.
The Windows10 itself is 64-bit.

There are 7 such errors in the console.

Now, however, I get a somewhat different stacktrace from the attachment I posted, but basically
all  exceptions  are thrown from L10nRegsitry.jsm:658:19
``
/**
 * This is a synchronous version of the `load`
 * function and should stay completely in sync with it at all
 * times except of the async/await changes.
 *
 * Notice: Any changes to this method should be copied
 * to the `generateResourceSetSync` equivalent below.
 *
 * @param {string} url
 *
 * @returns {string}
 */
L10nRegistry.loadSync = function(uri) {
  try {
    let url = Services.io.newURI(uri);
    let data = Cu.readUTF8URI(url);  <=== This is where the exception is thrown.
    return data;
  } catch (e) {
    if (
      e.result == Cr.NS_ERROR_INVALID_ARG ||
      e.result == Cr.NS_ERROR_NOT_INITIALIZED
    ) {
      try {
        // The preloader doesn't support this url or isn't initialized
        // (xpcshell test). Try a synchronous channel load.
        let stream = NetUtil.newChannel({
          uri,
          loadUsingSystemPrincipal: true,
        }).open();

        return NetUtil.readInputStreamToString(stream, stream.available(), {
          charset: "UTF-8",
        });
      } catch (e) {
        if (e.result != Cr.NS_ERROR_FILE_NOT_FOUND) {
          Cu.reportError(e);   <=== may be a good idea to print URL HERE
        }
      }
    } else if (e.result != Cr.NS_ERROR_FILE_NOT_FOUND) {
      Cu.reportError(e); <=== maybe a good idea to print URL HERE
    }
  }

  return false;
};
```

I think it is a good idea to print URL to see what is going on. Maybe some non-Windows-compatible path name is passed down the stack?
Or L10nRegistry.jsm does not properly generate the final pathname that is acceptable on host OS?

So I want to change L10nRegistery.jsm to print |url| when the error occurs..
But it is in omni.ja archive.

I have a few questions:
Q1 - what would be the good function to print the URL which would be shown in the error console. 
  Cc.dump('error URL:' + url) would be just fine?
Q2 - what is the proper way to edit omni.ja arcihve that is bundled with the official distribution of TB.
I can edit .zip archive in the following manner.
 - save omni.ja : copy omni.ja -> omini.ja.saved-copy
 - rename omni.ja to omni.zip so that I can unzip and edit the L10nRegistery.jsm inside and zip the files again.
  (Actually, I can do the above step automagically by using GNU Emacs. It groks .zip archive and allows me to edit the file inside and write it back to produce the edited zip archive automatially.)
 - copy back the edited omni.zip to omni.ja

All is set, well ALMOST.
Now I think there are a few steps to invalidate the JSM cache after I change L10nRegistry.jsm if I recall correctly.

Can  anyone shed light on Q1 and Q2 above?
I can tinker with Q1, but I am a bit hazy about Q2.

TIA
I hate to reopen this, but I am still seeing this with 78.4.2 thunderbird (32bit)  under Windows10.
The Windows10 itself is 64-bit.

There are 7 such errors in the console.

Now, however, I get a somewhat different stacktrace from the attachment I posted, but basically
all  exceptions  are thrown from L10nRegsitry.jsm:658:19
```
/**
 * This is a synchronous version of the `load`
 * function and should stay completely in sync with it at all
 * times except of the async/await changes.
 *
 * Notice: Any changes to this method should be copied
 * to the `generateResourceSetSync` equivalent below.
 *
 * @param {string} url
 *
 * @returns {string}
 */
L10nRegistry.loadSync = function(uri) {
  try {
    let url = Services.io.newURI(uri);
    let data = Cu.readUTF8URI(url);  <=== This is where the exception is thrown.
    return data;
  } catch (e) {
    if (
      e.result == Cr.NS_ERROR_INVALID_ARG ||
      e.result == Cr.NS_ERROR_NOT_INITIALIZED
    ) {
      try {
        // The preloader doesn't support this url or isn't initialized
        // (xpcshell test). Try a synchronous channel load.
        let stream = NetUtil.newChannel({
          uri,
          loadUsingSystemPrincipal: true,
        }).open();

        return NetUtil.readInputStreamToString(stream, stream.available(), {
          charset: "UTF-8",
        });
      } catch (e) {
        if (e.result != Cr.NS_ERROR_FILE_NOT_FOUND) {
          Cu.reportError(e);   <=== may be a good idea to print URL HERE
        }
      }
    } else if (e.result != Cr.NS_ERROR_FILE_NOT_FOUND) {
      Cu.reportError(e); <=== maybe a good idea to print URL HERE
    }
  }

  return false;
};
```

I think it is a good idea to print URL to see what is going on. Maybe some non-Windows-compatible path name is passed down the stack?
Or L10nRegistry.jsm does not properly generate the final pathname that is acceptable on host OS?

So I want to change L10nRegistery.jsm to print |url| when the error occurs..
But it is in omni.ja archive.

I have a few questions:
Q1 - what would be the good function to print the URL which would be shown in the error console. 
  Cc.dump('error URL:' + url) would be just fine?
Q2 - what is the proper way to edit omni.ja arcihve that is bundled with the official distribution of TB.
I can edit .zip archive in the following manner.
 - save omni.ja : copy omni.ja -> omini.ja.saved-copy
 - rename omni.ja to omni.zip so that I can unzip and edit the L10nRegistery.jsm inside and zip the files again.
  (Actually, I can do the above step automagically by using GNU Emacs. It groks .zip archive and allows me to edit the file inside and write it back to produce the edited zip archive automatially.)
 - copy back the edited omni.zip to omni.ja

All is set, well ALMOST.
Now I think there are a few steps to invalidate the JSM cache after I change L10nRegistry.jsm if I recall correctly.

Can  anyone shed light on Q1 and Q2 above?
I can tinker with Q1, but I am a bit hazy about Q2.

TIA

Back to Bug 1634341 Comment 10