Skip to content

jonbarlo/action-controller-segmentation-fault-error

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ActionController::Live Segmentation Fault Reproduction Project

🎯 Project Overview

This project attempts to reproduce the segmentation fault issue #55132 in ActionController::Live related to "double concurrent PG#close" crashes.

Build Image

docker-compose -f ./docker/docker-compose.crash-reproduction.yml up -d --build

Run Image

docker exec -it docker-rails-crash-test-1 bash

Ssh'd into the docker container and run

ruby crash_test.rb

After reproducing the error the code will spit out this:

2e31df89eed2:/app# ruby crash_test.rb 
☒️  ULTRA-NUCLEAR CRASH TEST - Maximum Destruction + Kernel Chaos!
====================================================================
Testing ActionController::Live crash reproduction with ULTRA-NUCLEAR pressure

βœ… Basic components loaded successfully

πŸ§ͺ Testing ActionController::Live with ULTRA-NUCLEAR race conditions...

πŸ§ͺ Creating ultra nuclear test controller...
βœ… Ultra nuclear test controller created successfully

⚠️  If a segmentation fault occurs, check for core dumps in /tmp/core_dumps/
⚠️  This test uses KERNEL SIGNALS, MMAP CORRUPTION, FORK BOMBS, and ATTOSECOND timing!
⚠️  THIS IS THE ULTIMATE TEST - IF THIS DOESN'T CRASH, NOTHING WILL!

πŸ”„ Starting ULTRA-NUCLEAR streaming test in thread 1160
⚠️  Setting up ULTRA-NUCLEAR signal handlers for maximum chaos...
πŸ”„ ITERATION 1 - ULTRA-NUCLEAR DESTRUCTION!
☒️  Creating ULTRA-NUCLEAR pressure...
πŸ“ Creating ultra file descriptor pressure...
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 10 corrupted memory mappings
   βœ… Created 3100 ultra nuclear pressure objects
   βœ… Created 200 file descriptors
   βœ… Created 10 memory mappings
πŸ”Œ Creating ULTRA-NUCLEAR PostgreSQL connections...
   βœ… Connection 1 created (PID: 8248)
   βœ… Connection 2 created (PID: 8249)
   βœ… Connection 3 created (PID: 8250)
   βœ… Connection 4 created (PID: 8251)
   βœ… Connection 5 created (PID: 8252)
⚠️  Simulating ULTRA-NUCLEAR race conditions...
πŸ“€ Simulating streaming response with ULTRA-NUCLEAR precision...
βœ… ITERATION 1 completed
   ❌ Error in ultra nuclear race condition thread: PG::UnableToSend: PQsendQuery another command is already in progress
   ❌ Error in ultra nuclear race condition thread: PG::UnableToSend: PQsendQuery another command is already in progress
message type 0x54 arrived from server while idle
message type 0x44 arrived from server while idle
message type 0x43 arrived from server while idle
message type 0x5a arrived from server while idle
message type 0x54 arrived from server while idle
message type 0x44 arrived from server while idle
message type 0x43 arrived from server while idle
message type 0x5a arrived from server while idle
message type 0x44 arrived from server while idle
message type 0x54 arrived from server while idle
message type 0x54 arrived from server while idle
message type 0x44 arrived from server while idle
message type 0x43 arrived from server while idle
message type 0x5a arrived from server while idle
message type 0x54 arrived from server while idle
message type 0x44 arrived from server while idle
message type 0x43 arrived from server while idle
message type 0x5a arrived from server while idle
   ❌ Error in ultra nuclear race condition thread: PG::UnableToSend: PQsendQuery another command is already in progress
   πŸ”„ Thread 1232 executed query on connection
   🚨 DOUBLE CLOSE: Thread 1232 closing connection
   ❌ Error in ultra nuclear race condition thread: PG::UnableToSend: PQsendQuery another command is already in progress
another command is already in progress
another command is already in progress
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   πŸ”„ Thread 1256 executed query on connection
   🚨 DOUBLE CLOSE: Thread 1256 closing connection
   ❌ Error in ultra nuclear race condition thread: PG::UnableToSend: PQsendQuery another command is already in progress
another command is already in progress
      🧹 Thread 1272 closed connection (3)
   πŸ”„ Thread 1168 executed query on connection
   🚨 DOUBLE CLOSE: Thread 1168 closing connection
   🚨 SENT SIGNAL USR1 during double close!
   πŸ”„ Thread 1192 executed query on connection
   🚨 DOUBLE CLOSE: Thread 1192 closing connection
   🚨 SENT SIGNAL USR2 during double close!
   πŸ”„ Thread 1216 executed query on connection
   🚨 DOUBLE CLOSE: Thread 1216 closing connection
   🚨 SENT SIGNAL USR2 during double close!
   ❌ Error in ultra nuclear race condition thread: PG::UnableToSend: PQsendQuery another command is already in progress
      🧹 Thread 1288 closed connection (1)
      🚨 SENT SIGNAL USR1 during close attempt!
      🚨 SENT SIGNAL USR1 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
      🚨 SENT SIGNAL USR1 during close attempt!
   ❌ Error in ultra nuclear race condition thread: IOError: stream closed in another thread
   ❌ Error in ultra nuclear race condition thread: PG::UnableToSend: PQsendQuery another command is already in progress
another command is already in progress
another command is already in progress
      🧹 Thread 1240 closed connection (6)
   ❌ Error in ultra nuclear race condition thread: PG::UnableToSend: PQsendQuery another command is already in progress
another command is already in progress
another command is already in progress
   πŸ”„ Thread 1248 executed query on connection
   🚨 DOUBLE CLOSE: Thread 1248 closing connection
   πŸ”„ Thread 1264 executed query on connection
   🚨 DOUBLE CLOSE: Thread 1264 closing connection
   ❌ Error in ultra nuclear race condition thread: PG::UnableToSend: PQsendQuery another command is already in progress
another command is already in progress
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      🚨 SENT SIGNAL USR2 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
   ❌ Error in ultra nuclear race condition thread: PG::UnableToSend: PQsendQuery another command is already in progress
another command is already in progress
   πŸ”„ Thread 1176 executed query on connection
   🚨 DOUBLE CLOSE: Thread 1176 closing connection
   🚨 SENT SIGNAL USR1 during double close!
      🚨 SENT SIGNAL USR2 during close attempt!
   βœ… Created 20 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   πŸ”„ Thread 1200 executed query on connection
   🚨 DOUBLE CLOSE: Thread 1200 closing connection
   🚨 SENT SIGNAL USR1 during double close!
      🚨 SENT SIGNAL USR2 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      🚨 SENT SIGNAL USR1 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
   πŸ”„ Thread 1224 executed query on connection
   🚨 DOUBLE CLOSE: Thread 1224 closing connection
   🚨 SENT SIGNAL USR2 during double close!
      🚨 SENT SIGNAL USR2 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      🚨 SENT SIGNAL USR1 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      🚨 SENT SIGNAL USR1 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
      🚨 SENT SIGNAL USR1 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
   ❌ Error in ultra nuclear race condition thread: PG::UnableToSend: PQsendQuery another command is already in progress
      🚨 SENT SIGNAL USR1 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
   ❌ Error in ultra nuclear race condition thread: PG::UnableToSend: PQsendQuery another command is already in progress
another command is already in progress
      🚨 SENT SIGNAL USR1 during close attempt!
      🚨 SENT SIGNAL USR1 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      🚨 SENT SIGNAL USR2 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
   πŸ”„ Thread 1184 executed query on connection
   🚨 DOUBLE CLOSE: Thread 1184 closing connection
   🚨 SENT SIGNAL USR1 during double close!
      🚨 SENT SIGNAL USR1 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      🚨 SENT SIGNAL USR1 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
   βœ… Created 30 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
   πŸ”„ Thread 1208 executed query on connection
   🚨 DOUBLE CLOSE: Thread 1208 closing connection
   🚨 SENT SIGNAL USR1 during double close!
   🚨 SENT SIGNAL USR2 during double close!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      🚨 SENT SIGNAL USR1 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      🧹 Thread 1280 closed connection (4)
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
   ❌ Error in ultra nuclear race condition thread: PG::UnableToSend: PQsendQuery another command is already in progress
      🚨 SENT SIGNAL USR1 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      🚨 SENT SIGNAL USR1 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      🚨 SENT SIGNAL USR1 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      🚨 SENT SIGNAL USR2 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      🚨 SENT SIGNAL USR1 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
      🚨 SENT SIGNAL USR1 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      🚨 SENT SIGNAL USR2 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      🚨 SENT SIGNAL USR1 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      🚨 SENT SIGNAL USR1 during close attempt!
      🚨 SENT SIGNAL USR1 during close attempt!
      🚨 SENT SIGNAL USR1 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
      🚨 SENT SIGNAL USR2 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      🚨 SENT SIGNAL USR2 during close attempt!
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
   βœ… Created 40 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
      ❌ Error closing connection: PG::ConnectionBad: connection is closed
   βœ… Created 50 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 60 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 70 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 80 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 90 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 100 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 110 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 120 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 130 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 140 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 150 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 160 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 170 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 180 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 190 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 200 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 210 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 220 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 230 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 240 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 250 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 260 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 270 corrupted memory mappings
   🚨 SIGNAL USR1 received during race condition!
   πŸ’Ύ Forced garbage collection during signal!
   πŸ—ΊοΈ  Creating memory mapping corruption...
   βœ… Created 280 corrupted memory mappings
   🚨 SIGNAL USR2 received during double close!
   πŸ’Ύ Created ultra memory pressure during signal!
   πŸ’₯ Triggering process-level chaos...
      🚨 FORK BOMB 1 created during signal!
crash_test.rb:268: [BUG] Segmentation fault at 0x00000000000025f1SEGV received in SEGV handler
SEGV received in SEGV handler

ruby 3.4.4 (2025-05-14 revision a38531fd3f) +PRISM [x86_64-linux-musl]

-- Control frame information -----------------------------------------------
Aborted
2e31df89eed2:/app# 

About

Research for #55132

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published