After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 74311 - crash on startup/background repaint
crash on startup/background repaint
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
unspecified
Other other
: Urgent critical
: 2.0.x
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 74449 74457 74526 74654 74668 74734 74785 74938 74979 75037 75683 75966 76173 78283 80790 81051 81229 82078 82437 82508 82705 82788 83031 83463 83471 83547 103697 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-03-12 03:56 UTC by jacob berkman
Modified: 2006-12-26 18:25 UTC
See Also:
GNOME target: Old
GNOME version: ---


Attachments
Backtrace with --sync (13.92 KB, text/plain)
2002-03-15 00:41 UTC, Owen Taylor
  Details
libbackground patch for gnome-settings-daemon to check for nautilus just before setting the pixmap (958 bytes, patch)
2002-05-31 17:52 UTC, Damon Chaplin
none Details | Review
Nautilus patch to realize the desktop window ASAP, so the settings daemon knows it is running (800 bytes, patch)
2002-05-31 18:12 UTC, Damon Chaplin
none Details | Review

Description jacob berkman 2002-03-12 03:56:58 UTC
Package: nautilus
Severity: normal
Version: 1.1.9
Synopsis: crash closing a window
Bugzilla-Product: nautilus
Bugzilla-Component: general
BugBuddy-GnomeVersion: 2.0 (1.112.1)

Description:
Description of Problem:
i logged in, and nautilus started to draw the desktop and popped up a
window list.

i closed the window list (it hadn't finished drawing / loading the
directory) and got the X error.




Debugging Information:

[New Thread 1024 (LWP 11223)]
[New Thread 2049 (LWP 11241)]
[New Thread 1026 (LWP 11242)]
[New Thread 2051 (LWP 11243)]
0x40955e29 in __wait4 () from /lib/libc.so.6

Thread 1 (Thread 1024 (LWP 11223))

  • #0 __wait4
    from /lib/libc.so.6
  • #1 __DTOR_END__
    from /lib/libc.so.6
  • #2 waitpid
    at wrapsyscall.c line 172
  • #3 libgnomeui_segv_handle
    at gnome-ui-init.c line 598
  • #4 pthread_sighandler
    at signals.c line 97
  • #5 <signal handler called>
  • #6 g_logv
    at gmessages.c line 551
  • #7 g_log
    at gmessages.c line 574
  • #8 gdk_x_error
    at gdkmain-x11.c line 780
  • #9 bonobo_x_error_handler
    at bonobo-ui-main.c line 49
  • #10 _XError
    from /usr/X11R6/lib/libX11.so.6
  • #11 _XReply
    from /usr/X11R6/lib/libX11.so.6
  • #12 XSync
    from /usr/X11R6/lib/libX11.so.6
  • #13 gdk_flush
    at gdkevents-x11.c line 1879
  • #14 gdk_window_process_all_updates
    at gdkwindow.c line 2150
  • #15 gtk_container_idle_sizer
    at gtkcontainer.c line 1004
  • #16 g_idle_dispatch
    at gmain.c line 3129
  • #17 g_main_dispatch
    at gmain.c line 1617
  • #18 g_main_context_dispatch
    at gmain.c line 2161
  • #19 g_main_context_iterate
    at gmain.c line 2242
  • #20 g_main_loop_run
    at gmain.c line 2462
  • #21 gtk_main
    at gtkmain.c line 915
  • #22 main
    at nautilus-main.c line 265
  • #23 __libc_start_main
    at ../sysdeps/generic/libc-start.c line 129
  • #0 __wait4
    from /lib/libc.so.6
  • #0 __wait4
    from /lib/libc.so.6
  • #1 __DTOR_END__
    from /lib/libc.so.6
  • #2 waitpid
    at wrapsyscall.c line 172
  • #3 libgnomeui_segv_handle
    at gnome-ui-init.c line 598
  • #4 pthread_sighandler
    at signals.c line 97
  • #5 <signal handler called>
  • #6 g_logv
  • #7 g_log
    at gmessages.c line 574




------- Bug moved to this database by unknown@bugzilla.gnome.org 2002-03-11 22:56 -------

Unknown version 1.1.x in product nautilus. Setting version to the default, "unspecified".
Reassigning to the default owner of the component, nautilus-maint@bugzilla.gnome.org.

Comment 1 Heath Harrelson 2002-03-13 03:53:38 UTC
There are a couple more of these from tonight.  Dups coming...
Comment 2 Heath Harrelson 2002-03-13 03:54:19 UTC
*** Bug 74449 has been marked as a duplicate of this bug. ***
Comment 3 Luis Villa 2002-03-13 04:07:18 UTC
Michael: cc'ing you because of the bonobo bits in the trace. Relevant?
Comment 4 Michael Meeks 2002-03-13 09:50:25 UTC
Ok; so the bonobo bit in the trace is irrelevant - it happens with any
X error and we chain back to the gdk handler since this is not an
error Bonobo is interested in trapping.

It _looks_ to me as if gdk_window_process_all_updates has a
re-enterency hazard - not in that the 'update_windows' list can
change, since this is NULL'd, but that a gdk_window can be destroyed
leaving a pointer on the copy of the update_windows list.

This might happen via gdk_window_process_updates_internal ->
_gdk_event_func -> gdk_main_do_event -> Practically anywhere ...

So - when the gdk window is destroyed it would call
_gdk_window_clear_update_area, which would remove it from
update_windows, but not the copy on the stack frame of
'gdk_window_process_all_updates'.

So - therein lies the rub. Not a particularly pretty one to fix. About
the only way to go is to hold a ref on each gdk window as we take the
list in gdk_window_process_all_updates - since while we could walk
back over and remove items from that list later, it's really not
obvious how to inform the higher stack frames that this window is now
dead.

Anyway - that's the bug I'll bet - and it probably explains a good
number of these similar 'Window closed, everything died' bugs. ...

Owen ?
Comment 5 Owen Taylor 2002-03-13 15:46:52 UTC
Well, yes, this seems to be a problem, but could you _please_
track down:

 - Why is closing windows causing process_all_updates() to 
   be called?

 - Who is calling gdk_window_destroy() out of an expose handler.
   [ CORBA traffic causing strange reentrancy? ]

Both seem to be asking for trouble without respect to this
fix.

Comment 6 Heath Harrelson 2002-03-13 16:41:32 UTC
*** Bug 74526 has been marked as a duplicate of this bug. ***
Comment 7 Heath Harrelson 2002-03-13 16:43:35 UTC
*** Bug 74457 has been marked as a duplicate of this bug. ***
Comment 8 Owen Taylor 2002-03-13 23:10:38 UTC
Looking at this some more, I see no reason at all to think
that these crashes have anything to do with the process_all_updates()
reentrancy problem.... the reason why you are getting X errors
here is that GTK+ is really stingy about doing round trips
to the server, so the gdk_flush() in the process_all_updates()
is very frequently the first time GTK+ gets a chance to get
anything back from the server.
Comment 9 jacob berkman 2002-03-13 23:52:19 UTC
i'll try to get a stack trace with --sync
Comment 10 Heath Harrelson 2002-03-14 15:38:44 UTC
*** Bug 74654 has been marked as a duplicate of this bug. ***
Comment 11 Owen Taylor 2002-03-14 16:12:28 UTC
Note that an X error at this point also occurs when not closing 
windows... I frequently get it at Nautilus startup. (The first time
I start Nautilus... seems to be some sort of bonobo-activation
slowness race condition in this case.)
Comment 12 Luis Villa 2002-03-14 20:54:47 UTC
Yeah, I got this on startup today while lots of other things were
going on. restarted later with lower load and no problems. Not sure if
that is causative or just correlative. Moving this up to Urgent,
mainly for michael's benefit, because it is (1) at startup (2) in a
major component and (3) lots of people are seeing it.
Comment 13 jacob berkman 2002-03-14 21:29:38 UTC
i am getting more of these (but in gnome2-settings-daemon) when i
change the background.

that makes sense as these may be from the bg setting code.

michael, is nautilus handling the desktop for you?
Comment 14 Heath Harrelson 2002-03-14 21:35:24 UTC
*** Bug 74668 has been marked as a duplicate of this bug. ***
Comment 15 Owen Taylor 2002-03-14 22:15:41 UTC
Problem Michael noticed filed separately as bug 74708, and fixed
in CVS. I'm pretty positive that it wasn't the problem here:

 - This crash seems unrelated to closing windows
 - It's an X error, not a segfault as you would get from
   Michael's reentrancy problem.
 - It takes a *lot* of work to trigger the reentrancy problem.

Assigning back to nautilus.
Comment 16 jacob berkman 2002-03-14 23:45:23 UTC
indeed i think the closing windows was a bogus coincidence and the
real bug is with the bg setting code.
Comment 17 Owen Taylor 2002-03-15 00:41:48 UTC
Created attachment 7182 [details]
Backtrace with --sync
Comment 18 Owen Taylor 2002-03-15 00:56:03 UTC
The backtrace above is one crash at this point (if perhaps
not the only one); this was occuring becuase I had two copies
of nautilus in my session file; apparently the sequence of
events was something like:

 - Nautilus 1 starts, sets background on the root window and 
   the desktop window and stores it in  XSETROOT_PMAP_ID,
   and ESETROOT_PMAP (property names from memory)
 - Nautilus 2 starts, XKillClient() ESETROOT_PMAP (as you should
   when setting this property), and then sets it's own pixmap
 - Nautilus 1 allocates the desktop window, causing GDK to
   unset/set the background, which causes the bad pixmap error.

Fixing this "right" isn't going to be easy ... in fact, the
only really right fix is probably not to use the root pixmap
window as the background pixmap for another window. But since
that would be a big efficiency loss, suggestions would be:

 - Make sure that the nautilus single-nautilus locking occurs
   before stuff like fooling around with the background window.

 - Don't set the background image as the root until the
   window is allocated to the right size.... in fact, this
   is in sense a symptom of whatever bug is causing all
   the file manager windows to come up small and then get
   resized to the right size.
Comment 19 Luis Villa 2002-03-15 01:31:01 UTC
Re-assigning ownership as well.
Comment 20 Heath Harrelson 2002-03-15 16:17:45 UTC
*** Bug 74785 has been marked as a duplicate of this bug. ***
Comment 21 John Fleck 2002-03-17 15:29:38 UTC
*** Bug 74979 has been marked as a duplicate of this bug. ***
Comment 22 John Fleck 2002-03-17 15:30:11 UTC
*** Bug 75037 has been marked as a duplicate of this bug. ***
Comment 23 Luis Villa 2002-03-18 17:30:25 UTC
testing bz; ignore the spam.
Comment 24 Luis Villa 2002-03-18 17:37:47 UTC
Closing on michael's behalf; for some reason bz is borked for him.

---
Thanks so much for looking at this Owen, the solution is really quite
trivial. When multiple nautilus' are started they ask the main shell
for new windows.

Whether or not to create the desktop is determined on new window
creation, by whether a) it's enabled and b) we appear to already have
a desktop window.

The problem with this is that the process of creating the desktop
window is slow and re-enterant prone process (via GConf perhaps ?) and
thus when we come to determine whether we should create a desktop
window for the same view - since it is not yet constructed we build
another desktop with the above problems.

Just committing the fix here - a trivial re-enterancy guard around
creating the (unique anyway) desktop window.

I imagine the reason people who were not running multiple nautilus's
saw this was a session issue, of nautilus trying to create multiple
windows on startup with the same effect.

Why closing a window should trigger it is unexplained though.
Comment 25 Luis Villa 2002-03-18 18:00:38 UTC
*** Bug 74734 has been marked as a duplicate of this bug. ***
Comment 26 jacob berkman 2002-03-18 19:02:23 UTC
(i only thought that closing the window triggered it because that's
the only thing i did to it - normally it didn't crash on startup)
Comment 27 Luis Villa 2002-03-18 19:29:29 UTC
*** Bug 74938 has been marked as a duplicate of this bug. ***
Comment 28 jacob berkman 2002-03-22 20:38:43 UTC
after my X died, i logged in again and nautilus died with a bad pixmap.

whever i change my background the settings daemon dies with a bad pixmap.

so i am guessing this is still the bg code?

where should this go then?
Comment 29 Heath Harrelson 2002-03-25 01:06:42 UTC
*** Bug 76173 has been marked as a duplicate of this bug. ***
Comment 30 Dave Camp 2002-03-26 19:39:26 UTC
I just put a patch into libbackground that fixes the
gnome2-settings-daemon crash.  This might fix the nautilus problem
too.  Could you give this a try jacob?
Comment 31 Heath Harrelson 2002-03-28 16:12:40 UTC
*** Bug 75683 has been marked as a duplicate of this bug. ***
Comment 32 Dave Camp 2002-03-28 23:14:16 UTC
Jacob tells me he hasn't run into this lately, so I'm going to close it.
Comment 33 Luis Villa 2002-03-30 20:21:08 UTC
*** Bug 75966 has been marked as a duplicate of this bug. ***
Comment 34 Heath Harrelson 2002-04-11 01:24:25 UTC
*** Bug 78283 has been marked as a duplicate of this bug. ***
Comment 35 Heath Harrelson 2002-05-04 23:48:43 UTC
Just found one of these from Nautilus 1.1.13.  Reopening, just to be safe.
Comment 36 Heath Harrelson 2002-05-04 23:49:12 UTC
*** Bug 80790 has been marked as a duplicate of this bug. ***
Comment 37 Heath Harrelson 2002-05-07 15:23:45 UTC
*** Bug 81051 has been marked as a duplicate of this bug. ***
Comment 38 Heath Harrelson 2002-05-09 12:02:51 UTC
*** Bug 81229 has been marked as a duplicate of this bug. ***
Comment 39 Luis Villa 2002-05-22 22:03:55 UTC
Adding dave to the cc: for this bug since he just saw this this
afternoon.
Comment 40 Dave Camp 2002-05-23 17:50:24 UTC
*** Bug 82508 has been marked as a duplicate of this bug. ***
Comment 41 Dave Camp 2002-05-23 17:51:07 UTC
*** Bug 82437 has been marked as a duplicate of this bug. ***
Comment 42 Heath Harrelson 2002-05-23 19:03:40 UTC
*** Bug 82705 has been marked as a duplicate of this bug. ***
Comment 43 Andrew Sobala 2002-05-23 21:16:26 UTC
*** Bug 82788 has been marked as a duplicate of this bug. ***
Comment 44 Luis Villa 2002-05-24 21:20:50 UTC
Eck. Don't know how this one escaped being marked 2.0.0. We absolutely
can't ship without this or we'll get thousands of reports.
Comment 45 Christian Fredrik Kalager Schaller 2002-05-24 21:22:21 UTC
Everytime I log into GNOME2 now, Nautilus crash (see bug 82508 for
stacktrace(marked as duplicate). So if there is any way my system can
be of assistance to track this down, let me know.
Comment 46 Luis Villa 2002-05-26 08:14:31 UTC
*** Bug 83031 has been marked as a duplicate of this bug. ***
Comment 47 Michael Meeks 2002-05-29 14:51:27 UTC
It doesn't look like a nautilus race condition, spawning several tens
of these in quick succession results in only 1 instance, and umpteen
windows, and no collision on the desktop / background of any sort.
Comment 48 Michael Meeks 2002-05-29 15:34:17 UTC
Christian, the trace is useless unless we can run Nautilus with
--sync, can you get gnome-session to pass --sync to nautilus in some way ?
Comment 49 Christian Fredrik Kalager Schaller 2002-05-30 04:20:26 UTC
Well tell me how to get get gnome-session to pass --sync and I
configure my system that way. Nautilus crash this way for me at every
login now so if you provide instructions on how I should be able to
give you a useable 
trace.
Comment 50 Damon Chaplin 2002-05-30 17:38:41 UTC
I think the problem is between gnome-settings-daemon (gsd) and
Nautilus, i.e. gsd decides to set the background and destroys
Nautilus' background pixmap.

There is code in gsd and Nautilus to try to avoid this, but it
isn't correct in either of them.

I added some gprint's to Nautilus and got this:

  In make_root_pixmap(): 1024 x 768
  Setting background pixmap of GdkWindow: 0x827dbe8
  Setting NAUTILUS_DESKTOP_WINDOW_ID
  In make_root_pixmap(): 1024 x 768
  Setting background pixmap of GdkWindow: 0x827dbe8

Note that Nautilus is supposed to set NAUTILUS_DESKTOP_WINDOW_ID
*before* it sets the background, so gsd knows not to touch it.
It isn't doing that here, and there is a long gap after the first
'Setting background pixmap' - several seconds on a 850Mhz box.
Plenty of time for gsd to set its own background, thinking that
Nautilus isn't running.

Dead easy to reproduce for me:

  gnome-settings-daemon&
  nautilus
   ... BadPixmap


Also, the gsd code isn't too good either. It checks for
NAUTILUS_DESKTOP_WINDOW_ID, then it nice's itself and creates the
pixmap, then it sets it. So if Nautilus starts up while it is
creating the pixmap, it will destroy Nautilus' pixmap.


Other minor notes:
 o why does bg_applier_apply_prefs call nice (20). That means
   any process that uses that function gets niced. I don't think
   it should do that.
 o Nautilus recreates the background pixmap way too often, just
   by hitting 'Reload' or adding a file to the desktop directory.
 o If Nautilus is running gsd won't set the background. But what
   if Nautilus has 'Draw Desktop' switched off? The background
   won't get set? Is that intended? 
Comment 51 Luis Villa 2002-05-31 01:53:26 UTC
*** Bug 83463 has been marked as a duplicate of this bug. ***
Comment 52 Luis Villa 2002-05-31 01:56:05 UTC
*** Bug 83471 has been marked as a duplicate of this bug. ***
Comment 53 Luis Villa 2002-05-31 02:04:07 UTC
*** Bug 83547 has been marked as a duplicate of this bug. ***
Comment 54 Damon Chaplin 2002-05-31 17:52:05 UTC
Created attachment 8892 [details] [review]
libbackground patch for gnome-settings-daemon to check for nautilus just before setting the pixmap
Comment 55 Damon Chaplin 2002-05-31 18:12:23 UTC
Created attachment 8896 [details] [review]
Nautilus patch to realize the desktop window ASAP, so the settings daemon knows it is running
Comment 56 jacob berkman 2002-05-31 18:25:26 UTC
the libbackground one looks ok - since nautilus doesn't nice itself
(and that's supposed to be the default behaviour) then i don't see why
g-s-d should...
Comment 57 Damon Chaplin 2002-05-31 20:04:20 UTC
Applied both patches. I'm a bit hesitant to close this, but I'm sure
someone will remember to reopen it if we still see it :)
Comment 58 Dave Camp 2002-05-31 20:16:52 UTC
Yay
Comment 59 Elijah Newren 2002-10-30 22:47:28 UTC
*** Bug 82078 has been marked as a duplicate of this bug. ***
Comment 60 John Fleck 2003-01-17 13:44:43 UTC
*** Bug 103697 has been marked as a duplicate of this bug. ***
Comment 61 John Fleck 2003-01-17 13:45:36 UTC
Dave Camp said, "I'm a bit hesitant to close this, but I'm sure
someone will remember to reopen it if we still see it :)" We do, so I am.
Comment 62 Andrew Sobala 2003-03-18 16:07:24 UTC
Since this still isn't marked fixed, targetting 2.2.2
Comment 63 Kjartan Maraas 2003-07-01 19:17:41 UTC
Well. We have no new dupes of this in three months plus. Time to
finally close it?
Comment 64 Kjartan Maraas 2003-07-01 19:21:32 UTC
We agreed to do just that. Reopen if someone sees it again.