Re: .ftl suffix file. Many moons ago, I have forgotten exactly why, but I was bothered by certain errors during |make mozmill| test, and during the tracing of the issues to debug this, I noticed one thing. SetSpec() call returned failures for many URIs. Obviously there *ARE* invalid paths passed by codes in |make mozmill| and lately mochitest test programs and presumably in valid run-time codes by mistakes. So I dumped the paths that caused errors of SetSpec() call in one place. But then I was not so sure what type of paths cause SetSpec() to return NS_OK. So Investigated a bit. *.ftl file paths seem to fail permanently from my analysis. I wonder if this has anything to do with the observation that the errors reported in comment 8 are related to .ftl paths. To wit, here is a little summary from June this year. Re: SetSpec() failure with |.ftl| path I summarised the errors from SetSpec() and dump the paths that are passed to it during mochitest. The number on the line is the frequency of occurrences. I think |DTD/xhtml1-strict.dtd|, |null|, |undefined|, and |moz-icon:| are indeed invalid specification. Somebody has to confirm this. But all other errors are paths with |.ftl| ending. This can't be a simple coincidence. I think the M-C/C-C code is not written to handle this |.ftl| path very well. ``` ======================================== SetSpec Failures/Successes ======================================== Failure first. 504 SetSpec failed. : aSpec=branding/brand.ftl 440 SetSpec failed. : aSpec=messenger/preferences/preferences.ftl 234 SetSpec failed. : aSpec=calendar/preferences.ftl 220 SetSpec failed. : aSpec=messenger/preferences/languages.ftl 220 SetSpec failed. : aSpec=messenger/preferences/fonts.ftl 140 SetSpec failed. : aSpec=messenger/otr/chat.ftl 33 SetSpec failed. : aSpec=toolkit/global/resetProfile.ftl 33 SetSpec failed. : aSpec=toolkit/global/processTypes.ftl 33 SetSpec failed. : aSpec=toolkit/about/aboutSupport.ftl 33 SetSpec failed. : aSpec=messenger/aboutSupportMail.ftl 28 SetSpec failed. : aSpec=toolkit/about/aboutAddons.ftl 11 SetSpec failed. : aSpec=DTD/xhtml1-strict.dtd 6 SetSpec failed. : aSpec=null 5 SetSpec failed. : aSpec=undefined 5 SetSpec failed. : aSpec=moz-icon:// 3 SetSpec failed. : aSpec=toolkit/about/aboutProfiles.ftl 3 SetSpec failed. : aSpec=toolkit/about/aboutConfig.ftl 2 SetSpec failed. : aSpec=moz-icon://chrome://calendar/content/sound.wav?size=16 Success.: First 40 lines 14844 SetSpec succeeded. : aSpec=about:blank 7422 SetSpec succeeded. : aSpec=moz-safe-about:blank 558 SetSpec succeeded. : aSpec=about:preferences 327 SetSpec succeeded. : aSpec=mailbox://nobody@Local%20Folders/Drafts 244 SetSpec succeeded. : aSpec=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABVUlEQVR42mNgGChgbGzMqm9slqFnbHZLz8TsPwoGioHkQGrItgBsOLrBaFjfxCydbAvgLjc2zQNymZCkmPRMzfOhllwj3wKoK9EMB4PQ0FBmJHmgWtM1eqZmS8m1gEHXxGyLnon5WlzyyGyyLMBmwKgFoxYMPgv+gdjq1ta8YL6elRhU/i+1LDgAY 240 SetSpec succeeded. : aSpec=data:image/svg+xml;filename=extension.svg;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBUaGlzIFNvdXJjZSBDb2RlIEZvcm0gaXMgc3ViamVjdCB0byB0aGUgdGVybXMgb2YgdGhlIE1vemlsbGEgUHVibGljCiAgIC0gTGljZW5zZSwgdi4gMi4wLiBJZiBhIGNvcHkgb2YgdGhlIE1QTC 157 SetSpec succeeded. : aSpec=mailbox://nobody@Local%20Folders/SummarizationA 150 SetSpec succeeded. : aSpec=mailbox://nobody@Local%20Folders/DeletionE 145 SetSpec succeeded. : aSpec=moz-nullprincipal:{44b6cd51-bfa2-4912-8d8c-b670697d49b3} ``` I only showed the first 10 lines for success. The summary of protocol part of all the successful SetSpec calls are as follows. successful protocol list Not all the protocols are explained in mozilla documentation pages. This is a problm on its own. ``` 15817 aSpec=about 7422 aSpec=moz-safe-about 5055 aSpec=mailbox 4382 aSpec=moz-nullprincipal 758 aSpec=data 586 aSpec=moz-icon 108 aSpec=mailto 77 aSpec=moz-storage-calendar 60 aSpec=view-source 57 aSpec=mailbox-message 30 aSpec=smtp 29 aSpec=page-icon 24 aSpec=imap 22 aSpec=addons 22 aSpec=addbook 18 aSpec=pop3 17 aSpec=news 15 aSpec=moz-memory-calendar 6 aSpec=predictor 3 aSpec=javascript 3 aSpec=http 1 aSpec=ldap ``` The patch to dump the paths for error cases is as follows. Modification to dump paths for all the cases with proper failed/succeeded prefix is trivial. ``` # HG changeset patch # User ISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp> # Parent f8e3af9ab87255463730e08a419b56b1fa1c1135 dump aSpec(i.e., path) for SetSpec failure diff --git a/netwerk/base/nsIURIMutator.idl b/netwerk/base/nsIURIMutator.idl --- a/netwerk/base/nsIURIMutator.idl +++ b/netwerk/base/nsIURIMutator.idl @@ -354,16 +354,29 @@ public: } NS_MutateURI& SetSpec(const nsACString& aSpec) { if (NS_FAILED(mStatus)) { return *this; } mStatus = mMutator->SetSpec(aSpec, nullptr); +#if DEBUG + if (NS_FAILED(mStatus)) { + char *l_data; + char l_string[256]; + int len = aSpec.Length(); + int upper = len > 255 ? 255: len; + l_data = ToNewCString(aSpec); + bcopy(l_data, l_string, upper); + l_string[upper] = '\0'; + + fprintf(stderr,"{debug} SetSpec %s : aSpec=%s\n", NS_FAILED(mStatus) ? "failed." : "succeeded.", l_string); + } +#endif return *this; } NS_MutateURI& SetScheme(const nsACString& aScheme) { if (NS_FAILED(mStatus)) { return *this; } mStatus = mMutator->SetScheme(aScheme, nullptr); ```
Bug 1634341 Comment 17 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Re: .ftl suffix file. Many moons ago, I have forgotten exactly why, but I was bothered by certain errors during |make mozmill| test, and during the tracing of the issues to debug this, I noticed one thing. SetSpec() call returned failures for many URIs. Obviously there *ARE* invalid paths passed by codes in |make mozmill| and lately mochitest test programs and presumably in valid run-time codes by mistakes. So I dumped the paths that caused errors of SetSpec() call in one place. But then I was not so sure what type of paths cause SetSpec() to return NS_OK. So Investigated a bit. *.ftl file paths seem to fail permanently from my analysis. I wonder if this has anything to do with the observation that the errors reported in comment 8 are related to .ftl paths. To wit, here is a little summary from June this year. Re: SetSpec() failure with |.ftl| path I summarised the errors from SetSpec() and dump the paths that are passed to it during mochitest. The number on the line is the frequency of occurrences. I think |DTD/xhtml1-strict.dtd|, |null|, |undefined|, and |moz-icon:| are indeed invalid specification. Somebody has to confirm this. But all other errors are paths with |.ftl| ending. This can't be a simple coincidence. I think the M-C/C-C code is not written to handle this |.ftl| path very well. ``` ======================================== SetSpec Failures/Successes ======================================== Failure first. 504 SetSpec failed. : aSpec=branding/brand.ftl 440 SetSpec failed. : aSpec=messenger/preferences/preferences.ftl 234 SetSpec failed. : aSpec=calendar/preferences.ftl 220 SetSpec failed. : aSpec=messenger/preferences/languages.ftl 220 SetSpec failed. : aSpec=messenger/preferences/fonts.ftl 140 SetSpec failed. : aSpec=messenger/otr/chat.ftl 33 SetSpec failed. : aSpec=toolkit/global/resetProfile.ftl 33 SetSpec failed. : aSpec=toolkit/global/processTypes.ftl 33 SetSpec failed. : aSpec=toolkit/about/aboutSupport.ftl 33 SetSpec failed. : aSpec=messenger/aboutSupportMail.ftl 28 SetSpec failed. : aSpec=toolkit/about/aboutAddons.ftl 11 SetSpec failed. : aSpec=DTD/xhtml1-strict.dtd 6 SetSpec failed. : aSpec=null 5 SetSpec failed. : aSpec=undefined 5 SetSpec failed. : aSpec=moz-icon:// 3 SetSpec failed. : aSpec=toolkit/about/aboutProfiles.ftl 3 SetSpec failed. : aSpec=toolkit/about/aboutConfig.ftl 2 SetSpec failed. : aSpec=moz-icon://chrome://calendar/content/sound.wav?size=16 Success.: First 40 lines 14844 SetSpec succeeded. : aSpec=about:blank 7422 SetSpec succeeded. : aSpec=moz-safe-about:blank 558 SetSpec succeeded. : aSpec=about:preferences 327 SetSpec succeeded. : aSpec=mailbox://nobody@Local%20Folders/Drafts 244 SetSpec succeeded. : aSpec=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABVUlEQVR42mNgGChgbGzMqm9slqFnbHZLz8TsPwoGioHkQGrItgBsOLrBaFjfxCydbAvgLjc2zQNymZCkmPRMzfOhllwj3wKoK9EMB4PQ0FBmJHmgWtM1eqZmS8m1gEHXxGyLnon5WlzyyGyyLMBmwKgFoxYMPgv+gdjq1ta8YL6elRhU/i+1LDgAY 240 SetSpec succeeded. : aSpec=data:image/svg+xml;filename=extension.svg;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBUaGlzIFNvdXJjZSBDb2RlIEZvcm0gaXMgc3ViamVjdCB0byB0aGUgdGVybXMgb2YgdGhlIE1vemlsbGEgUHVibGljCiAgIC0gTGljZW5zZSwgdi4gMi4wLiBJZiBhIGNvcHkgb2YgdGhlIE1QTC 157 SetSpec succeeded. : aSpec=mailbox://nobody@Local%20Folders/SummarizationA 150 SetSpec succeeded. : aSpec=mailbox://nobody@Local%20Folders/DeletionE 145 SetSpec succeeded. : aSpec=moz-nullprincipal:{44b6cd51-bfa2-4912-8d8c-b670697d49b3} ``` I only showed the first 10 lines for success. The summary of protocol part of all the successful SetSpec calls are as follows. successful protocol list Not all the protocols are explained in mozilla documentation pages. This is a problm on its own. ``` 15817 aSpec=about 7422 aSpec=moz-safe-about 5055 aSpec=mailbox 4382 aSpec=moz-nullprincipal 758 aSpec=data 586 aSpec=moz-icon 108 aSpec=mailto 77 aSpec=moz-storage-calendar 60 aSpec=view-source 57 aSpec=mailbox-message 30 aSpec=smtp 29 aSpec=page-icon 24 aSpec=imap 22 aSpec=addons 22 aSpec=addbook 18 aSpec=pop3 17 aSpec=news 15 aSpec=moz-memory-calendar 6 aSpec=predictor 3 aSpec=javascript 3 aSpec=http 1 aSpec=ldap ``` The patch to dump paths for all the cases with proper failed/succeeded prefix is trivial. ``` # HG changeset patch # User ISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp> # Parent f8e3af9ab87255463730e08a419b56b1fa1c1135 dump aSpec(i.e., path) for SetSpec failure diff --git a/netwerk/base/nsIURIMutator.idl b/netwerk/base/nsIURIMutator.idl --- a/netwerk/base/nsIURIMutator.idl +++ b/netwerk/base/nsIURIMutator.idl @@ -354,16 +354,29 @@ public: } NS_MutateURI& SetSpec(const nsACString& aSpec) { if (NS_FAILED(mStatus)) { return *this; } mStatus = mMutator->SetSpec(aSpec, nullptr); +#if DEBUG + if (NS_FAILED(mStatus)) { + char *l_data; + char l_string[256]; + int len = aSpec.Length(); + int upper = len > 255 ? 255: len; + l_data = ToNewCString(aSpec); + bcopy(l_data, l_string, upper); + l_string[upper] = '\0'; + + fprintf(stderr,"{debug} SetSpec %s : aSpec=%s\n", NS_FAILED(mStatus) ? "failed." : "succeeded.", l_string); + } +#endif return *this; } NS_MutateURI& SetScheme(const nsACString& aScheme) { if (NS_FAILED(mStatus)) { return *this; } mStatus = mMutator->SetScheme(aScheme, nullptr); ```
Re: .ftl suffix file. Many moons ago, I have forgotten exactly why, but I was bothered by certain errors during |make mozmill| test, and during the tracing of the issues to debug this, I noticed one thing. SetSpec() call returned failures for many URIs. Obviously there *ARE* invalid paths passed by codes in |make mozmill| and lately mochitest test programs and presumably in valid run-time codes by mistakes. So I dumped the paths that caused errors of SetSpec() call in one place. But then I was not so sure what type of paths cause SetSpec() to return NS_OK. So Investigated a bit. *.ftl file paths seem to fail permanently from my analysis. I wonder if this has anything to do with the observation that the errors reported in comment 8 are related to .ftl paths. To wit, here is a little summary from June this year. Re: SetSpec() failure with |.ftl| path I summarised the errors from SetSpec() and dump the paths that are passed to it during mochitest. The number on the line is the frequency of occurrences. I think |DTD/xhtml1-strict.dtd|, |null|, |undefined|, and |moz-icon:| are indeed invalid specification. Somebody has to confirm this. But all other errors are paths with |.ftl| ending. This can't be a simple coincidence. I think the M-C/C-C code is not written to handle this |.ftl| path very well. ``` ======================================== SetSpec Failures/Successes ======================================== Failure first. 504 SetSpec failed. : aSpec=branding/brand.ftl 440 SetSpec failed. : aSpec=messenger/preferences/preferences.ftl 234 SetSpec failed. : aSpec=calendar/preferences.ftl 220 SetSpec failed. : aSpec=messenger/preferences/languages.ftl 220 SetSpec failed. : aSpec=messenger/preferences/fonts.ftl 140 SetSpec failed. : aSpec=messenger/otr/chat.ftl 33 SetSpec failed. : aSpec=toolkit/global/resetProfile.ftl 33 SetSpec failed. : aSpec=toolkit/global/processTypes.ftl 33 SetSpec failed. : aSpec=toolkit/about/aboutSupport.ftl 33 SetSpec failed. : aSpec=messenger/aboutSupportMail.ftl 28 SetSpec failed. : aSpec=toolkit/about/aboutAddons.ftl 11 SetSpec failed. : aSpec=DTD/xhtml1-strict.dtd 6 SetSpec failed. : aSpec=null 5 SetSpec failed. : aSpec=undefined 5 SetSpec failed. : aSpec=moz-icon:// 3 SetSpec failed. : aSpec=toolkit/about/aboutProfiles.ftl 3 SetSpec failed. : aSpec=toolkit/about/aboutConfig.ftl 2 SetSpec failed. : aSpec=moz-icon://chrome://calendar/content/sound.wav?size=16 Success.: First 40 lines 14844 SetSpec succeeded. : aSpec=about:blank 7422 SetSpec succeeded. : aSpec=moz-safe-about:blank 558 SetSpec succeeded. : aSpec=about:preferences 327 SetSpec succeeded. : aSpec=mailbox://nobody@Local%20Folders/Drafts 244 SetSpec succeeded. : aSpec=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABVUlEQVR42mNgGChgbGzMqm9slqFnbHZLz8TsPwoGioHkQGrItgBsOLrBaFjfxCydbAvgLjc2zQNymZCkmPRMzfOhllwj3wKoK9EMB4PQ0FBmJHmgWtM1eqZmS8m1gEHXxGyLnon5WlzyyGyyLMBmwKgFoxYMPgv+gdjq1ta8YL6elRhU/i+1LDgAY 240 SetSpec succeeded. : aSpec=data:image/svg+xml;filename=extension.svg;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBUaGlzIFNvdXJjZSBDb2RlIEZvcm0gaXMgc3ViamVjdCB0byB0aGUgdGVybXMgb2YgdGhlIE1vemlsbGEgUHVibGljCiAgIC0gTGljZW5zZSwgdi4gMi4wLiBJZiBhIGNvcHkgb2YgdGhlIE1QTC 157 SetSpec succeeded. : aSpec=mailbox://nobody@Local%20Folders/SummarizationA 150 SetSpec succeeded. : aSpec=mailbox://nobody@Local%20Folders/DeletionE 145 SetSpec succeeded. : aSpec=moz-nullprincipal:{44b6cd51-bfa2-4912-8d8c-b670697d49b3} ``` I only showed the first 10 lines for success. The summary of protocol part of all the successful SetSpec calls are as follows. successful protocol list Not all the protocols are explained in mozilla documentation pages. This is a problm on its own. ``` 15817 aSpec=about 7422 aSpec=moz-safe-about 5055 aSpec=mailbox 4382 aSpec=moz-nullprincipal 758 aSpec=data 586 aSpec=moz-icon 108 aSpec=mailto 77 aSpec=moz-storage-calendar 60 aSpec=view-source 57 aSpec=mailbox-message 30 aSpec=smtp 29 aSpec=page-icon 24 aSpec=imap 22 aSpec=addons 22 aSpec=addbook 18 aSpec=pop3 17 aSpec=news 15 aSpec=moz-memory-calendar 6 aSpec=predictor 3 aSpec=javascript 3 aSpec=http 1 aSpec=ldap ``` The patch to dump paths for all the cases with proper failed/succeeded prefix is trivial. But right now it is invoked only when the call fails. ``` # HG changeset patch # User ISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp> # Parent f8e3af9ab87255463730e08a419b56b1fa1c1135 dump aSpec(i.e., path) for SetSpec failure diff --git a/netwerk/base/nsIURIMutator.idl b/netwerk/base/nsIURIMutator.idl --- a/netwerk/base/nsIURIMutator.idl +++ b/netwerk/base/nsIURIMutator.idl @@ -354,16 +354,29 @@ public: } NS_MutateURI& SetSpec(const nsACString& aSpec) { if (NS_FAILED(mStatus)) { return *this; } mStatus = mMutator->SetSpec(aSpec, nullptr); +#if DEBUG + if (NS_FAILED(mStatus)) { + char *l_data; + char l_string[256]; + int len = aSpec.Length(); + int upper = len > 255 ? 255: len; + l_data = ToNewCString(aSpec); + bcopy(l_data, l_string, upper); + l_string[upper] = '\0'; + + fprintf(stderr,"{debug} SetSpec %s : aSpec=%s\n", NS_FAILED(mStatus) ? "failed." : "succeeded.", l_string); + } +#endif return *this; } NS_MutateURI& SetScheme(const nsACString& aScheme) { if (NS_FAILED(mStatus)) { return *this; } mStatus = mMutator->SetScheme(aScheme, nullptr); ```