Bug 407735 - VerifyError with Tomcat 7.0.39, JDK 1.6.43 32-bit in Windows 7 64-bit
Summary: VerifyError with Tomcat 7.0.39, JDK 1.6.43 32-bit in Windows 7 64-bit
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: LTWeaving (show other bugs)
Version: 1.7.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-10 08:11 EDT by Bohuslav Roztočil CLA
Modified: 2013-05-14 11:07 EDT (History)
1 user (show)

See Also:


Attachments
Sources, logs and aop.xml. (9.14 KB, application/octet-stream)
2013-05-10 08:11 EDT, Bohuslav Roztočil CLA
no flags Details
Content of the %CATALINA_HOME%\lib folder. (1.18 KB, text/plain)
2013-05-14 04:51 EDT, Bohuslav Roztočil CLA
no flags Details
Content of the wtp.deploy folder. (75.30 KB, text/plain)
2013-05-14 04:53 EDT, Bohuslav Roztočil CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bohuslav Roztočil CLA 2013-05-10 08:11:19 EDT
Created attachment 230773 [details]
Sources, logs and aop.xml.

I've written an @AspectJ aspect tracing execution times of JDBC queries in web application running on Tomcat.

After adding the executeSqlAdvice advice the application startup fails with VerifyError on com.informix.jdbc.IfxStatement.executeQuery("select site from informix.systables where tabname = ' GL_COLLATE'"). Unfortunately I cannot tell you details about the VerifyError, because my Eclipse (Juno) doesn't show it though it should (yes, I checked the "Open popus when suspended on exception" and restarted the IDE).

I tried various changes, including specifying com.informix.. clases instead their java.sql ancestors, explicit pointcuts, not using wildcard in method names among others.

Then I tried to rewrite the aspect not to use specific advice for methods with execute*() and execute*(String, ..) signatures - and this solution works.

JdbcDriverMonitor_VerifyError.java - the failing aspect.
JdbcDriverMonitor.java - the working aspect.
Comment 1 Bohuslav Roztočil CLA 2013-05-10 08:14:30 EDT
Oh, I forgot:

I observe the behavior on versions 1.6.7 and 1.7.2 of AspectJ obtained via Maven.
Comment 2 Jean-Louis CLA 2013-05-10 13:31:40 EDT
just to be sure:
1) have you controlled that the libraries at compile time nad runtime are the same ( duplicate libraries in classpath with different versions ).
2 ) Did you clear the work directory of Tomcat ?
3 ) Try with -noverify in JVM parameter
Comment 3 Jean-Louis CLA 2013-05-10 13:40:55 EDT
4) replace throws Throwable by throws java.sql.SQLException when needed
Comment 4 Bohuslav Roztočil CLA 2013-05-14 04:50:55 EDT
ad 1) Though I've found several "conflicting" jars, I don't think this is the problem. The verify error occurs very early, during preparing JDBC datasource, before the actual web application ever starts. And the "conflicting" jars are used by app's business.

Tomcat is started with this VM arguments:

-Dcatalina.base="C:\develop\icz\amishd\tomcat_deploy"
-Dcatalina.home="C:\Develop\tomcat\apache-tomcat-7.0.39"
-Dwtp.deploy="C:\develop\icz\amishd\tomcat_deploy\wtpwebapps"
-Djava.endorsed.dirs="C:\Develop\tomcat\apache-tomcat-7.0.39\endorsed"
-Damishd.run.profileXXX=localhost -XX:+CMSClassUnloadingEnabled
-Dfile.encoding=UTF8 -Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true
-javaagent:"C:\Users\roztocil\.m2\repository\org\aspectj\aspectjweaver\1.6.7\aspectjweaver-1.6.7.jar"

In wtp.deploy.txt and catalina.home.lib.txt attachments you can see the the content of the respective folder. The endorsed folder doesn't exist at all.

ad 2) Yes, behaviour unchanged.

ad 3) With -noverify JVM crashes like this:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d90e92f, pid=1368, tid=5380
#
# JRE version: 6.0_43-b01
# Java VM: Java HotSpot(TM) Client VM (20.14-b01 mixed mode windows-x86 )
# Problematic frame:
# V  [jvm.dll+0x4e92f]
#
# An error report file with more information is saved as:
# C:\develop\icz\amishd\amishd_web\src\main\webapp\hs_err_pid1368.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

ad 4) I can't cacth your proposal. If I change Throwable for SQLException, I can't call aPjp.proceed() in @Around advices. And there are no other possible places for such change.
Comment 5 Bohuslav Roztočil CLA 2013-05-14 04:51:51 EDT
Created attachment 230928 [details]
Content of the %CATALINA_HOME%\lib folder.
Comment 6 Bohuslav Roztočil CLA 2013-05-14 04:53:11 EDT
Created attachment 230929 [details]
Content of the wtp.deploy folder.

"conflicting" jars marked with '###' at the end of the line.
Comment 7 Bohuslav Roztočil CLA 2013-05-14 04:57:09 EDT
About the severity of this issue:

I don't need this issue resolved, because I've found a workaround. But I've reported it to let you know about a problem, which for someone other could be blocking.
Comment 8 Jean-Louis CLA 2013-05-14 11:03:16 EDT
Sorry,
another possibility of conflicting jars is :
C:\Develop\tomcat\apache-tomcat-7.0.39\lib\tomcat-dbcp.jar
vs
C:\develop\icz\amishd\tomcat_deploy\wtpwebapps\amishd_web\WEB-INF\lib\commons-dbcp-1.4.jar

try to delete/rename one of them.

Also try to run JVM in server mode -server ( needs JDK)
Comment 9 Jean-Louis CLA 2013-05-14 11:07:18 EDT
I see also that a version 1.7.2 of aspectJ is used in WEB-INF/lib.
Try to use the same version for your aspectj agent ( in case of overweaving/reweaving ). Experts should be more clear than me.