Bug Hunting Session
Bug 117670 - Firebird: Migration: Libo enters race condition when certain odb files are migrated
Summary: Firebird: Migration: Libo enters race condition when certain odb files are mi...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:6.1.0
Keywords:
Depends on:
Blocks: Database-Firebird-Migration
  Show dependency treegraph
 
Reported: 2018-05-17 13:47 UTC by Drew Jensen
Modified: 2018-05-25 13:31 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
screen shot of system monitor (344.97 KB, image/png)
2018-05-17 13:48 UTC, Drew Jensen
Details
bt with debug symbols (7.15 KB, text/plain)
2018-05-17 18:00 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Drew Jensen 2018-05-17 13:47:26 UTC
Description:
Found with today's build:
Version: 6.1.0.0.alpha1+
Build ID: 47dc3115f12ff16dc326b6edd12c46e6a6ef1843
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2018-05-17_00:32:17
Locale: en-US (en_US.UTF-8); Calc: group

NOTE: ran the same test file against a build from 3 days back, no race condition it just fails to migrate.

Steps to Reproduce:
1. Download and first attached file (budget.odb) from https://bugs.documentfoundation.org/show_bug.cgi?id=116987
2. click on tables and answer Yes to start migration


Actual Results:  
Cpu runs at 100% and Libo must be forced to terminate.

Expected Results:
Migration routine starts and ends with success or an error message. 


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/66.0.3359.139 Chrome/66.0.3359.139 Safari/537.36
Comment 1 Drew Jensen 2018-05-17 13:48:53 UTC
Created attachment 142162 [details]
screen shot of system monitor

Screen shot including system monitor, soffice is running cpu at 25% (one of the four cores is pegged).
Comment 2 Julien Nabet 2018-05-17 18:00:30 UTC
Created attachment 142169 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated today, I got an assert.

The pb is some column names are made from 2 words, it confuses the parser.
Comment 3 Drew Jensen 2018-05-17 18:40:15 UTC
ah - yes indeed, saw your comment and tried just a single column name 'a col name' and while hsql and firebird both support this the migration routine barfs. 

firebird_sdbc error:
*Dynamic SQL Error
*SQL error code = -104
*Unexpected end of command - line 1, column 122
caused by
'isc_dsql_prepare'

Went back and added a second table, that would not trigger an error, I thought perhaps this (the race condition) was something to do with a recent patch to allow the migration to continue even if it can't bring in every table. But no, that patch worked as expected, the first table with the 'a col name' column failed to migrate, with an error message (above) and the second table with a column 'a_col_name' migrated in just fine.
Comment 4 raal 2018-05-19 05:56:57 UTC
I can confirm "Cpu runs at 100% and Libo must be forced to terminate." with Version: 6.1.0.0.alpha1+
Build ID: 44a468323f3f011c41f892117f418987f9c98477
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk3;
Comment 5 Commit Notification 2018-05-24 11:23:40 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9082e37400baf75296cb94c5588ddeb3d18f0b09

tdf#117670: migration Firebird, deal with multiword column

It will be available in 6.1.0.

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 6 Julien Nabet 2018-05-24 14:13:56 UTC
Waiting for your feedback before putting it at FIXED or not.
Comment 7 Drew Jensen 2018-05-25 13:14:29 UTC
Ok - so I gave this a try against the attached odb and using the daily build from the 25th (which included the patch).

The migration procedure now produces a couple of error messages (displayed via one message box) and then finishes.

Threw a few others at it, which each generated different errors during migation, again nothing sent it off to the races, each did as expected showing an error message(s) and finishing.

Setting issue resolved.
Comment 8 Drew Jensen 2018-05-25 13:18:48 UTC
(In reply to Julien Nabet from comment #6)
> Waiting for your feedback before putting it at FIXED or not.

sorry, I should of let you change the status, you did the work and it is nice feeling to flip that flag.
Comment 9 Julien Nabet 2018-05-25 13:22:22 UTC
(In reply to Drew Jensen from comment #8)
> (In reply to Julien Nabet from comment #6)
> > Waiting for your feedback before putting it at FIXED or not.
> 
> sorry, I should of let you change the status, you did the work and it is
> nice feeling to flip that flag.

No pb :)
Thank you for your feedback.
I let you flip the flag again at VERIFY then ;-)
Comment 10 Drew Jensen 2018-05-25 13:31:12 UTC
(In reply to Julien Nabet from comment #9)
> (In reply to Drew Jensen from comment #8)
> > (In reply to Julien Nabet from comment #6)
> > > Waiting for your feedback before putting it at FIXED or not.
> > 
> > sorry, I should of let you change the status, you did the work and it is
> > nice feeling to flip that flag.
> 
> No pb :)
> Thank you for your feedback.
> I let you flip the flag again at VERIFY then ;-)

Oh a double dipper.. OK done.