Skip to content

SIGSEGV in DatabaseSessionHandler on PHP 8.5 + PostgreSQL during session regeneration #58029

@serdardb

Description

@serdardb

Laravel Version

12.41.1

PHP Version

8.5.0

Database Driver & Version

PostgreSQL 18.1 (pdo_pgsql, libpq 18.1) on ARM64 Docker

Description

Laravel crashes with SIGSEGV (exit code 139) when using SESSION_DRIVER=database with PostgreSQL on PHP 8.5. The crash occurs during session regeneration after Auth::attempt() or
Auth::login().

Important: A standalone custom PDO session handler does NOT crash. The issue is specific to Illuminate\Session\DatabaseSessionHandler.

Server Logs

laravel.test-1 | WARN exited: php (exit status 139; not expected)
laravel.test-1 | INFO reaped unknown pid 228 (terminated by SIGSEGV)

What Works

  • SESSION_DRIVER=redis with PostgreSQL
  • SESSION_DRIVER=file with PostgreSQL
  • Custom PDO session handler (standalone)
  • All regular PDO PostgreSQL queries

What Doesn't Work

  • Illuminate\Session\DatabaseSessionHandler with PostgreSQL on PHP 8.5

Possible Cause

In DatabaseSessionHandler::getDefaultPayload(), the handler resolves Guard::class to get user_id. During session regeneration after auth, this may create a problematic interaction that
triggers segfault in PHP 8.5's pdo_pgsql.

Environment

  • Ubuntu 24.04.3 LTS (Docker)
  • Architecture: ARM64 (Apple Silicon)
  • Laravel Sail

Steps To Reproduce

  1. Fresh Laravel 12 + PostgreSQL setup
  2. Configure .env:
    DB_CONNECTION=pgsql
    SESSION_DRIVER=database
  3. Run php artisan session:table && php artisan migrate
  4. Create a user
  5. Implement login:
if (Auth::attempt($credentials)) {
    session()->regenerate();  // SIGSEGV here
    return redirect('/dashboard');
}
6. Submit login form → PHP crashes with exit code 139

Workaround: Use SESSION_DRIVER=redis

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions