axr / core

The AXR core library
axrproject.org
GNU General Public License v3.0
93 stars 15 forks source link

OS X prototype app rendering is broken #100

Closed jakepetroules closed 12 years ago

jakepetroules commented 12 years ago

The prototype app will not render HSS; only a blank screen is displayed. Additionally, if a simple XML file is loaded, the app will crash. Stack trace below:

Stack trace

This seems to have something to do with GLib but linking to it seems to have little effect. I observed this issue I think immediately after converting the app to CMake. Also note that the prototype app given to me by @veosotano linked to more libraries than our current app does, so this issue may be related to that...

Here's the otool -L output of the app given to me by @veosotano:

/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 15.0.0)
@executable_path/../Resources/libcairo.2.dylib (compatibility version 11003.0.0, current version 11003.2.0)
/usr/local/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 7.2.0)
@executable_path/../Resources/libgobject-2.0.0.dylib (compatibility version 3001.0.0, current version 3001.2.0)
@executable_path/../Resources/libpango-1.0.0.dylib (compatibility version 2801.0.0, current version 2801.4.0)
@executable_path/../Resources/libpangocairo-1.0.0.dylib (compatibility version 2801.0.0, current version 2801.4.0)
@executable_path/../Resources/libpixman-1.0.dylib (compatibility version 21.0.0, current version 21.2.0)
@executable_path/../Resources/libiconv.2.dylib (compatibility version 8.0.0, current version 8.1.0)
@executable_path/../Resources/libgthread-2.0.0.dylib (compatibility version 3001.0.0, current version 3001.2.0)
@executable_path/../Resources/libintl.8.dylib (compatibility version 10.0.0, current version 10.0.0)
@executable_path/../Resources/libglib-2.0.0.dylib (compatibility version 3001.0.0, current version 3001.2.0)
@executable_path/../Resources/libgmodule-2.0.0.dylib (compatibility version 3001.0.0, current version 3001.2.0)
@executable_path/../Resources/libffi.5.dylib (compatibility version 6.0.0, current version 6.10.0)
@executable_path/../Resources/libpangoft2-1.0.0.dylib (compatibility version 2801.0.0, current version 2801.4.0)
@executable_path/../Resources/libpng15.15.dylib (compatibility version 18.0.0, current version 18.0.0)
@executable_path/../Resources/libboost_thread-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 832.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.29.0)
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 38.0.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 751.29.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1038.32.0)

and the current otool -L output:

/Developer/Builds/AXRPrototype/lib/Debug/libAXR_core.dylib (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 19.0.0)
/usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 7.2.0)
/opt/local/lib/libglib-2.0.0.dylib (compatibility version 3201.0.0, current version 3201.4.0)
/opt/local/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.1.0)
/opt/local/lib/libcairo.2.dylib (compatibility version 11107.0.0, current version 11107.0.0)
/opt/local/lib/libpango-1.0.0.dylib (compatibility version 3001.0.0, current version 3001.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
/opt/local/lib/libgobject-2.0.0.dylib (compatibility version 3201.0.0, current version 3201.4.0)
/opt/local/lib/libpangocairo-1.0.0.dylib (compatibility version 3001.0.0, current version 3001.0.0)
/opt/local/lib/libpangoft2-1.0.0.dylib (compatibility version 3001.0.0, current version 3001.0.0)
/opt/local/lib/libfreetype.6.dylib (compatibility version 16.0.0, current version 16.0.0)
/opt/local/lib/libfontconfig.1.dylib (compatibility version 7.0.0, current version 7.0.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 945.0.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1669.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 744.0.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1186.0.0)

An overview of the differences:

After this, the old version links to the following libraries that the new one does not:

And the new version links to the following libraries that the old one does not:

The files I was testing with are the following:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet src="index.hss" type="application/x-hss" version="1.0"?>
<root>
    <button>Click me</button>
</root>

and

#import UIFramework;

*
{
    padding: 5;

    button
    {
        isA: UIButton;
    }

    #new box
    {
        background: @linearGradient
        {
            startColor: #f00;
            endColor: #a00;
            endY: 100%;
        };

        width: 90%;
        height: ref(width) / (16 / 9);
        alignX: center;
        alignY: middle;

        // or @roundedRect (it's the default)
        shape: @
        {
            left: 10;
            right: 20;
        };
    }
}

Loading the XML file will crash; loading the HSS file displays a blank white screen. @veosotano's app works loading either file (the button is only displayed if the XML file is loaded, which makes sense of course).

jakepetroules commented 12 years ago

Apparently something is wrong with ref() as my text file now works with the height changed to a plain integer. XML file loading is still broken.

jakepetroules commented 12 years ago

I don't know why this issue was re-opened. The XML loading was due to bad -devel packages from MacPorts and @veosotano later fixed ref(). Closing again.