Skip to content
Snippets Groups Projects
  • Iain Buclaw's avatar
    5dbab7b3
    libphobos: Fix segfault at run-time when using custom Fibers (PR 98025) · 5dbab7b3
    Iain Buclaw authored
    When libphobos is configured with --enable-cet, this adds extra fields
    to the Fiber class to support the ucontext_t fallback implementation.
    These fields get omitted when compiling user code unless they also used
    `-fversion=CET' to build their project, which resulted in data being
    overwritten from within swapcontext().
    
    On reviewing the ucontext_t definitions, it was found that the shadow
    stack fields were missing, and the struct size didn't match up on X32.
    This has been fixed in upstream druntime and merged down here.
    
    Reviewed-on: https://github.com/dlang/druntime/pull/3293
    
    libphobos/ChangeLog:
    
    	PR d/98025
    	* Makefile.in: Regenerate.
    	* configure: Regenerate.
    	* configure.ac (DCFG_ENABLE_CET): Substitute.
    	* libdruntime/MERGE: Merge upstream druntime 0fe7974c.
    	* libdruntime/Makefile.in: Regenerate.
    	* libdruntime/core/thread.d: Import gcc.config.
    	(class Fiber): Add ucontext_t fields when GNU_Enable_CET is true.
    	* libdruntime/gcc/config.d.in (GNU_Enable_CET): Define.
    	* src/Makefile.in: Regenerate.
    	* testsuite/Makefile.in: Regenerate.
    5dbab7b3
    History
    libphobos: Fix segfault at run-time when using custom Fibers (PR 98025)
    Iain Buclaw authored
    When libphobos is configured with --enable-cet, this adds extra fields
    to the Fiber class to support the ucontext_t fallback implementation.
    These fields get omitted when compiling user code unless they also used
    `-fversion=CET' to build their project, which resulted in data being
    overwritten from within swapcontext().
    
    On reviewing the ucontext_t definitions, it was found that the shadow
    stack fields were missing, and the struct size didn't match up on X32.
    This has been fixed in upstream druntime and merged down here.
    
    Reviewed-on: https://github.com/dlang/druntime/pull/3293
    
    libphobos/ChangeLog:
    
    	PR d/98025
    	* Makefile.in: Regenerate.
    	* configure: Regenerate.
    	* configure.ac (DCFG_ENABLE_CET): Substitute.
    	* libdruntime/MERGE: Merge upstream druntime 0fe7974c.
    	* libdruntime/Makefile.in: Regenerate.
    	* libdruntime/core/thread.d: Import gcc.config.
    	(class Fiber): Add ucontext_t fields when GNU_Enable_CET is true.
    	* libdruntime/gcc/config.d.in (GNU_Enable_CET): Define.
    	* src/Makefile.in: Regenerate.
    	* testsuite/Makefile.in: Regenerate.