Interestingly, I ran into the same problem today (using GStreamer 1.9.x). The mentioned pipeline still exhibits the same behaviour (stuck at waiting for EOS). The same behaviour is observed in my python application which is pretty bad since this causes a memory leak on application close.
gst-launch-1.0 -e fakesrc ! shmsink socket-path=/tmp/encoded
Setting pipeline to PAUSED ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
EOS on shutdown enabled -- Forcing EOS on the pipeline
Waiting for EOS...
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Interrupt while waiting for EOS - stopping pipeline...
Execution ended after 0:00:22.614863547
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
Notice that I needed to hit control+c twice. Is this a bug or am I wrong to conclude that we need an explicit EOS in order not to leak any memory?