Issue 92388 - Application Frame crashes after closing of window
Summary: Application Frame crashes after closing of window
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: ui (show other issues)
Version: DEV300m28
Hardware: Mac Mac OS X, all
: P1 (highest) Trivial (vote)
Target Milestone: OOo 3.0
Assignee: thorsten.martens
QA Contact: issues@framework
URL:
Keywords: aqua, crash, release_blocker
Depends on:
Blocks: 88888 92548
  Show dependency tree
 
Reported: 2008-08-01 18:46 UTC by Loria
Modified: 2009-01-03 13:53 UTC (History)
9 users (show)

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


Attachments
Apple Report (30.67 KB, text/plain)
2008-08-01 18:51 UTC, Loria
no flags Details
stack with cppuhelper dbg (969 bytes, text/plain)
2008-08-18 16:33 UTC, hdu@apache.org
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Loria 2008-08-01 18:46:16 UTC
Procedure (german version)
a) new user (user never existed bevor)
b) starts oo
c) oo welcomes user .. 
d) user enters its name
e) user starts writer enters some arbitrary text with native symbols
f) user closes document
g) user does not save document
h) user tries to end application
j) application crashes.
(Applereport is attached)
Comment 1 Loria 2008-08-01 18:51:22 UTC
Created attachment 55499 [details]
Apple Report
Comment 2 Raphael Bircher 2008-08-04 16:03:18 UTC
Bug is a Crash so I set heigher priority
add Keywords: aqua
add generic user: macport
add myself: rbircher

Notice: This is a Tiger issue.
Comment 3 Mechtilde 2008-08-06 10:48:38 UTC
@ steinsuppe
can you confirm this?

you can commet it here
Comment 4 Mechtilde 2008-08-07 20:58:14 UTC
.
Comment 5 steinsuppe 2008-08-07 22:31:42 UTC
yes I confirm -- I can reproduce this crash with an ibook 1.2 GHz PPC G4, 1.25 GB RAM, Mac OS X 10.5.4 
(OOo-Version 300m28 Build 9337
Comment 6 maho.nakata 2008-08-08 02:30:04 UTC
Hi
I cannot confirm with OOO300_m1 japanese version on MacOSX Tiger PowerPC.
Comment 7 Martin Hollmichel 2008-08-08 08:55:16 UTC
reassign to maho
Comment 8 Martin Hollmichel 2008-08-08 08:55:40 UTC
reassign
Comment 9 Mechtilde 2008-08-12 20:38:22 UTC
@ maho
do you create a new user?
It only happens at first start of a new user 

It is also found in OOO300DEV_m2 German version
Comment 10 Loria 2008-08-12 20:59:05 UTC
I did some more digging and found a way to reproduce the crash as often as I wish.
procedure:
1. login as user a
2. start OO with that user
3. open up a document
4. switch to user b without logging user a off
5. start OO
6. open a document
7. close the document (no need to save, i used discard) with the closer button
8. close the application with the menu ("Quit")
-> application will crash instead of closing ... 
-> in one occasion the overall system has blocked ... (i assume a reboot with an open Terminal would 
have been possibile)
Comment 11 Mechtilde 2008-08-13 09:03:17 UTC
this also happens with Leopard 10.5 on Intel.

So all Mac versions are affected.
Comment 12 Martin Hollmichel 2008-08-18 14:07:44 UTC
reassign
Comment 13 hdu@apache.org 2008-08-18 16:33:55 UTC
Created attachment 55838 [details]
stack with cppuhelper dbg
Comment 14 hdu@apache.org 2008-08-18 16:39:29 UTC
@sb: is it normal that after during cleanup during exit() and cxa_finalize() fancy allocations need to be 
performed? Please see the attached stack. If it is normal then please suggest a place where to catch the 
resulting bad_alloc.
Comment 15 Stephan Bergmann 2008-08-19 07:52:25 UTC
@kr:  One more incarnation of issue 85084.  (For the probable cause of the
std::bad_alloc see <http://udk.openoffice.org/issues/show_bug.cgi?id=63473#desc3>.)
Comment 16 kay.ramme 2008-08-19 13:28:15 UTC
I am currently looking into this ... seems that the memory allocator does not
return any memory :-(
Comment 17 kay.ramme 2008-08-20 08:35:28 UTC
That is what I see reproducing the problem:

  :~ kayramme$  /Applications/OpenOffice.org.app/Contents/MacOS/soffice.bin
  terminate called after throwing an instance of 'std::bad_alloc'
    what():  St9bad_alloc
  sh: crash_report: command not found


Problems seems to be related to "quick" user switches and running OOo concurrently. A first instance keeps a second from terminating correctly, in 
case the second one had opened the last  document before A terminates.

To reproduce two users need to be logged in, e.g. user A and B.

Examples
What hangs / crashes:
- A: start OOo
- B: start OOo
- B: open a document
- B: close document
- B: quit OOo

- A: start OOo
- B: start OOo
- B: open a document
- B: close document
- A: quit OOo
- B: quit OOo

What works:
- A: start OOo
- B: start OOo
- A: quit OOo
- B: open a document
- B: close document
- B: quit OOo

- A: start OOo
- B: start OOo
- B: quit OOo
- A: quit OOo

Comment 18 kay.ramme 2008-08-20 08:37:15 UTC
.
Comment 19 kay.ramme 2008-08-21 08:33:47 UTC
This seems to be related to Matthias memory allocator, disabling it and using the system allocator solves this.

Comment 20 kay.ramme 2008-08-21 09:14:39 UTC
sal/rtl/source/alloc_global.c:rtl_memory_fini gets called to early -> std::bad_alloc

Memory needs to be the last thing in a process to get de-initialized.

Looking for ways to achieve this ... ;-)

Comment 21 kay.ramme 2008-08-21 09:52:31 UTC
Sorting the object files while linking SAL unfortunately does not help (neither alloc_global.o first nor last). Seems 
that the library unload/de-initialize order differs from expectations ...

Comment 22 kay.ramme 2008-08-25 10:29:59 UTC
Okay, it seems that in general d'tors registered with __attribute__((destructor)) get called _before_ d'tors 
of static C++ objects. Adding a C++ probe object to SAL calling rtl_memory_fini instead of using 
__attribute__((destructors)) cures the problem.

Mmmmhhh, if we used standard compliant C++ supporting that __cxa_atexit stuff, this shouldn't happen 
...

Comment 23 kay.ramme 2008-08-27 12:35:16 UTC
Fixed in hotmac :-)
Comment 24 kay.ramme 2008-08-27 12:38:52 UTC
.
Comment 25 eric.bachard 2008-08-27 13:26:18 UTC
@kr : thank you very much !
Comment 26 thorsten.martens 2008-08-27 15:39:13 UTC
checked and verified in cws hotmac -> OK !
Comment 27 Mechtilde 2009-01-03 13:53:59 UTC
reported as fixed -> closed