Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault when listing properties of mixins #128

Open
bergie opened this issue Nov 17, 2011 · 2 comments
Open

Segfault when listing properties of mixins #128

bergie opened this issue Nov 17, 2011 · 2 comments

Comments

@bergie
Copy link
Member

bergie commented Nov 17, 2011

With mixin:

<type name="mix_title"  metadata="false" abstract="mixin">
    <!-- JCR properties of mix:title type -->
    <property name="jcr-title" type="string">
        <RequiredType>STRING</RequiredType>
        <isAutoCreated>false</isAutoCreated>
        <isMandatory>false</isMandatory>
        <isProtected>false</isProtected>
        <isMultiple>false</isMultiple>
    </property>
    <property name="jcr-description" type="string">
    <RequiredType>STRING</RequiredType>
        <isAutoCreated>false</isAutoCreated>
        <isMandatory>false</isMandatory>
        <isProtected>false</isProtected>
        <isMultiple>false</isMultiple>
    </property>
    <!-- Node and NodeType definitions -->
    <user_values>
        <description>This mixin node type can be used to add standardized title and description properties to a node.</description>
        <Supertypes></Supertypes>
        <isMixin>true</isMixin>
        <PrimaryItemName></PrimaryItemName>
        <RequiredPrimaryTypes></RequiredPrimaryTypes>
        <DefaultPrimaryType></DefaultPrimaryType>
        <isAutoCreated>false</isAutoCreated>
        <isMandatory>false</isMandatory>
        <isProtected>false</isProtected>
        <SameNameSiblings>false</SameNameSiblings> 
    </user_values>
</type>

The following code:

<?php
$cfg = new midgard_config();
$cfg->read_file_at_path('/tmp/Midgard2CR/share/midgard2.conf');
$mgd = midgard_connection::get_instance();
$mgd->open_config($cfg);
midgard_reflector_object::list_defined_properties('mix_title');

causes a segfault:

$ php tmp.php 
Segmentation fault

Backtrace in http://friendpaste.com/422XTyQpaRsutWBkyYx5qn

@bergie
Copy link
Member Author

bergie commented Nov 17, 2011

For some reason mix:created doesn't cause such crash. It seems the difference may be that nt_hierarchyNode uses it as <Supertypes>mix:created</Supertypes>

@bergie
Copy link
Member Author

bergie commented Nov 17, 2011

Initial workaround is to create a type that extends the abstract type. In this case that would be something like:

<type name="Foo" extends="mix_title" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant