1

在这方面遇到了一些麻烦,想知道更多地关注这个问题是否会有所帮助。

这是适用于 Windows/Mac 的独立 Air 应用程序

更新:我可以让发布版本真正排序而不是崩溃!如果我添加编译器标志(-optimize=false),它会按预期工作。现在这是一个临时修复,因为我希望编译器优化和减小最终二进制文件的大小。这些新信息是否会给任何人一些想法?

我有一个火花数据网格,显示大约 250 个条目,每 30 秒从返回 XML 的 PHP 脚本更新一次。它在调试模式下和从 Flash Builder 中简单地运行时按预期工作,但在尝试按导出的发布版本中的任何列排序时会立即崩溃(它正确显示列表,唯一的变化是排序时崩溃)。

在 Windows 上,它不显示任何错误消息,并且看起来它只是在尝试对列进行排序时立即对用户关闭。在 Mac OS X 上,它会显示一条冗长的错误消息,但这可能是重要的部分:

Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x000000000be2c001

似乎正试图从我所知道的情况下访问坏内存。我无法在 Flash Builder 中发生此错误,我一直在寻找一种在 Flash Builder 中运行优化/发布版本的方法,但没有成功。

我真的很感激任何关于为什么会发生这种情况的指示或想法!

弹性版本:4.6.0

Air 版本(在 Application.xml 中设置):3.1

更新:如果尝试对空数据网格进行排序,应用程序仍然会崩溃

如果有帮助,这里是定义数据网格的代码片段

    <s:DataGrid id="watchsheetDataGrid" width="100%" height="100%" fontFamily="Verdana" fontSize="14" textAlign="center" dataProvider="{watchlistData}">
        <s:columns>
            <s:ArrayList>
                <s:GridColumn dataField="symbol" headerText="Symbol" width="70"></s:GridColumn>
                <s:GridColumn dataField="underlyingPrice" headerText="Underlying Price" width="130"></s:GridColumn>
                <s:GridColumn dataField="strikePrice" headerText="Strike" width="70"></s:GridColumn>
                <s:GridColumn dataField="optionBid" headerText="Option Bid" width="100"></s:GridColumn>
                <s:GridColumn dataField="type" headerText="Type" width="70"></s:GridColumn>
                <s:GridColumn dataField="quantity" headerText="Count" width="70"></s:GridColumn>
                <s:GridColumn dataField="expiry" headerText="Expiry" width="120" labelFunction="dateLabelFunction"></s:GridColumn>
                <s:GridColumn dataField="negativeTime" headerText="Negative Time" labelFunction="negativeTimeLabelFunction"></s:GridColumn>
                <s:GridColumn dataField="inTheMoney" headerText="In The Money" labelFunction="ITMLabelFunction"></s:GridColumn>
                <s:GridColumn dataField="daysLeft" headerText="Days Left"></s:GridColumn>
                <s:GridColumn dataField="burnRate" headerText="Burn Rate" labelFunction="BurnRateLabelFunction"></s:GridColumn>
                <s:GridColumn dataField="percentOOM" headerText="% Out of $"></s:GridColumn>
                <s:GridColumn dataField="roreScore" headerText="RORE" labelFunction="RORELabelFunction"></s:GridColumn>
                <s:GridColumn dataField="adjustedRoreScore" headerText="Adj. RORE" labelFunction="AdjRORELabelFunction"></s:GridColumn>
            </s:ArrayList>
        </s:columns>
    </s:DataGrid>

这里是我创建监视列表数据的地方(数据网格中显示的数据)(RefreshData 方法是一种根据其他值在数学上更新值的方法):

        private function CreateWatchlistData():void
        {
            watchlistData.removeAll();

            latestUpdateTime = new Date();
            for(var i:int = 0; i < watchlistRequest.lastResult.positions.position.length; i++)
            {
                var newItem:WatchlistRowItem = new WatchlistRowItem();
                newItem.expiry = watchlistRequest.lastResult.positions.position[i].expiry;
                newItem.percentMV = watchlistRequest.lastResult.positions.position[i].percentMV;
                newItem.price = watchlistRequest.lastResult.positions.position[i].price;
                newItem.quantity = watchlistRequest.lastResult.positions.position[i].quantity;
                newItem.strikePrice = watchlistRequest.lastResult.positions.position[i].strikePrice;
                newItem.symbol = watchlistRequest.lastResult.positions.position[i].symbol;
                newItem.type = watchlistRequest.lastResult.positions.position[i].type;
                newItem.value = watchlistRequest.lastResult.positions.position[i].value;
                newItem.underlyingPrice = watchlistRequest.lastResult.positions.position[i].underlyingPrice;
                newItem.optionBid = Number(watchlistRequest.lastResult.positions.position[i].optionBid);
                newItem.RefreshData();
                watchlistData.addItem(newItem);
            }       
        }

这里还有一些错误:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.adobe.AIR
0x03344ab7 0x3000000 + 3426999
1 com.adobe.AIR
0x03344b78 0x3000000 + 3427192
2 com.adobe.AIR
0x03348c41 0x3000000 + 3443777
3 com.adobe.AIR
0x0334a670 0x3000000 + 3450480
4 com.adobe.AIR
0x0311c50d 0x3000000 + 1164557
5 com.adobe.AIR
0x03122749 0x3000000 + 1189705
6 com.adobe.AIR
0x03108974 0x3000000 + 1083764
7 com.apple.Foundation
0x91185d92 __57-[NSNotificationCenter
addObserver:selector:name:object:]_block_invoke_0 + 49
8 com.apple.CoreFoundation
0x98087481
___CFXNotificationPost_block_invoke_0 + 257
9 com.apple.CoreFoundation
0x97fd2b5a _CFXNotificationPost + 2794
10 com.apple.Foundation
0x9116e8c8 -[NSNotificationCenter
postNotificationName:object:userInfo:] + 92
11 com.apple.Foundation
0x9117e667 -[NSNotificationCenter
postNotificationName:object:] + 55
12 com.apple.AppKit
0x93d52b69 -[NSApplication terminate:] + 2420
13 com.apple.Foundation
0x9119b10f __NSFireDelayedPerform + 413
14 com.apple.CoreFoundation
0x97fdd0d6
__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
15 com.apple.CoreFoundation
0x97fdca75 __CFRunLoopDoTimer + 709
16 com.apple.CoreFoundation
0x97fc1892 __CFRunLoopRun + 1730
17 com.apple.CoreFoundation
0x97fc0d6a CFRunLoopRunSpecific + 378
18 com.apple.CoreFoundation
0x97fc0bdb CFRunLoopRunInMode + 123
19 com.apple.HIToolbox
0x962e28aa RunCurrentEventLoopInMode + 242
20 com.apple.HIToolbox
0x962e2619 ReceiveNextEventCommon + 374
21 com.apple.HIToolbox
0x962e2494
BlockUntilNextEventMatchingListInMode + 88
22 com.apple.AppKit
0x93b29a5a _DPSNextEvent + 724
23 com.apple.AppKit
0x93b2928c -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] + 119
24 com.apple.AppKit
0x93b1f6dc -[NSApplication run] + 855
25 com.adobe.AIR
0x03008fca 0x3000000 + 36810
26 com.adobe.AIR
0x03009310 0x3000000 + 37648
27 libobjc.A.dylib
0x993ab5d3 -[NSObject performSelector:withObject:] +
70
28 com.thewinningpoints.optionsSoftware
0x00002f97 start + 2567
29 com.thewinningpoints.optionsSoftware
0x000025c5 start + 53
Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib
0x9933a9ae kevent + 10
1 libdispatch.dylib
0x95d9ecc5 _dispatch_mgr_invoke + 993
2 libdispatch.dylib
0x95d9e7fd _dispatch_mgr_thread + 53
Thread 2:: com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib
0x993377d2 mach_msg_trap + 10
1 libsystem_kernel.dylib
0x99336cb0 mach_msg + 68
2 com.apple.CoreFoundation
0x97fbbcc9 __CFRunLoopServiceMachPort + 185
3 com.apple.CoreFoundation
0x97fc16af __CFRunLoopRun + 1247
4 com.apple.CoreFoundation
0x97fc0d6a CFRunLoopRunSpecific + 378
5 com.apple.CoreFoundation
0x97fc0bdb CFRunLoopRunInMode + 123
6 com.apple.Foundation
0x9115c29a +[NSURLConnection(Loader)
_resourceLoadLoop:] + 395
7 com.apple.Foundation
0x911c0318 -[NSThread main] + 45
8 com.apple.Foundation
0x911c029b __NSThread__main__ + 1396
9 libsystem_c.dylib
0x99581557 _pthread_start + 344
10 libsystem_c.dylib
0x9956bcee thread_start + 34
Thread 3:: com.apple.CFSocket.private
0 libsystem_kernel.dylib
0x99339be6 __select + 10
1 com.apple.CoreFoundation
0x98005320 __CFSocketManager + 1632
2 libsystem_c.dylib
0x99581557 _pthread_start + 344
3 libsystem_c.dylib
0x9956bcee thread_start + 34
Thread 4:
0 libsystem_kernel.dylib
1 libsystem_c.dylib
2 libsystem_c.dylib
3 libsystem_c.dylib
Thread 5:
0 libsystem_kernel.dylib
1 libsystem_c.dylib
2 libsystem_c.dylib
3 libsystem_c.dylib
Thread 6:
0 libsystem_kernel.dylib
1 libsystem_c.dylib
2 libsystem_c.dylib
3 libsystem_c.dylib
Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x00000ec0 ebx: 0x03344a41 ecx: 0x0000cec0 edx: 0x0be2c000
edi: 0x0bc21f90 esi: 0x0be2cec0 ebp: 0xbfffdd98 esp: 0xbfffdd50
ss: 0x00000023 efl: 0x00010206 eip: 0x03344ab7 cs: 0x0000001b
ds: 0x00000023 es: 0x00000023 fs: 0x00000000 gs: 0x0000000f
cr2: 0x0be2c001
Logical CPU: 0
0x9933a0ee __workq_kernreturn + 10
0x9958404c _pthread_workq_return + 45
0x99583e19 _pthread_wqthread + 448
0x9956bcca start_wqthread + 30
0x9933a0ee __workq_kernreturn + 10
0x9958404c _pthread_workq_return + 45
0x99583e19 _pthread_wqthread + 448
0x9956bcca start_wqthread + 30
0x9933a0ee __workq_kernreturn + 10
0x9958404c _pthread_workq_return + 45
0x99583e19 _pthread_wqthread + 448
0x9956bcca start_wqthread + 30
4

0 回答 0