title: Segmentation Fault - fortran 90 - bisection subroutine
body: <pre><code>program bisect
  real(8) ::  output
  call bisection(3.d0,4.d0,2.d0,output)
  print*, output
  end program bisect
  
  subroutine bisection(a,b,error,result)
  real(8):: a,b,error,c,result
  logical:: proceed
    proceed = .true.
    do while (proceed)
    if (sin(a)*sin(b).lt. 0.d0) then
       c=(a+b)/2
       if (sin(a)*sin(c).lt.0.d0) then
          b=c
       else
          a=c
       end if
    else  
       stop 'cannot be bisected'
    end if 
  
    if (abs(a-b).lt. error) then
       proceed = .false.
    end if
   end do
   result= a
  end subroutine bisection
  </code></pre>
  
  <p>A version of the same code is uploaded <a href="http://ideone.com/KkLg8W" rel="nofollow">here</a>.</p>
  
  <p>This is the minimal example i could come up with. This yields a segmentation fault on running the executable with gfortran, and also on the website. </p>