JSFL importPublishProfileString() crashes Animate

New Here ,
Dec 17, 2020 Dec 17, 2020

Copy link to clipboard

Copied

Operating System: Apple macOS (Mojave and Catalina)

Animate Version: CC 18.0.1 / 20.0.1 / 20.0.2 / 21.0.1

 

I've been working on updating an old Flash extension our Art team uses to run smoothly on Animate CC, and most things are working pretty well now except for the export functions -- they all cause Animate to crash with a Segmentation Fault (not graceful).

 

After some digging I found it was crashing on any of these calls:

fl.getDocumentDOM().importPublishProfileString(...)

 I figured maybe the old XML strings has settings that no longer applied, so I exported the current publish profile to check it out:

fl.getDocumentDOM().exportPublishProfileString()

 

I know I can make edits either using the XML class or via regular expression string replacements, so I decided to just perform updates on the exported string -- but the segfaults continued.

 

Finally I tried just importing the default exported profile:

fl.getDocumentDOM().importPublishProfileString( fl.getDocumentDOM().exportPublishProfileString() );

 ...and even that segfaulted.

 

After some experimentation I found that I can call importPublishProfileString() with an empty string and no crash occurs. I can even call it with an invalid string and no crash happens.

 

It only crashes with a valid profile string... even a totally empty (but valid) profile string:

fl.getDocumentDOM().importPublishProfileString('<flash_profile version="1.0" name="Default"></flash_profile>');

 

It's hard to believe such a basic function is broken, but it's been tested on two versions of macOS and four different Animate versions now across a number of the team's machines.

 

At this point I'm at a loss on how to proceed, so any suggestions would be appreciated!

 

For reference, here's the relevant portion of the stack trace.

It appears to be crashing trying to update the UI after applying a valid profile:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.adobe.Adobe-Animate-2021.application	0x00000001008bef24 drover::PropertyInspector::UpdateInspector() + 788
1   com.adobe.Adobe-Animate-2021.application	0x00000001004bb182 exo::messaging::Broadcaster<fladocmodel::messaging::MovieTargetChangedMessage const&>::BroadcastMessage(fladocmodel::messaging::MovieTargetChangedMessage const&) + 98
2   com.adobe.Adobe-Animate-2021.application	0x00000001017b04ea CPubSwfProperties::Save() + 2682
3   com.adobe.Adobe-Animate-2021.application	0x00000001017cd7f8 CPublishProfile::Save() + 72
4   com.adobe.Adobe-Animate-2021.application	0x00000001017d47c0 ProfileElementHandler::EndElement(std::__1::basic_string<unsigned short, std::__1::char_traits<unsigned short>, dvacore::allocator::SBAAllocator<unsigned short> > const&) + 1008
5   com.adobe.Adobe-Animate-2021.application	0x00000001017d3279 ProfilesParserHandler::EndElement(std::__1::basic_string<unsigned short, std::__1::char_traits<unsigned short>, dvacore::allocator::SBAAllocator<unsigned short> > const&) + 25
6   com.adobe.Adobe-Animate-2021.application	0x0000000100010f3e dvacore::xml::LibXML2ParseHandler::endElementWithNamespace(void*, unsigned char const*, unsigned char const*, unsigned char const*) + 1118
7   libxml2.2.dylib               	0x00007fff6ab06730 xmlParseEndTag2 + 872
8   libxml2.2.dylib               	0x00007fff6ab13e06 xmlParseElement + 803
9   libxml2.2.dylib               	0x00007fff6ab1392e xmlParseDocument + 973
10  com.adobe.Adobe-Animate-2021.application	0x000000010000e9b0 dvacore::xml::LibXML2ParseHandler::ParseBuffer(std::__1::basic_string<unsigned char, std::__1::char_traits<unsigned char>, dvacore::allocator::SBAAllocator<unsigned char> > const&) + 1056
11  com.adobe.Adobe-Animate-2021.application	0x00000001017ce49d CPublishProfile::LoadFromXMLString(CSketchDoc*, CString const&) + 125
12  com.adobe.Adobe-Animate-2021.application	0x0000000101e7d363 JSObjDocument::importPublishProfileString(JSContext*, JSObject*, unsigned int, long*, long*) + 515
13  com.adobe.Adobe-Animate-2021.application	0x000000010207f1de js_Invoke + 1726
14  com.adobe.Adobe-Animate-2021.application	0x00000001020793f6 js_Interpret + 27574
15  com.adobe.Adobe-Animate-2021.application	0x000000010207f8f9 js_Execute + 665
16  com.adobe.Adobe-Animate-2021.application	0x000000010204cd37 JS_EvaluateUCScriptForPrincipals + 87
17  com.adobe.Adobe-Animate-2021.application	0x000000010204ccce JS_EvaluateUCScript + 30
18  com.adobe.Adobe-Animate-2021.application	0x0000000101dd7010 JSInterp::EvaluateScript(JSContext*, JSObject*, unsigned short const*, unsigned int, unsigned short const*, unsigned int, long*) + 832

 

TOPICS
Code, Error, Import and export, Other, Product issue

Views

78

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 17, 2020 Dec 17, 2020

Copy link to clipboard

Copied

After some more experimentation, I have an update to this.

importPublishProfileString() -only- crashes after (via JSFL) creating a new document, switching to it, and making some modifications before importing a profile -- e.g.

var newDoc = fl.createDocument();
fl.setActiveWindow(newDoc);

// perform some newDoc edits
newDoc.addItem({x:0,y:0}, avatarToExport.avatar);
...etc... draw some lines, create and delete some elements...

fl.getDocumentDOM().importPublishProfileString(...);

 

If the importPublishProfileString() call is made AFTER switching to the new document but BEFORE making an edits, the crash does not occur.

 

So my problem is solved (yay!) but there's definitely still a big bug there to be causing a segfault.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines