[Ur] 1/0 stopping server?

Marc Weber marco-oweber at gmx.de
Mon Nov 28 02:48:44 EST 2011


Try this simple app:

  fun div_by_zero r: transaction page = 
  let
    val a:int = readError r.A
    val b:int = readError r.B
  in
          return <xml>
          <head> <title>Hello world!!</title> </head>
          <body>
            {[a /b ]}
          </body>
        </xml>
  end



  fun main (():unit) : transaction page =
    return <xml>
      <head> <title>Hello world!!</title> </head>
      <body>
        <form>
        <textbox{#A}/>
        <textbox{#B}/>
        <submit action={div_by_zero}/>
        </form>
      </body>
    </xml>

then type 1 for #A and 0 for #B. The standalone server will quit with:
  zsh: floating point exception  ./binary_search_tree.exe -p 8082

Given that the server should keep state and can push data to clients
can you really call this "production ready"?

If the server does not quit - is there a chance to find such a problem fast in
huge web apps without stack trace?

Or is the problem me using the standalone server?

Marc Weber



More information about the Ur mailing list