feedback-assistant / reports

Open collection of Apple Feedback Assistant reports
236 stars 2 forks source link

FB5743128: CFPropertyListCreateFromXMLData missing semicolon error when parsing arguments #297

Open ePirat opened 2 years ago

ePirat commented 2 years ago

Description

With specific command line arguments like:

./bin/vlc-osx-static --avcodec-options "{lowres=1}"

I get errors from AppKit NSUserDefaults:

2017-09-30 12:41:28.156 vlc-osx-static[9521:7055173] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 1. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.
2017-09-30 12:41:28.156 vlc-osx-static[9521:7055173] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 1. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.

This is especially problematic in Applications like VLC, which can be used from the command line or as app bundle. VLC parses the arguments fine, still I get this distracting errors on stderr, due to failure of NSUserDefaults to parse them correctly, which is not relevant for us or the user.

Ideally we would parse the arguments with VLC and do not even pass them to the NSApplication at all, but unfortunately:

NSApplicationMain itself ignores the argc and argv arguments. Instead, Cocoa gets its arguments indirectly via _NSGetArgv, _NSGetArgc, and _NSGetEnviron (see ).

Steps to Reproduce:

Start an application with arguments where one contains a string with "{foo=1}":

/Applications/Notes.app/Contents/MacOS/Notes --avcodec-options "{lowres=1}"

Expected Results:

The arguments should be parsed or ignored by NSUserDefaults

Actual Results:

Errors on stderr (see above).

ePirat commented 2 years ago

Relevant trace:

* thread #1: tid = 0xebad06, 0x00007fff9de4d400 CoreFoundation`_CFPropertyListMissingSemicolon, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x00007fff9de4d400 CoreFoundation`_CFPropertyListMissingSemicolon
CoreFoundation`_CFPropertyListMissingSemicolon:
->  0x7fff9de4d400 <+0>: pushq  %rbp
    0x7fff9de4d401 <+1>: movq   %rsp, %rbp
    0x7fff9de4d404 <+4>: movl   %edi, %ecx
    0x7fff9de4d406 <+6>: leaq   0x1ac9db73(%rip), %rsi    ; @"CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line %d. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug."
(lldb) bt
* thread #1: tid = 0xebad06, 0x00007fff9de4d400 CoreFoundation`_CFPropertyListMissingSemicolon, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #0: 0x00007fff9de4d400 CoreFoundation`_CFPropertyListMissingSemicolon
    frame #1: 0x00007fff9dcda5e2 CoreFoundation`parsePlistDictContent + 1794
    frame #2: 0x00007fff9dcd8f6d CoreFoundation`parsePlistObject + 429
    frame #3: 0x00007fff9dcd8b10 CoreFoundation`__CFCreateOldStylePropertyListOrStringsFile + 640
    frame #4: 0x00007fff9dca18ab CoreFoundation`_CFPropertyListCreateFromUTF8Data + 2715
    frame #5: 0x00007fff9dda4cfe CoreFoundation`_CFPropertyListCreateFromXMLStringError + 270
    frame #6: 0x00007fff9dda4ae0 CoreFoundation`_CFPropertyListCreateFromXMLString + 96
    frame #7: 0x00007fff9f6f90ac Foundation`-[NSUserDefaults(NSUserDefaults) init] + 827
    frame #8: 0x00007fff9f6f8d15 Foundation`+[NSUserDefaults(NSUserDefaults) standardUserDefaults] + 81
    frame #9: 0x00007fff9b803c9e AppKit`-[NSDocumentController init] + 256
    frame #10: 0x0000000103013b14 libmacosx_plugin.dylib`+[VLCDocumentController load](self=<unavailable>, _cmd=<unavailable>) + 36 at VLCDocumentController.m:30 [opt]