[jira] Created: (OFBIZ-303) Major BeanShell bug

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (OFBIZ-303) Major BeanShell bug

Nicolas Malin (Jira)
Major BeanShell bug
-------------------

                 Key: OFBIZ-303
                 URL: http://issues.apache.org/jira/browse/OFBIZ-303
             Project: OFBiz (The Open for Business Project)
          Issue Type: Improvement
          Components: framework
    Affects Versions: SVN trunk
            Reporter: Marco Risaliti


The current BeanShell (1.3a1) interpreter has some hideous bugs, in particular the following one is a showstopper which can crash or lag the entire HotSpot JVM:

UtilMisc.toList(foo, bar, baz,); // note the trailing comma

Besides that, the error messages tend to be very cryptic.

We should upgrade to the latest 1.x version at least, which is 1.3.0.

Or we could try the 2.0b releases. I tried it recently, but they changed the way the interpreter is loaded and broke the ofbiz beanshell handler.
 
 

 All    Comments    Work Log    Change History       Sort Order:  
Comment by Leon Torres [17/Mar/06 06:03 PM] [ Permlink ]
Here's what happens eventually after attempting to run a script with a trailing comma in a method call:

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# SIGSEGV (0xb) at pc=0xb7c8c458, pid=22796, tid=2809142192
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_09-b05 mixed mode)
# Problematic frame:
# V [libjvm.so+0x2d3458]
#
# An error report file with more information is saved as hs_err_pid22796.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp 
#


Comment by David E. Jones [17/Mar/06 07:04 PM] [ Permlink ]
Actually, no stock version of BeanShell will work with OFBiz as it is now. For performance reasons I had to hack it up a bit so that we could cache interpreted scripts instead of just the source to be interpreted every time it is run.

I submitted the changes back to Pat, but I guess he didn't catch the vision and didn't like the changes. He said we should wrap every one of them in a method wrapper and store them in one big BSH context, and just use the built-in "caching". As part of a framework like OFBiz I think that would cause some pretty big problems and/or would make it more difficult to use.

I'll attach my hacked up code. It includes an object that isn't part of the stock BSH that represents a cached script and it separates the execution of a script into 2 steps instead of a single step so that we can cache the object in between. I thought it was rather nice and fortunately beceause of how BeanShell was written it wasn't too hard to do this.

Comment by Marco Risaliti [14/Sep/06 02:23 AM] [ Permlink ]
Does this patch need to be moved to the new jira issue ?

Thanks
Marco

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-303) Major BeanShell bug

Nicolas Malin (Jira)
     [ http://issues.apache.org/jira/browse/OFBIZ-303?page=all ]

Marco Risaliti updated OFBIZ-303:
---------------------------------

    Attachment: BeanShell.gz

> Major BeanShell bug
> -------------------
>
>                 Key: OFBIZ-303
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-303
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Marco Risaliti
>         Attachments: BeanShell.gz
>
>
> The current BeanShell (1.3a1) interpreter has some hideous bugs, in particular the following one is a showstopper which can crash or lag the entire HotSpot JVM:
> UtilMisc.toList(foo, bar, baz,); // note the trailing comma
> Besides that, the error messages tend to be very cryptic.
> We should upgrade to the latest 1.x version at least, which is 1.3.0.
> Or we could try the 2.0b releases. I tried it recently, but they changed the way the interpreter is loaded and broke the ofbiz beanshell handler.
>  
>  
>  All    Comments    Work Log    Change History       Sort Order:  
> Comment by Leon Torres [17/Mar/06 06:03 PM] [ Permlink ]
> Here's what happens eventually after attempting to run a script with a trailing comma in a method call:
> #
> # An unexpected error has been detected by HotSpot Virtual Machine:
> #
> # SIGSEGV (0xb) at pc=0xb7c8c458, pid=22796, tid=2809142192
> #
> # Java VM: Java HotSpot(TM) Client VM (1.4.2_09-b05 mixed mode)
> # Problematic frame:
> # V [libjvm.so+0x2d3458]
> #
> # An error report file with more information is saved as hs_err_pid22796.log
> #
> # If you would like to submit a bug report, please visit:
> # http://java.sun.com/webapps/bugreport/crash.jsp 
> #
> Comment by David E. Jones [17/Mar/06 07:04 PM] [ Permlink ]
> Actually, no stock version of BeanShell will work with OFBiz as it is now. For performance reasons I had to hack it up a bit so that we could cache interpreted scripts instead of just the source to be interpreted every time it is run.
> I submitted the changes back to Pat, but I guess he didn't catch the vision and didn't like the changes. He said we should wrap every one of them in a method wrapper and store them in one big BSH context, and just use the built-in "caching". As part of a framework like OFBiz I think that would cause some pretty big problems and/or would make it more difficult to use.
> I'll attach my hacked up code. It includes an object that isn't part of the stock BSH that represents a cached script and it separates the execution of a script into 2 steps instead of a single step so that we can cache the object in between. I thought it was rather nice and fortunately beceause of how BeanShell was written it wasn't too hard to do this.
> Comment by Marco Risaliti [14/Sep/06 02:23 AM] [ Permlink ]
> Does this patch need to be moved to the new jira issue ?
> Thanks
> Marco

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira