[Lift] Re: JSON stack overflow issue

2009-02-19 Thread O'Rorke Paul
I've been running with this for a day or so and it seems to work fine  
now (no mo' stack overflows).
Thanks, David, for the quick fix!
--
Paul O'Rorke
http://ororke.com/paul/blog
http://linkedin.com/in/paulororke




On Feb 16, 2009, at 8:42 AM PST, David Pollak wrote:

 Folks,

 The problem was in Scala's rep1sep parser method.  It grows stack,  
 about 20 frames per element, and thus bad things happen around 200  
 elements.  I replaced the code with a while loop.  Less elegant on  
 the page, more elegant in execution.

 Thanks,

 David

 On Mon, Feb 16, 2009 at 7:38 AM, David Pollak feeder.of.the.be...@gmail.com 
  wrote:
 Okay... I've issolated the problem.  Lots of GC items being sent.   
 This is causing a stack overflow.  I've got a test for it and I'll  
 fix the problem today.


 On Mon, Feb 16, 2009 at 1:33 AM, Tim Perrett he...@timperrett.com  
 wrote:


 In wireshark you'll be looking to use a normal HTTP rule as the JSON
 will just be passed as entity body in the request. Doing a filter for
 HTTP port 80 should be sufficient.

 Cheers

 Tim






 -- 
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp



 -- 
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: JSON stack overflow issue

2009-02-16 Thread Tim Perrett


In wireshark you'll be looking to use a normal HTTP rule as the JSON
will just be passed as entity body in the request. Doing a filter for
HTTP port 80 should be sufficient.

Cheers

Tim


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: JSON stack overflow issue

2009-02-16 Thread David Pollak
Okay... I've issolated the problem.  Lots of GC items being sent.  This is
causing a stack overflow.  I've got a test for it and I'll fix the problem
today.

On Mon, Feb 16, 2009 at 1:33 AM, Tim Perrett he...@timperrett.com wrote:



 In wireshark you'll be looking to use a normal HTTP rule as the JSON
 will just be passed as entity body in the request. Doing a filter for
 HTTP port 80 should be sufficient.

 Cheers

 Tim


 



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: JSON stack overflow issue

2009-02-15 Thread Paul O'Rorke

Hi, David:

I'm not using JSON directly myself and when I do a search on json it
only shows up on one line in the default.html page:

script id=json src=/classpath/json.js type=text/javascript/


Perhaps it is JSON that is being used under the hood?  I am using
CRUDIFY and the menu items for add, delete, and list operations and
the associated pages.  I'm also using some ajax checkboxes and
textboxes like the ones in lift workshop examples (specifically: the
todo example).

By the way, the app still seems to work, it just tends to slow down
after a while.

On Feb 15, 4:01 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 Paul,
 Please provide a sample of the JSON that caused the stack overflow.

 Thanks,

 David

 On Sun, Feb 15, 2009 at 1:24 PM, Paul O'Rorke p...@ororke.com wrote:

  Something odd has started to happen in the last day or two:  I am
  starting to get stackoverflows in a small app that I use.  I have not
  changed my classes for a week or so and use the app daily.
  It has been working ok up until today or last night.
  This seems to happen as soon as it starts up before I even start to
  use it.
  I am using Scala 2.7.3 and the following lift
       version0.11-SNAPSHOT/version

  [INFO] Starting jetty 6.1.15.rc2 ...
  2009-02-15 13:03:37.799::INFO:  jetty-6.1.15.rc2
  2009-02-15 13:03:37.994::INFO:  No Transaction manager found - if your
  webapp requires one, please configure one.
  2009-02-15 13:03:40.506::INFO:  Started
  selectchannelconnec...@0.0.0.0:8080
  [INFO] Started Jetty Server
  [INFO] Starting scanner at interval of 5 seconds.
  WARN - Request for /ajax_request failed null
  java.lang.StackOverflowError
         at net.liftweb.util.JSONParser$$anonfun$string$4$$anonfun$apply$14$
  $anonfun$apply$15$$anonfun$apply$16.apply(JSON.scala:46)
         at net.liftweb.util.JSONParser$$anonfun$string$4$$anonfun$apply$14$
  $anonfun$apply$15$$anonfun$apply$16.apply(JSON.scala:46)
         at scala.util.parsing.combinator.Parsers$$anonfun$not$1.apply
  (Parsers.scala:703)
         at scala.util.parsing.combinator.Parsers$$anonfun$not$1.apply
  (Parsers.scala:702)
         at
  scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:
  188)
         at scala.util.parsing.combinator.Parsers$Parser$$anonfun$flatMap
  $1.apply(Parsers.scala:206)
         at scala.util.parsing.combinator.Parsers$Parser$$anonfun$flatMap
  $1.apply(Parsers.scala:206)
         at
  scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:
  188)
         at net.liftweb.util.SafeSeqParser$$anon$1.apply
  (CombParserHelpers.scala:169)
         at scala.util.parsing.combinator.Parsers$Parser$$anonfun$append
  $1.apply(Parsers.scala:214)
         at scala.util.parsing.combinator.Parsers$Parser$$anonfun$append
  $1.apply(Parsers.scala:214)
         at
  scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:
  188)
         at scala.util.parsing.combinator.Parsers$Parser$$anonfun$map$1.apply
  (Parsers.scala:209)
         at scala.util.parsing.combinator.Parsers$Parser$$anonfun$map$1.apply
  (Parsers.scala:209)
         at
  scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:
  188)
         at
  scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:
  188)
         at scala.util.parsing.combinator.Parsers$Success.flatMapWithNext
  (Parsers.scala:128)
         at scala.util.parsing.combinator.Parsers$Parser$$anonfun$flatMap
  $1.apply(Parsers.scala:206)
         at scala.util.parsing.combinator.Parsers$Parser$$anonfun$flatMap
  $1.apply(Parsers.scala:206)
         at
  scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:
  188)
         at scala.util.parsing.combinator.Parsers$Parser$$anonfun$flatMap
  $1.apply(Parsers.scala:206)
         at scala.util.parsing.combinator.Parsers$Parser$$anonfun$flatMap
  $1.apply(Parsers.scala:206)
         at
  scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:
  188)
         at scala.util.parsing.combinator.Parsers$Parser$$anonfun$map$1.apply
  (Parsers.scala:209)
         at scala.util.parsing.combinator.Parsers$Parser$$anonfun$map$1.apply
  (Parsers.scala:209)
         at
  scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:
  188)
         at scala.util.parsing.combinator.Parsers$Parser$$anonfun$append$1$
  $anonfun$apply$1.apply(Parsers.scala:214)
         at scala.util.parsing.combinator.Parsers$Parser$$anonfun$append$1$
  $anonfun$apply$1.apply(Parsers.scala:214)
         at
  scala.util.parsing.combinator.Parsers$Failure.append(Parsers.scala:
  168)
         at scala.util.parsing.combinator.Parsers$Parser$$anonfun$append
  $1.apply(Parsers.scala:214)
         at scala.util.parsing.combinator.Parsers$Parser$$anonfun$append
  $1.apply(Parsers.scala:214)
         at
  scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:
  188)
         at scala.util.parsing.combinator.Parsers$Parser$$anonfun$append
  $1.apply(Parsers.scala:214)
         at 

[Lift] Re: JSON stack overflow issue

2009-02-15 Thread David Pollak
Paul,
Something is calling JSONParser with a parameter that's causing the stack
overflow.

You can use Firebug to see what the browser is sending to the server.
 That's a way to capture the JSON.

Wireshark is a way of intercepting the HTTP traffic and you can see what the
client is sending to the server.

If you can provide me with the String that's causing the JSON parsing
failure, I can add it to the test suite and fix the bug.

Thanks,

David

On Sun, Feb 15, 2009 at 5:25 PM, Paul O'Rorke p...@ororke.com wrote:


 Hi, David:

 I'm not using JSON directly myself and when I do a search on json it
 only shows up on one line in the default.html page:

script id=json src=/classpath/json.js type=text/javascript/
 

 Perhaps it is JSON that is being used under the hood?  I am using
 CRUDIFY and the menu items for add, delete, and list operations and
 the associated pages.  I'm also using some ajax checkboxes and
 textboxes like the ones in lift workshop examples (specifically: the
 todo example).

 By the way, the app still seems to work, it just tends to slow down
 after a while.

 On Feb 15, 4:01 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  Paul,
  Please provide a sample of the JSON that caused the stack overflow.
 
  Thanks,
 
  David
 
  On Sun, Feb 15, 2009 at 1:24 PM, Paul O'Rorke p...@ororke.com wrote:
 
   Something odd has started to happen in the last day or two:  I am
   starting to get stackoverflows in a small app that I use.  I have not
   changed my classes for a week or so and use the app daily.
   It has been working ok up until today or last night.
   This seems to happen as soon as it starts up before I even start to
   use it.
   I am using Scala 2.7.3 and the following lift
version0.11-SNAPSHOT/version
 
   [INFO] Starting jetty 6.1.15.rc2 ...
   2009-02-15 13:03:37.799::INFO:  jetty-6.1.15.rc2
   2009-02-15 13:03:37.994::INFO:  No Transaction manager found - if your
   webapp requires one, please configure one.
   2009-02-15 13:03:40.506::INFO:  Started
   selectchannelconnec...@0.0.0.0:8080
   [INFO] Started Jetty Server
   [INFO] Starting scanner at interval of 5 seconds.
   WARN - Request for /ajax_request failed null
   java.lang.StackOverflowError
  at
 net.liftweb.util.JSONParser$$anonfun$string$4$$anonfun$apply$14$
   $anonfun$apply$15$$anonfun$apply$16.apply(JSON.scala:46)
  at
 net.liftweb.util.JSONParser$$anonfun$string$4$$anonfun$apply$14$
   $anonfun$apply$15$$anonfun$apply$16.apply(JSON.scala:46)
  at scala.util.parsing.combinator.Parsers$$anonfun$not$1.apply
   (Parsers.scala:703)
  at scala.util.parsing.combinator.Parsers$$anonfun$not$1.apply
   (Parsers.scala:702)
  at
   scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:
   188)
  at scala.util.parsing.combinator.Parsers$Parser$$anonfun$flatMap
   $1.apply(Parsers.scala:206)
  at scala.util.parsing.combinator.Parsers$Parser$$anonfun$flatMap
   $1.apply(Parsers.scala:206)
  at
   scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:
   188)
  at net.liftweb.util.SafeSeqParser$$anon$1.apply
   (CombParserHelpers.scala:169)
  at scala.util.parsing.combinator.Parsers$Parser$$anonfun$append
   $1.apply(Parsers.scala:214)
  at scala.util.parsing.combinator.Parsers$Parser$$anonfun$append
   $1.apply(Parsers.scala:214)
  at
   scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:
   188)
  at
 scala.util.parsing.combinator.Parsers$Parser$$anonfun$map$1.apply
   (Parsers.scala:209)
  at
 scala.util.parsing.combinator.Parsers$Parser$$anonfun$map$1.apply
   (Parsers.scala:209)
  at
   scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:
   188)
  at
   scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:
   188)
  at scala.util.parsing.combinator.Parsers$Success.flatMapWithNext
   (Parsers.scala:128)
  at scala.util.parsing.combinator.Parsers$Parser$$anonfun$flatMap
   $1.apply(Parsers.scala:206)
  at scala.util.parsing.combinator.Parsers$Parser$$anonfun$flatMap
   $1.apply(Parsers.scala:206)
  at
   scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:
   188)
  at scala.util.parsing.combinator.Parsers$Parser$$anonfun$flatMap
   $1.apply(Parsers.scala:206)
  at scala.util.parsing.combinator.Parsers$Parser$$anonfun$flatMap
   $1.apply(Parsers.scala:206)
  at
   scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:
   188)
  at
 scala.util.parsing.combinator.Parsers$Parser$$anonfun$map$1.apply
   (Parsers.scala:209)
  at
 scala.util.parsing.combinator.Parsers$Parser$$anonfun$map$1.apply
   (Parsers.scala:209)
  at
   scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:
   188)
  at
 scala.util.parsing.combinator.Parsers$Parser$$anonfun$append$1$