#13 plist writing fails

closed-fixed
Sherm Pendley
None
5
2010-12-14
2010-10-14
Anonymous
No

If you run the following on SnowLeopard using perl 5.8.9 it works fine. If you uncomment the second dictionary element, it hangs for a long time and then fails with a memory error.

#!/usr/bin/perl5.8.9

use CamelBones;

$dict = {
'items' => [
{
'assets' => [
{
#'kind' => 'software-package',
'url' => 'some url'
}
],
'metadata' => {
}
}
]
};

my $plist = NSDictionary->dictionaryWithDictionary($dict);
$plist->writeToFile_atomically_('manifest.plist', 1);

Discussion

  • Sherm Pendley
    Sherm Pendley
    2010-10-14

    • assigned_to: nobody --> shermpendley
    • status: open --> open-accepted
     
  • Sherm Pendley
    Sherm Pendley
    2010-10-14

    I've verified the behavior on my own machine, and have a suspect in mind. You've also identified a weak spot in the self-tests - correct behavior for toll-free bridged collections when such collections are empty isn't checked for.

     
  • Sherm Pendley
    Sherm Pendley
    2010-10-17

    This is a bizarre bug. In my testing, a number of changes to the above structure will avoid the crash in writeToFile_atomically() - removing the 'assets' array, removing an item from the hash in 'assets', adding one to it. Adding or removing items from 'assets' seems to make no difference; if any of the hash items in that array have two (and *only* two - not one, or three) items, the crash happens.

     
  • Sherm Pendley
    Sherm Pendley
    2010-11-28

    Fixed in 1.1.2 - please download & verify, then I'll close this.

     
  • Sherm Pendley
    Sherm Pendley
    2010-11-28

    • status: open-accepted --> open-fixed
     
  • Sherm Pendley
    Sherm Pendley
    2010-12-14

    OK, it's been two weeks and no one has raised any objections, so I'm closing this.

     
  • Sherm Pendley
    Sherm Pendley
    2010-12-14

    • status: open-fixed --> closed-fixed