locked
[Bug] AppVerifier chokes on JavaScript regexp RRS feed

  • Question

  • This code

    suggestion = /^(\w+):(.+)/.exec(element.tag);

    is perfectly legal JS and runs well in our app. However the appcert.exe is complaining about possible errors in the JS file. Wrapping the regex in this code

    new RegExp("^(\\w+):(.+)").exec(element.tag);

    lets the code pass in appcert.

    I would like the error message to be more descriptive what exactly the appverifier has found that he thinks is invalid JS code. And I always have to smile to its serious solution to the problem being: "Exclude the file from the project". Uhmm yeah and what about the functionality it provides to the app?!

    • Moved by Jesse_F Friday, June 15, 2012 2:28 PM coding question (From:Windows Store: Publishing Metro Style apps for Windows 8)
    Friday, June 15, 2012 7:45 AM

Answers

  • I have filed a bug for this Phil!


    Jeff Sanders (MSFT)

    Tuesday, June 19, 2012 5:46 PM
    Moderator
  • Hi Sebastian,

    Please list exactly what you issue is.  There are many issues referenced in this post.

    Better yet, start a new thread and specify exactly what you are doing and the error.

    -Jeff


    Jeff Sanders (MSFT)

    Tuesday, January 29, 2013 3:10 PM
    Moderator

All replies

  • I have filed a bug for this Phil!


    Jeff Sanders (MSFT)

    Tuesday, June 19, 2012 5:46 PM
    Moderator
  • Thanks Jeff. Is there a way for us to file such bugs too (connect) ?
    Tuesday, June 19, 2012 5:48 PM
  • Hi Phil,

    Can you look at the final report generated by the Windows App Certification Kit and tell me the exact error reported by the test?

    Thanks,
    Salil Bapat (MSFT)

    Tuesday, June 19, 2012 6:44 PM
  • Its just a generic error that says:

    "File xxx has JavaScript syntax or other problems"

    It would be really nice to see a line and column mentioned here :) Thanks

    Tuesday, June 19, 2012 7:09 PM
  • Hi Phil,

    I'm looking into the issue you reported and have not been able to reproduce the bytecode failure with the regular expression you provided above using the VS Blank Template default.js's onactivated handler.

    I was wondering if you could provide some details from the event log as follows:

    1. Win+R to run "eventvwr"

    2. Navigate down the following path: "Applications and Services Logs -> Microsoft -> Windows -> AppXDeployment-Server -> Microsoft-Windows-AppXDeploymentServer/Operational"

    3. There should be an Event ID with the value 548

    4. In the "General" view there should be a string similar to "0x0 Failed to generate bytecode for <file> in package <package>. Skipping bytecode generation for this file." 

    Can you reply with the hex value at the beginning of the string?

    Thanks,

    Nick Eubanks (MSFT)

    Wednesday, June 20, 2012 12:28 AM
  • Thank Nick,

    I was able to find some errors in the event log, but not the 548. I try to reproduce it.

    However, I am currently unable to start the verifier after package creation. It always fails with "Verification canceled" error. No matter what, reboot, rebuild, clean.

    Wednesday, June 20, 2012 10:34 AM
  • Thanks Phil, if you come across the failure again in that test you can also reply here with the line containing the error code in the bytecodegenerationcheck log file found here:

    "C:\Users\<user>\AppData\Local\Microsoft\AppCertKit\post_process_trace_BytecodeGenerationCheck_<time of run>.txt"

    That should contain the same information as in the event log but is overwritten each time you launch the appcertkit.

    I'm not sure why the verifier isn't starting for you after creation, is that trying to run it from Visual Studio? You can also try launching it stand-alone by searching for Windows App Cert Kit from the Start screen.

    Nick Eubanks (MSFT)


    Nick Eubanks (MSFT)

    Wednesday, June 20, 2012 5:42 PM
  • You know, Nick, one of my colleagues tried it out again yesterday an the very same regex now passes the cert process. I have no idea what was wrong with it before, but it was reproducible.

    Another, related bug, is that for some files from the datajs globalization library, the cert complains about invalid JS at the very last line and char of some l18n files included in that library. The content of the file at that position is the end of a multiline comment " */". Removing the comment from the files allows the files to pass cert. Maybe you can check whats wrong with the appverifier parser?

    Thats one of the files, that failed:
    http://code.google.com/p/datejs/source/browse/trunk/src/globalization/es-VE.js

    Thursday, June 21, 2012 9:06 AM
  • This issue is coming and going randomly.

    • File \\?\C:\Program Files\WindowsApps\app.app_1.0.0.25_x86__exsyrgwabam6t\lib\datejs\globalization\sw-KE.js has JavaScript syntax or other problems.
    • File \\?\C:\Program Files\WindowsApps\app.app_1.0.0.25_x86__exsyrgwabam6t\lib\datejs\globalization\nl-BE.js has JavaScript syntax or other problems.
    • File \\?\C:\Program Files\WindowsApps\app.app_1.0.0.25_x86__exsyrgwabam6t\lib\datejs\globalization\mt-MT.js has JavaScript syntax or other problems.
    • File \\?\C:\Program Files\WindowsApps\app.app_1.0.0.25_x86__exsyrgwabam6t\lib\datejs\globalization\et-EE.js has JavaScript syntax or other problems.
    • File \\?\C:\Program Files\WindowsApps\app.app_1.0.0.25_x86__exsyrgwabam6t\lib\datejs\globalization\es-VE.js has JavaScript syntax or other problems.
    • File \\?\C:\Program Files\WindowsApps\app.app_1.0.0.25_x86__exsyrgwabam6t\lib\datejs\globalization\es-Latn-AZ.js has JavaScript syntax or other problems.

    The same validation was ok, when run for the x64 build with the same set of files in the package. The parser seems to have a serious issue with multiline comments.

    Friday, June 22, 2012 1:46 PM
  • Phil,

    Could you contact me offline?  If we can get the project and try and repro in-house we could nail this quicker!

    -Jeff


    Jeff Sanders (MSFT)

    Friday, June 22, 2012 1:49 PM
    Moderator
  • When you say coming and going randomly, do you mean running the app cert kit on the same package and getting different results each time? If that's the case it would be very helpful to get a copy to take a look at what's going on as Jeff mentioned. I'll take a look at the globalization files available at the link you provided today to see if I can repro what you're seeing.

    -Nick


    Nick Eubanks (MSFT)

    Friday, June 22, 2012 5:00 PM
  • Hey Phil, so I loaded some of these files into an empty project to check out what was going on. Turns out that the files that failed the bytecode generation test just don't have a byte order mark (signature) which should also show up as a failure in the File Encoding test in the app cert kit.

    Fortunately, this one has an extremely simple fix in Visual Studio:

    • Load the file in VS and from the File menu select "Advanced Save Options..."
    • Then from the drop down select: "Unicode (UTF-8 with signature) - Codepage 65001" (make sure it's the one with signature)
    • Then press OK, rebuild the project and you should be good to go.


    Nick Eubanks (MSFT)

    Monday, June 25, 2012 10:53 PM
  • Nick, sorry for the confusion. The WACK errors also showed up when the files all had the BOM already. I will post the result XML later, when we rerun the WACK.
    Monday, June 25, 2012 10:55 PM
  • I'm facing an issue just like this one when running AppCertKit.

    Same app was package with no problrms before. I know for a fact that the encoding in every file is fine...

    Looking forward for a solution here


    http://bit.ly/sebagomez

    Tuesday, January 29, 2013 1:13 PM
  • Hi Sebastian,

    Please list exactly what you issue is.  There are many issues referenced in this post.

    Better yet, start a new thread and specify exactly what you are doing and the error.

    -Jeff


    Jeff Sanders (MSFT)

    Tuesday, January 29, 2013 3:10 PM
    Moderator