Issue 73691 - aquavcl01-> calc does instant crashes in some situations
Summary: aquavcl01-> calc does instant crashes in some situations
Status: CLOSED FIXED
Alias: None
Product: porting
Classification: Code
Component: MacOSX (show other issues)
Version: 680m196
Hardware: All Mac OS X, all
: P3 Trivial (vote)
Target Milestone: OOo 2.3
Assignee: eric.bachard
QA Contact: issues@porting
URL:
Keywords: aqua
Depends on:
Blocks: 74396
  Show dependency tree
 
Reported: 2007-01-20 21:57 UTC by eric.bachard
Modified: 2007-07-09 22:28 UTC (History)
3 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
patch to add in Ismael patches for bitmaps (437 bytes, patch)
2007-01-28 16:24 UTC, eric.bachard
no flags Details | Diff
patch to verify the cause of Calc crashes (526 bytes, patch)
2007-01-28 22:19 UTC, eric.bachard
no flags Details | Diff
No more crashes with Calc after dividing the sheet in 4 parts (226.04 KB, image/jpeg)
2007-02-18 23:22 UTC, eric.bachard
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description eric.bachard 2007-01-20 21:57:07 UTC
This issue is one of 10 most important issues to fix before first public release of native ( Aqua , without 
X11) version of OpenOffice.org on Mac OS X

To be fixed :  calc does not work at all. 

To do : identify the reason, and fix it
Comment 1 pavel 2007-01-20 22:29:32 UTC
Please provide example stack from gdb.
Comment 2 shaunmcdonald131 2007-01-20 22:50:40 UTC
Confirmed. Aqua menus enabled via environment variable. Started from Terminal.

From the crash report:
Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0x199ffffc

Thread 0 Crashed:
0   <<00000000>> 	0xffff0b3c __memcpy + 924 (cpu_capabilities.h:228)
1   libvcl680mxi.dylib             	0x0122f21b AquaSalBitmap::Create(unsigned
long, unsigned long, unsigned short, unsigned long, unsigned char*, unsigned
long, unsigned long, unsigned long, unsigned long) + 145
2   libvcl680mxi.dylib             	0x0122f2d5 AquaSalBitmap::Create(CGContext*,
int, int, int, int) + 131
3   libvcl680mxi.dylib             	0x0122b845 AquaSalGraphics::getBitmap(long,
long, long, long) + 93
4   libvcl680mxi.dylib             	0x0122b699
AquaSalGraphics::copyBits(SalTwoRect const*, SalGraphics*) + 55
5   libvcl680mxi.dylib             	0x0112bec5 SalGraphics::CopyBits(SalTwoRect
const*, SalGraphics*, OutputDevice const*, OutputDevice const*) + 51
6   libvcl680mxi.dylib             	0x01095080
OutputDevice::ImplDrawOutDevDirect(OutputDevice const*, void*) + 432
7   libvcl680mxi.dylib             	0x0109c141 OutputDevice::DrawOutDev(Point
const&, Size const&, Point const&, Size const&, OutputDevice const&) + 893
8   libsvx680mxi.dylib             	0x21729d94
sdr::overlay::OverlayManagerBuffered::ImpBufferTimerHandler(AutoTimer*) + 834
9   libvcl680mxi.dylib             	0x01018bfe Timer::Timeout() + 28
10  libvcl680mxi.dylib             	0x01018dc2 Timer::ImplTimerCallbackProc() + 112
11  libvcl680mxi.dylib             	0x01223af8
HandleOOoSalTimerEvent(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 88
12  com.apple.HIToolbox            	0x92f017eb
DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1093
13  com.apple.HIToolbox            	0x92f00e90
SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*,
HandlerCallRec*) + 304
14  com.apple.HIToolbox            	0x92f00d55 SendEventToEventTargetWithOptions
+ 55
15  com.apple.HIToolbox            	0x92f0825d
ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*,
void*) + 357
16  com.apple.HIToolbox            	0x92f01ba2
DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 2044
17  com.apple.HIToolbox            	0x92f00e90
SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*,
HandlerCallRec*) + 304
18  com.apple.HIToolbox            	0x92f080f0 SendEventToEventTarget + 56
19  libvcl680mxi.dylib             	0x0122ffff AquaSalInstance::Yield(bool,
bool) + 121
20  libvcl680mxi.dylib             	0x01224c2a
HandleWindowBoundsChangedEvent(OpaqueEventHandlerCallRef*, OpaqueEventRef*,
void*) + 96
21  com.apple.HIToolbox            	0x92f017eb
DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1093
22  com.apple.HIToolbox            	0x92f00e90
SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*,
HandlerCallRec*) + 304
23  com.apple.HIToolbox            	0x92f00d55 SendEventToEventTargetWithOptions
+ 55



From the terminal output:
>*>_> GetKeyName
>*>_> SetAccelerator
>*>_> SetItemImage
>*>_> SetItemImage
>*>_> SetItemImage
>*>_> SetItemImage
>*>_> SetItemImage
>*>_> GetKeyName
>*>_> SetAccelerator
>*>_> DrawMenuBar
Control type is : 100
Control part is : 1
Control type is : 100
Control part is : 1
>*>_> PostEvent
Control type is : 100
Control part is : 1
Control type is : 100
Control part is : 1
To return: 0
Bounds changed event
shaun-mcdonalds-computer:~/Applications/OpenOffice.org 2.1.app/Contents/MacOS
shaunmcdonald$ 
Comment 3 pavel 2007-01-21 19:05:20 UTC
This bug is probably for Ismael...
Comment 4 eric.bachard 2007-01-22 11:42:27 UTC
Setting keyword
Comment 5 eric.bachard 2007-01-26 20:41:25 UTC
ericb->isma87 

Calc works on m200 + aquavcl01 without bitmaps changes. 

I'll apply them and I'll try to see where/what causes the instant crashes
Comment 6 eric.bachard 2007-01-28 13:21:54 UTC
Ismael advised me to add if (!some_Context ) inside AquaSalBitmap:::Create() 
And I now can use Calc without crash, using native menus and masked bitmaps.

The issues is caused by NULL context is passed by reference in another function.

The solution should IMHO consist in find the caller(s) and protect the call to AquaSalBitmap:::Create
(CGContextRef xContext, int nX, int nY, int nWidth, int nHeight) when NULL context is passes by 
reference 

ericb->isma87

I'll attach my changes, but this is issue is for you. ( I just need a fix for Solutions Linux Expo )
Comment 7 eric.bachard 2007-01-28 16:24:16 UTC
Created attachment 42524 [details]
patch to add in Ismael patches for bitmaps
Comment 8 eric.bachard 2007-01-28 16:26:02 UTC
Just verify mrBitmapContext is not NULL seems to fix a lot of problems
Comment 9 eric.bachard 2007-01-28 22:18:15 UTC
Please forget the previous patch, completely wrong

Investigating more (using gdb) , it appears copyBits() returns negative values for bitmaps dimensions.

So as uggly workaround, I have tested nDX and nDY signs, and it works. No idea why negative values are 
returned. To be continued

Please test the attached patch, to confirm/verify this is really nDX and nDY values causing the crash

Comment 10 eric.bachard 2007-01-28 22:19:29 UTC
Created attachment 42531 [details]
patch to verify the cause of Calc crashes
Comment 11 shaunmcdonald131 2007-02-10 10:34:56 UTC
Adding to Meta Issue.
Comment 12 ismaelooo 2007-02-18 20:42:14 UTC
patch committed
Issue marked as fixed
Comment 13 eric.bachard 2007-02-18 23:20:56 UTC
ericb->isma87

Issue verified fixed for me :  all the crashes I experimented with Calc do not occur anymore.

- Calc can now be used even with native menus
- I can divide the sheet in 4 areas, and I don't see crashes like before ( I'll attach a screenshot )

Thank you very much Ismael !
Comment 14 eric.bachard 2007-02-18 23:22:52 UTC
Created attachment 43141 [details]
No more crashes with Calc after dividing the sheet in 4 parts
Comment 15 pavel 2007-06-28 11:05:57 UTC
Set target to 2.3.
Comment 16 eric.bachard 2007-07-09 22:28:58 UTC
Tested with SRC680_m220

Calc sheet /  dividing in 4 parts + trace diagrams .. etc

No more crashes,  as expected  -> closing