summaryrefslogtreecommitdiff
path: root/os/osinit.c
AgeCommit message (Collapse)AuthorFilesLines
2015-07-08Should use ErrorFSigSafe in OsSigHandlerJon TURNEY1-1/+1
2015-04-23Improve crashreportingJon TURNEY1-2/+2
Rather than invoking an external script to do crashreporting, load an optional DLL which contains the crashreporter. Use new interfaces in Cygwin 2.0.0 to extract EXCEPTION_POINTERS from the signal information, and pass those to the crashreporter.
2015-02-22Log the Windows thread ID on fatal signal as well, to help interpreting ↵Jon TURNEY1-1/+6
crash reports
2015-02-08Add crash reportingJon TURNEY1-0/+2
xorg_backtrace() is called in a few places to generate a backtrace for the log, when the condition is not fatal (mi queue overflow, vpnprintf unrecognized format), where we don't want to run the crash reporter So add a separate, explicit invocation of the crash reporter, which is invoked on a fatal signal only
2015-02-08Add -notrapsignalsJon TURNEY1-21/+28
Add -notrapsignals to disable catching of fatal signals (to either continue or log) and just use the default signal processing instead. Also, log the thread id where the signal is delivered Also, various cosmetic fixes to fatal error logging v2: Include pthread.h Fixes an implicit-function-declaration warning for pthread_self() in OsSigHandler() Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-02-08Remove /usr/adm/XnmsgsJon TURNEY1-37/+0
As it stands, this code could prevent us from listening on one of our well-known listener sockets, if it happened to get assigned fd 2 We write log output to the logfile, I don't really see why we need to write it all to another file as well
2015-02-08os: -displayfd option fixesJon TURNEY1-1/+1
Rearrange init order to avoid null DISPLAY crash and correctly use DISPLAY in default logfile name when logfile isn't specified on command line. Do a bit more logging about what we are trying to do. Fix null DISPLAY crash when stderr is closed. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-12-19Move RTLD_DI_SETSIGNAL code into a separate block to quiet warningAlan Coopersmith1-2/+4
Gets rid of gcc 4.8 warning: osinit.c:211:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-11-12Drop trailing whitespacesPeter Hutterer1-7/+7
sed -i "s/[ ]\+$//g" **/*.(c|h) happy reviewing... git diff -w is an empty diff. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-12-12darwin: Don't leave stdin/stdout closedJeremy Huddleston Sequoia1-2/+11
<rdar://problem/15609419> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-11-11Trap SIGBUS to handle truncated shared memory segmentsKeith Packard1-0/+5
If a client passes a section of memory via file descriptor and then subsequently truncates that file, the underlying pages will be freed and the addresses invalidated. Subsequent accesses to the page will fail with a SIGBUS error. Trap that SIGBUS, figure out which segment was causing the error and then allocate new pages to fill in for that region. Mark the offending shared segment as invalid and free the resource ID so that the client will be able to tell when subsequently attempting to use the segment. Signed-off-by: Keith Packard <keithp@keithp.com> v2: Use MAP_FIXED to simplify the recovery logic (Mark Kettenis) v3: Also catch errors in ShmCreateSegment Conflicts: include/dix-config.h.in include/xorg-config.h.in
2012-11-28os/osinit.c: no getpgrp() and setpgrp() on WIN32Ryan Pavlik1-0/+2
Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Tested-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-11-28os/osinit.c, os/utils.c: Exclude sigaction code when building for MinGWRyan Pavlik1-0/+5
MinGW doesn't have sigaction, so this patch is needed for building. No attempt is made to actually install the fatal error signal handler, as MinGW will simply terminate the process rather than deliver a fatal signal. Also avoid using strsignal Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Tested-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-10-08os: fix typo in OsSigHandler() error messageDenys Vlasenko1-1/+1
Recieved → Received Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-07-09Reliably reset signals at server init timeKeith Packard1-0/+1
Each DDX currently calls OsReleaseSIGIO in case it was suspended when the server regen started. This causes a BUG to occur if SIGIO was *not* blocked at that time. Instead of relying on each DDX, make the OS layer reliably reset all signal state at server init time, ensuring that signals are suitably unblocked and that the various signal state counting variables are set back to zero. Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-02Log safely in fatal signal handlerChase Douglas1-4/+4
While we probably don't need to be signal safe here since we will never return to the normal context, the logging signal context check will cause unsafe logging to be unhandled. Using signal safe logging here resolves the issue. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-21Introduce a consistent coding styleKeith Packard1-144/+141
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-12-12OsInit: store "/dev/null" in a const char *Alan Coopersmith1-1/+1
It's only passed as the input side of a strcpy and as the filename to fopen, so doesn't need to be non-const. Fixes gcc warning: osinit.c: In function 'OsInit': osinit.c:154:28: warning: initialization discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-11-23Convert a bunch of sprintf to snprintf callsAlan Coopersmith1-1/+1
This batch is the straightforward set - others are more complex and need more analysis to determine right size to pass. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-03-14Consolidate all the PATH_MAX handling into misc.hChristopher James Halse Rogers1-8/+1
Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2010-12-20Remove SCO supportAdam Jackson1-4/+1
This has never been buildable in any modular server release. Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-09-10os: simplify smart scheduler init processTiago Vignatti1-3/+1
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-09-10os/xfree86: remove macro checking for POSIX symbolsTiago Vignatti1-6/+0
We assume already that our X implementation is POSIX compliant anyway. So remove those redundant checking. SA_SIGINFO is left there. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-05-13Turn sprintf argument into literaral string, shutting up gcc warningMikhail Gusarov1-3/+2
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
2009-08-20linux: Yet more malloc() avoidance for backtrace()Adam Jackson1-0/+14
Turns out, there's an initializer at the top of backtrace() that (on some arches) calls dlopen(). dlopen(), unsurprisingly, calls malloc(). So, call backtrace() early in signal handler setup so we can later safely call it from the signal handler itself.
2009-06-11OS: Fix compile warningsDaniel Stone1-5/+7
It's a marvel the sigaction() ever actually worked. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-05-22os: fix compiler warning "too few arguments to format"Peter Hutterer1-2/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-09Use RTLD_DI_SETSIGNAL to catch runtime dynamic loader errors and clean upAlan Coopersmith1-0/+20
Based on fix for Sun bug 6813925: Xorg needs to catch ld.so.1 failure so it can close down devices cleanly <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6813925> Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-04-09Lift fatal signal handlers from DDX'es up to a common DIX implementationAlan Coopersmith1-0/+83
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-03-05Remove #ifdef macII code left over from ancient A/UX 3.0 supportAlan Coopersmith1-4/+0
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2008-12-03Rework symbol visibility for easier maintenancePaulo Cesar Pereira de Andrade1-5/+5
Save in a few special cases, _X_EXPORT should not be used in C source files. Instead, it should be used in headers, and the proper C source include that header. Some special cases are symbols that need to be shared between modules, but not expected to be used by external drivers, and symbols that are accessible via LoaderSymbol/dlopen. This patch also adds conditionally some new sdk header files, depending on extensions enabled. These files were added to match pattern for other extensions/modules, that is, have the headers "deciding" symbol visibility in the sdk. These headers are: o Xext/panoramiXsrv.h, Xext/panoramiX.h o fbpict.h (unconditionally) o vidmodeproc.h o mioverlay.h (unconditionally, used only by xaa) o xfixes.h (unconditionally, symbols required by dri2) LoaderSymbol and similar functions now don't have different prototypes, in loaderProcs.h and xf86Module.h, so that both headers can be included, without the need of defining IN_LOADER. xf86NewInputDevice() device prototype readded to xf86Xinput.h, but not exported (and with a comment about it).
2008-11-29Export symbols defined in the sdk.Paulo Cesar Pereira de Andrade1-5/+5
This is the biggest "visibility" patch. Instead of doing a "export" symbol on demand, export everything in the sdk, so that if some module fails due to an unresolved symbol, it is because it is using a symbol not in the sdk. Most exported symbols shouldn't really be made visible, neither advertised in the sdk, as they are only used by a single shared object. Symbols in the sdk (or referenced in sdk macros), but not defined anywhere include: XkbBuildCoreState() XkbInitialMap XkbXIUnsupported XkbCheckActionVMods() XkbSendCompatNotify() XkbDDXFakePointerButton() XkbDDXApplyConfig() _XkbStrCaseCmp() _XkbErrMessages[] _XkbErrCode _XkbErrLocation _XkbErrData XkbAccessXDetailText() XkbNKNDetailMaskText() XkbLookupGroupAndLevel() XkbInitAtoms() XkbGetOrderedDrawables() XkbFreeOrderedDrawables() XkbConvertXkbComponents() XkbWriteXKBSemantics() XkbWriteXKBLayout() XkbWriteXKBKeymap() XkbWriteXKBFile() XkbWriteCFile() XkbWriteXKMFile() XkbWriteToServer() XkbMergeFile() XkmFindTOCEntry() XkmReadFileSection() XkmReadFileSectionName() InitExtInput() xf86CheckButton() xf86SwitchCoreDevice() RamDacSetGamma() RamDacRestoreDACValues() xf86Bpp xf86ConfigPix24 xf86MouseCflags[] xf86SupportedMouseTypes[] xf86NumMouseTypes xf86ChangeBusIndex() xf86EntityEnter() xf86EntityLeave() xf86WrapperInit() xf86RingBell() xf86findOptionBoolean() xf86debugListOptions() LoadSubModuleLocal() LoaderSymbolLocal() getInt10Rec() xf86CurrentScreen xf86ReallocatePciResources() xf86NewSerialNumber() xf86RandRSetInitialMode() fbCompositeSolidMask_nx1xn fbCompositeSolidMask_nx8888x0565C fbCompositeSolidMask_nx8888x8888C fbCompositeSolidMask_nx8x0565 fbCompositeSolidMask_nx8x0888 fbCompositeSolidMask_nx8x8888 fbCompositeSrc_0565x0565 fbCompositeSrc_8888x0565 fbCompositeSrc_8888x0888 fbCompositeSrc_8888x8888 fbCompositeSrcAdd_1000x1000 fbCompositeSrcAdd_8000x8000 fbCompositeSrcAdd_8888x8888 fbGeneration fbIn fbOver fbOver24 fbOverlayGeneration fbRasterizeEdges fbRestoreAreas fbSaveAreas composeFunctions VBEBuildVbeModeList() VBECalcVbeModeIndex() TIramdac3030CalculateMNPForClock() shadowBufPtr shadowFindBuf() miRRGetScreenInfo() RRSetScreenConfig() RRModePruneUnused() PixmanImageFromPicture() extern int miPointerGetMotionEvents() miClipPicture() miRasterizeTriangle() fbPush1toN() fbInitializeBackingStore() ddxBeforeReset() SetupSprite() InitSprite() DGADeliverEvent() SPECIAL CASES o defined as _X_INTERNAL xf86NewInputDevice() o defined as static fbGCPrivateKey fbOverlayScreenPrivateKey fbScreenPrivateKey fbWinPrivateKey o defined in libXfont.so, but declared in xorg/dixfont.h GetGlyphs() QueryGlyphExtents() QueryTextExtents() ParseGlyphCachingMode() InitGlyphCaching() SetGlyphCachingMode()
2008-08-11The smart scheduler is not optional.Mathieu Bérard1-4/+0
2008-07-24Remove some more MEMBUG garbage.Adam Jackson1-1/+0
2008-07-23Unifdef QNX.Adam Jackson1-1/+1
Again, hasn't worked since at least 7.0.
2008-07-17Remove dead code, useless #defines, et alDaniel Stone1-2/+0
2008-07-17Dead code removalDaniel Stone1-11/+0
Remove a whole bunch of code that was never built, be it entire files or just dead ifdefs.
2008-07-17Drop a bunch of #ifdef Lynx.Mathieu Bérard1-2/+2
2008-07-16OS/KDrive/XFree86: Sanitise colour initialisationDaniel Stone1-3/+0
OsInitColors always just returned TRUE, so just remove calls to it and insane special-case logic. Remove unused kcolor.c implementation, and merge oscolor.h into oscolor.c since it was the only user. Remove open-coded strncasecmp in oscolor.c. Since we no longer need to call OsInitColors after reading the config file, just call PostConfigInit() from one place, and move PM handling to one place so we can install the signal handlers earlier.
2007-12-02Clean up many #if 0.Adam Jackson1-4/+0
2007-06-28Remove the remnants of OS/2 support.Adam Jackson1-1/+1
This has never worked in any modular server release, and as far as I know was never tested in 6.7 through 6.9.
2006-07-21Remove RCS tags. Fix Xprint makefile braindamage.Adam Jackson1-2/+0
2006-02-13Move call to xf86WrapperInit() to OsVendorInit() in xf86Init.c and removeBenjamin Herrenschmidt1-7/+0
stubs in other DDX.
2005-11-08See ChangeLog entry 2005-11-07 for details.Kean Johnson1-2/+2
2005-07-03Change <X11/misc.h> and <X11/os.h> to "misc.h" and "os.h".Daniel Stone1-1/+1
2005-07-03Add Xtrans definitions (FONT_t, TRANS_CLIENT) to clean up warnings.Daniel Stone1-0/+4
Add XSERV_t, TRANS_SERVER, TRANS_REOPEN to quash warnings. Add #include <dix-config.h> or <xorg-config.h>, as appropriate, to all source files in the xserver/xorg tree, predicated on defines of HAVE_{DIX,XORG}_CONFIG_H. Change all Xfont includes to <X11/fonts/foo.h>.
2005-07-01Change all misc.h and os.h references to <X11/foo.h>.Daniel Stone1-1/+1
2005-04-20Fix includes right throughout the Xserver tree:Daniel Stone1-2/+2
change "foo.h" to <X11/foo.h> for core headers, e.g. X.h, Xpoll.h; change "foo.h", "extensions/foo.h" and "X11/foo.h" to <X11/extensions/foo.h> for extension headers, e.g. Xv.h; change "foo.[ch]" to <X11/Xtrans/foo.[ch]> for Xtrans files.
2004-04-23Merging XORG-CURRENT into trunkEgbert Eich1-1/+1
2004-03-14Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004xf86-4_4_99_1Egbert Eich1-1/+1