Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 324947

Summary: Eclipse main thread loops endless in lpg.lpgjavaruntime.LexParser.parseCharacters, lines 133 to 191
Product: [Tools] Data Tools Reporter: Jörg Thönnes <jtk499>
Component: SQL Query ParserAssignee: dtp.sqldevtools-inbox <dtp.sqldevtools-inbox>
Status: NEW --- QA Contact:
Severity: blocker    
Priority: P3 CC: bpayton, pierre.queinnec
Version: 1.8   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
jstack trace of Eclipse during blocked GUI
none
Screen capture of SQL Query Builder opened on insert statement
none
Eclipse Configuration Details none

Description Jörg Thönnes CLA 2010-09-10 06:54:55 EDT
Today I use the SQL Query Builder for the first time and it made Eclipse unusable:


h1. Steps to Reproduce

* Goto to Database Development Perspective
* Connect to local PostgreSQL 8.4.3 database
* Open scrapbook to to edit SQL statements
* Paste this SQL expression:

bc. 

        INSERT INTO member_configuration
        SELECT
            member_id,
            true as "immediate_result_propagation_disabled_for_expiry"
        FROM
            member
        WHERE
            member_id like 'yyy%xxx';


* Select All
* Right-click and "Edit in SQL Query Builder ..."

h2. Expected Result

* The query builder opens with the selected SQL statement

h2. Actual Result

* Eclipse GUI hangs forever, no updates

h1. Analysis

I have a small script to repeatedly call jstack in fixed intervals, here I used 0.5 and 0.1 seconds.
Comparing the resulting jstack traces using diff shows that only one line changes, the other stay the same:

bc.
	at lpg.lpgjavaruntime.LexParser.parseCharacters(LexParser.java:133)
	at lpg.lpgjavaruntime.LexParser.parseCharacters(LexParser.java:160)
	at lpg.lpgjavaruntime.LexParser.parseCharacters(LexParser.java:170)
	at lpg.lpgjavaruntime.LexParser.parseCharacters(LexParser.java:177)
	at lpg.lpgjavaruntime.LexParser.parseCharacters(LexParser.java:178)
	at lpg.lpgjavaruntime.LexParser.parseCharacters(LexParser.java:179)
	at lpg.lpgjavaruntime.LexParser.parseCharacters(LexParser.java:186)
	at lpg.lpgjavaruntime.LexParser.parseCharacters(LexParser.java:190)
	at lpg.lpgjavaruntime.LexParser.parseCharacters(LexParser.java:191)

Therefore, I conclude that the code runs end-less (or at least longer than I could wait) in this area.
Will attached one example stack trace to show that this happens in the main thread. Therefore, the GUI is blocked.




-- Configuration Details --
Product: Eclipse 1.3.0.20100617-0521 (org.eclipse.epp.package.jee.product)
Installed Features:
 org.eclipse.platform 3.6.0.v20100602-9gF78GpqFt6trOGhL60z0oEx3fz-JKNwxPY
Comment 1 Jörg Thönnes CLA 2010-09-10 06:56:35 EDT
Created attachment 178605 [details]
jstack trace of Eclipse during blocked GUI

This is one example of stack traces. The others are the same, just differing in one line listed in the description.
Comment 2 Brian Payton CLA 2010-09-10 15:24:37 EDT
I tried to reproduce this problem, but it does not fail for me.  I am attaching a screen capture of the SQL Query Builder when it has opened on the Insert statement you provided.

I need more information about your environment in order to try to figure out this problem.

I noticed that the traceback has line numbers, including in the lexer.  Do you have all the source code in your workspace, including LPG?

Here's my environment:
 DTP 1.8.1 (DTP 1.8 should be the same)
 Eclipse 3.6 SR1 (Eclipse 3.6 should be the same)
 EMF 2.6.0
 GEF 3.6.1 RC3 (GEF 3.6.0 should be the same)
 Database Connection: DB2 for LUW v9.7
Comment 3 Brian Payton CLA 2010-09-10 15:26:02 EDT
Created attachment 178653 [details]
Screen capture of SQL Query Builder opened on insert statement
Comment 4 Jörg Thönnes CLA 2010-09-13 06:03:38 EDT
(In reply to comment #2)
> I tried to reproduce this problem, but it does not fail for me.  I am attaching
> a screen capture of the SQL Query Builder when it has opened on the Insert
> statement you provided.

I do not get that far. Eclipse freezes with the pop-up window shown.

> I need more information about your environment in order to try to figure out
> this problem.

Ubuntu 10.04, Eclipse 3.6. Will attach the output of Help / About Eclipse... / Installation Details / Configuration.

> I noticed that the traceback has line numbers, including in the lexer.  Do you
> have all the source code in your workspace, including LPG?

No, I am not aware of any source code installed. I have just installed the Eclipse 3.6 JEE package.
And added a couple of other packages not related to SQL.

> Here's my environment:
> DTP 1.8.1 (DTP 1.8 should be the same)
> Eclipse 3.6 SR1 (Eclipse 3.6 should be the same)
> EMF 2.6.0
> GEF 3.6.1 RC3 (GEF 3.6.0 should be the same)
> Database Connection: DB2 for LUW v9.7

Besides using Eclipse 3.6 with DTP 1.8 and GEF 3.6.0 I am using PostgreSQL 8.4.3.
Could you give it a try with PostgreSQL?
Comment 5 Jörg Thönnes CLA 2010-09-13 06:28:07 EDT
Created attachment 178728 [details]
Eclipse Configuration Details

see my configurations details, truncated at "User Preferences"
Comment 6 Pierre Queinnec CLA 2011-10-11 16:21:54 EDT
Hi Jörg!

I tried to reproduce but couldn't. I used :

- Eclipse 3.4
- PostgreSQL 8.4.8
- Debian 6.0
- the following DDL to create the tables (but it also doesn't crash without the tables):

create table member (
	member_id varchar
);

create table member_configuration (
	member_id varchar,
	immediate_result_propagation_disabled_for_expiry bool
);

On a side note, the SQL Builder doesn't do much with PostgreSQL right now, and I'll try to fix that.
I'll also try to reproduce with a newer Eclipse (3.6 like you). I'll keep you posted.
Comment 7 Jörg Thönnes CLA 2011-10-12 02:28:32 EDT
(In reply to comment #6)
> [...]
> On a side note, the SQL Builder doesn't do much with PostgreSQL right now, and
> I'll try to fix that.
> I'll also try to reproduce with a newer Eclipse (3.6 like you). I'll keep you
> posted.

Salut Pierre,

thanks for keeping me updated. I did not use SQL inside Eclipse for a while now,
but will be happy to provide further details. Please note, that I am about to
switch to Eclipse 3.7 now.

A+, Jörg
Comment 8 Pierre Queinnec CLA 2012-05-16 15:00:34 EDT
Salut Jörg!

Did you switch to Eclipse 3.7? Could you try to reproduce if you get the chance?
Many thanks!
Comment 9 Jörg Thönnes CLA 2012-05-21 06:11:33 EDT
(In reply to comment #8)
> Salut Jörg!
> 
> Did you switch to Eclipse 3.7? Could you try to reproduce if you get the chance?
> Many thanks!

Salut Pierre,

I am working with 3.7.2 for a while now, but did not check yet.
Will do so in the next time.

Cheers, Jörg