Alan Coopersmith wrote: > Rod Evans wrote: > >> Alan Coopersmith wrote: >> >>> One of the new features in the upcoming Xorg 6.9 release is logging >>> a stack trace to the Xorg log when the X server coredumps. >> >> >> >> If the server is core dumping, and you allow the core to be created, >> why are you doing all this extra work? > > > Several reasons: > - this comes from the open source community, where developers and end > users run on different OS'es/distros/platforms, and core files aren't > as useful/transportable. > - many OS'es, including the default configuration of Solaris, don't allow > setuid programs like Xorg to dump core. Logging a stack trace is a > small way to get more usable information in bug reports when the user > isn't sure how to reproduce a bug. > > Because of the second, we've had an RFE open for a while against Xsun we > haven't gotten around to asking for the same feature (bug 4474067). > >> I'd be willing to entertain arguments for extending dladdr() - >> add them to the bug report please - but at present I'm not convinced >> that it should be extended. Plus, I'm not convinced stack traces >> from exiting processing have value either. On a fatal error condition, >> tell the use that the bounce has gone out of their bungee and point >> them at the core file. > > > Understood, but unless someone changes the default coreadm settings, > we have no core file to point at. >
I don't know of any solution to this problem that's portable to other operating systems.... Probably the quickest & cheesiest way to handle this is for Xorg to fork and exec pstack %pid from Xorg's signal handler while Xorg waits for pstack to exit; once that happens Xorg can exit(2) from it's signal handler as well. If Xorg arranges to flush it's log file and passes the fd for the log file w/ the seek pointer set to end of file to pstack as fd #1, the stack trace will show up in the log file properly.... Hmmm, this won't work if Xorg has given up it's privs.... another way is to start a process monitor before dropping privs so that it can print a stack trace when kicked by a sigv'ing Xorg. - Bart -- Bart Smaalders Solaris Kernel Performance barts at cyber.eng.sun.com http://blogs.sun.com/barts
