Download it now!
Bug 47209 - In SQL mode in Queries, Base crashes when a second SELECT followed by quotes is entered.
Summary: In SQL mode in Queries, Base crashes when a second SELECT followed by quotes ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.5.1 release
Hardware: x86-64 (AMD64) Linux (All)
: high critical
Assignee: Caolán McNamara
URL:
Whiteboard: target:4.1.0 target:3.6.7 target:4.0.4
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-11 13:23 UTC by c174536
Modified: 2013-04-16 14:17 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Log file running LibreOffice 3.5.1 with OpenJDK6 (19.69 KB, text/plain)
2012-03-17 09:40 UTC, d107375
Details
Log file running LibreOffice 3.5.1 with OpenJDK 7 (19.42 KB, text/plain)
2012-03-17 09:43 UTC, d107375
Details
Valgrind log (7.72 KB, application/x-bzip)
2012-03-18 15:35 UTC, d107375
Details
Strace log (1.02 MB, application/x-bzip)
2012-03-18 15:37 UTC, d107375
Details
strace log from LO 3.5.5.2 on Linux Mint 12 64 bit (110.66 KB, text/x-log)
2012-07-21 09:51 UTC, Alex Thurgood
Details
hs pid error log (114.13 KB, text/x-log)
2012-09-16 12:03 UTC, Alex Thurgood
Details
backtrace no symbols (30.16 KB, text/x-log)
2012-09-16 12:09 UTC, Alex Thurgood
Details

Note You need to log in before you can comment on or make changes to this bug.
Description c174536 2012-03-11 13:23:39 UTC
1) Open a database and create a new query in query editor.

2) Click in Activate/Deactivate design view (the button with the yellow ruler) to change to the SQL editor.

3) Type a simple input like this:

SELECT "tblEmployees"."EmployeeName" FROM "tblEmployees" ORDER BY "EmployeeName"

4) Run the query. It works fine. Now add this code after that one:

SELECT "

5) Base crashes when you type double quotes after the words SELECT.

I know nothing about SQL, but even though this code may not be correct, it was not supposed to crash.

Thanks.
Comment 1 Julien Nabet 2012-03-12 15:27:55 UTC
On pc x86-64, I don't reproduce this on 3.5 branch.
- could you try to reproduce this on a brand new file ?
- could you try to reproduce it on 3.5.0 ?
Comment 2 d107375 2012-03-15 20:04:03 UTC
Hello Julien, sorry for delaying the answer. By the way, I am the original author of the question, just with a different username (because I lost the data from the other account, created with a disposable email lol)

So, regarding your questions the answers are: yes and yes!

This bug persists in version 3.5.1 running in ArchLinux x86_64.

Here you can reproduce it with a new file:

1) Open LibreOffice Base and create a new file. (I didn't register the database)

2) With the empty database (no tables), go to Queries and Create a new query in the editor.

3) It will ask you to choose between Tables or Queries. As you don't have any, just close it.

4) Change to SQL mode where you can insert the code directly (clicking on the button with the yellow rule)

5) Type this:

SELECT " "

" "

6) Base crashes in the 4th double quote (don't forget to respect the blank line).

This error does not occur in LibreOffice 3.5.1 in Windows XP. By the way, I use PT-BR langpack in Linux and Windows XP.

Tell me if you can reproduce the error now.

Thanks!
Comment 3 d107375 2012-03-17 09:40:53 UTC
Created attachment 58609 [details]
Log file running LibreOffice 3.5.1 with OpenJDK6

This is the log file with the bug reproduced running LibreOffice 3.5.1 with OpenJDK 6 in Arch Linux x86_64.

Here the program crashes when I open an existing file, click in Queries and click in Create query in the SQL editor. I can't even enter in the SQL editor.
Comment 4 d107375 2012-03-17 09:43:02 UTC
Created attachment 58610 [details]
Log file running LibreOffice 3.5.1 with OpenJDK 7

And this is the log file running it with OpenJDK 7.

It happens exactly as it happened with OpenJDK 6. I'm just posting it because it can be helpful too.
Comment 5 Julien Nabet 2012-03-17 10:50:56 UTC
I still don't reproduce it on master or on 3.5 branch (both updated today) (Forgot to say in previous message, I'm on Debian).

Did you try to remove/backup your LO profile (see ~/.config/libreoffice or ~/.libreoffice check both) ?
Have you got any extension ? If yes, could you disable them just for the test ?

If you still reproduce it, above all with OpenJdk 6 (cause I think there are still problems with Java 7), could you install the debug symbol package (in Debian it's called "libreoffice-dbg") ?
So you could attach the logs with symbols.
Comment 6 d107375 2012-03-18 15:35:46 UTC
Created attachment 58645 [details]
Valgrind log

This is the Valgrind log.

I've opened LibreOffice and chose Base, opened a blank document, clicked in "Queries", clicked in "Create Query in SQL View..." and typed this:

SELECT " "

" "

It crashed after typing the fourth double quote.
Comment 7 d107375 2012-03-18 15:37:43 UTC
Created attachment 58646 [details]
Strace log

This is the Strace log.

I've opened LibreOffice and chose Base, opened a blank document, clicked in
"Queries", clicked in "Create Query in SQL View..." and typed this:

SELECT " "

" "

It crashed after typing the fourth double quote.
Comment 8 d107375 2012-03-18 15:42:06 UTC
I've also downloaded Linux Mint 12 (LiveCD - 64 bits) and could reproduce the bug exactly like in Arch Linux.

I suppose this bug only happens in Linux 64 bits, since some people using x686 could not reproduce it: https://bbs.archlinux.org/viewtopic.php?id=137842

Althought you Julien could not reproduce it using Debian 64 bits.

Thanks!
Comment 9 Julien Nabet 2012-03-19 13:19:24 UTC
I took a look at valgrind.log, found a lot of invalid write and quite often it was linked to a call of Javavm.

Here are information about the OpenJdk I use : 
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-3)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

Could you give your version ?
Comment 10 d107375 2012-03-21 07:08:13 UTC
Hello Julien, my Java version is the same of yours:

java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (ArchLinux-6.b24_1.11.1-3-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

I couldn't test it in Debian Squeeze LiveCD because it uses OpenOffice.org and it gave an error when I clicked in Tables, probably because it's necessary to install additional packages.

If you tell me how to install LibreOffice with Debian, maybe I can try to reproduce this error there as well.

Thanks.
Comment 11 Julien Nabet 2012-03-21 07:15:06 UTC
(In reply to comment #10)
...
> If you tell me how to install LibreOffice with Debian, maybe I can try to
> reproduce this error there as well.
> 
I use Debian testing.
If you do an apt-cache search libreoffice, you should see the LO packages.
Then just install it.

Suggestion : before installing LO, I would remove Openoffice with apt-get remove --purge so there are not conflicts or something. Check profiles (~/.config/libreoffice, ~/.config/openoffice, ~/.openoffice, ~/.libreoffice)
Comment 12 Alex Thurgood 2012-07-21 09:34:56 UTC
Can not reproduce on LinuxMint 12, 64bit with LO 3.4.4 and JVM 1.6.0_24


Alex
Comment 13 Alex Thurgood 2012-07-21 09:48:11 UTC
Reproduced with LO 3.5, but ONLY IF I enter 2 new line carriage return key presses in the SQL editor and then type the SELECT " string sequence :

LibreOffice 3.5.5.2 
Build ID: 24b32b4-b87ec2e-85c8e98-87a4e20-9a1b8c1

alex@Aspire-T180 ~ $ /opt/libreoffice3.5/program/soffice --base
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f758bc8fbcd, pid=32246, tid=140142879820032
#
# JRE version: 6.0_26-b03
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.1-b02 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libsvtlo.so+0x257bcd]  MultiLineEditSyntaxHighlight::DoBracketHilight(unsigned short)+0x10d
#
# An error report file with more information is saved as:
# /home/alex/hs_err_pid32246.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

[error occurred during error reporting , id 0xb]
Comment 14 Alex Thurgood 2012-07-21 09:51:17 UTC
Created attachment 64484 [details]
strace log from LO 3.5.5.2 on Linux Mint 12 64 bit
Comment 15 Alex Thurgood 2012-07-21 09:52:09 UTC
Confirming as I can reproduce the behaviour.
Comment 16 Alex Thurgood 2012-07-21 09:54:03 UTC
Julien,

This should be assigned to Lionel, or do you want to take it ? I'll adjust the "assigned to" accordingly. At the moment, this is incorrectly assigned to the OP.


Alex
Comment 17 Alex Thurgood 2012-09-03 15:12:05 UTC
@lionel : care to take a look ?


Alex
Comment 18 Alex Thurgood 2012-09-03 15:15:27 UTC
Also reported on the German discuss list this afternoon by another user.


Alex
Comment 19 Lionel Elie Mamane 2012-09-04 00:23:45 UTC
Cannot reproduce on my 3.5 dev tree (debug build with symbols).

Can reproduce on official 3.5.5.3 binaries.

Can reproduce on official 3.6.1.4 binaries.


Can anybody reproduce in a build with symbols, and show a detailed backtrace (gdb command "bt full")?

Can anybody reproduce in a debug build?
Comment 20 Julien Nabet 2012-09-04 05:52:43 UTC
I'll give a try after my daytime job tonight. I've got 3.5, 3.6 and master sources.
Comment 21 Lionel Elie Mamane 2012-09-04 05:59:36 UTC
Cannot reproduce in my 3.6 dev tree either.
Comment 22 Julien Nabet 2012-09-04 17:57:15 UTC
I didn't try on 3.6 or master, only on 3.5 (updated today) for the moment but I still don't reproduce it.

Now what the exact thing to type?
I try this:
- 2 blank lines
- SELECT " " + return carriage
- " " + 1 return carriage
nothing

Lionel: since you can't reproduce it on 3.6 branch, it may be ok in master. Anyway, do you reproduce it on 3.5 branch?
Comment 23 Lionel Elie Mamane 2012-09-04 18:09:13 UTC
(In reply to comment #22)

> Now what the exact thing to type?
> I try this:
> - 2 blank lines
> - SELECT " " + return carriage
> - " " + 1 return carriage
> nothing

For me, I do:

 SELECT "baz"."bar", "baz"."foo" FROM "baz"

 SELECT " "

Where baz, bar and foo are real table and column names from the database

> Lionel: since you can't reproduce it on 3.6 branch, it may be ok in master.
> Anyway, do you reproduce it on 3.5 branch?

I reproduce on official builds, also of 3.6 branch, but not on any development (debug) build.
Comment 24 Julien Nabet 2012-09-04 19:00:15 UTC
I create a table ("baz") with only 2 columns "foo" and "bar" ("TEXT VARCHAR") both, no primary key, default options, no lines in it.
I used each time "Create Query in SQL View". Copy pasted or typed it, still nothing.
I opened the base with 3.5.4.2 Debian package too, the same...
Nothing special in console too.
Comment 25 Alex Thurgood 2012-09-05 10:22:12 UTC
Version 3.7.0.0.alpha0+ (Build ID: 4deb9d4)

Can no longer reproduce with the above build from master on OSX 10.8.1, this is WFM.

Alex
Comment 26 Jochen 2012-09-15 16:32:59 UTC
(In reply to comment #25)

Hi Alex and Julien,

what´s your opinion: can status be changed to "RESOLVED FIXED/WORKSFORME"?
Comment 27 Julien Nabet 2012-09-15 17:06:12 UTC
(In reply to comment #26)
> (In reply to comment #25)
> 
> Hi Alex and Julien,
> 
> what´s your opinion: can status be changed to "RESOLVED FIXED/WORKSFORME"?
Since I never succeeded in reproducing it, perhaps I missed something so I let Alex or Lionel decide about this.
If it depended on me only, I would put WFM and indicate to not hesitate to reopen if it can be reproduced (+ give steps how to reproduce)
Comment 28 Lionel Elie Mamane 2012-09-15 20:30:18 UTC
(In reply to comment #26)
> (In reply to comment #25)

> what´s your opinion: can status be changed to "RESOLVED FIXED/WORKSFORME"?

No, since I reproduce, unless we check it is fixed in a new *official* (non-debug) *build*.
Comment 29 Alex Thurgood 2012-09-16 12:02:19 UTC
Yep, still broken on LOdev daily build 64bit from 13/09.

Enclosing log and following output message on console :

/opt/lodev3.6/program/soffice
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fc8baf55dbd, pid=3516, tid=140500156614912
#
# JRE version: 6.0_26-b03
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.1-b02 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libsvtlo.so+0x27adbd]  MultiLineEditSyntaxHighlight::DoBracketHilight(unsigned short)+0x10d
#
# An error report file with more information is saved as:
# /home/alex/hs_err_pid3516.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

[error occurred during error reporting , id 0xb]
Comment 30 Alex Thurgood 2012-09-16 12:03:18 UTC
Created attachment 67238 [details]
hs pid error log
Comment 31 Alex Thurgood 2012-09-16 12:09:29 UTC
Created attachment 67239 [details]
backtrace no symbols
Comment 32 Caolán McNamara 2013-04-16 12:37:57 UTC
I can reproduce this
Comment 33 Commit Notification 2013-04-16 12:56:12 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=02917cb57e2c2e9fcab2db8f72960023f3e4edaf

Resolves: fdo#47209 and rhbz#927223 syntax highlighter crash



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 34 Caolán McNamara 2013-04-16 13:12:22 UTC
patch proposed in gerrit for 4-0 and 3-6
Comment 35 Commit Notification 2013-04-16 14:17:38 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=02da63878e7cfbc85e6bce74e1b7b0fb71a8ebec&h=libreoffice-3-6

Resolves: fdo#47209 and rhbz#927223 syntax highlighter crash


It will be available in LibreOffice 3.6.7.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 36 Commit Notification 2013-04-16 14:17:56 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a4e27ec2be678fe126e49a5c8a9be4adc5cd6159&h=libreoffice-4-0

Resolves: fdo#47209 and rhbz#927223 syntax highlighter crash


It will be available in LibreOffice 4.0.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.