-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Description
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=rediswith PostgreSQLSESSION_DRIVER=filewith PostgreSQL- Custom PDO session handler (standalone)
- All regular PDO PostgreSQL queries
What Doesn't Work
Illuminate\Session\DatabaseSessionHandlerwith 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
- Fresh Laravel 12 + PostgreSQL setup
- Configure
.env:
DB_CONNECTION=pgsql
SESSION_DRIVER=database - Run
php artisan session:table && php artisan migrate - Create a user
- 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