Recent

Author Topic: Running fpspreadsheet on Ubuntu  (Read 10368 times)

wp

  • Hero Member
  • *****
  • Posts: 13560
Running fpspreadsheet on Ubuntu
« on: December 26, 2013, 08:41:04 pm »
The demo project excel8write.lpi creates a test Excel file "test.xls" containing some test cells. The parameter "OverwriteExisting" in TsWorkbook.WriteToFile determines how existing files are treated when the file is written. If true the demo project silently overwrites an existing file on Windows. On Ubuntu, however, a SIGSEGV occurs with the message "In file 'uvirtuallayer_ole.pas' at line 590: if FDirectory[j]._mse=BYTE(STGTY_INVALID) then begin". When the file is deleted before starting excel8write the program runs fine.

In the test suite, TestReadString4 and TestReadString6 fail on Ubuntu: "Test value mismatch cell Texts!A5 expected: <café au lait> but was: <caf? au lait>"
« Last Edit: December 26, 2013, 09:10:07 pm by wp »

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Running fpspreadsheet on Ubuntu
« Reply #1 on: December 27, 2013, 10:38:20 am »
Strange. Just wrote & committed a test for the overwrite problem.

Ran testsuite on Debian unstable (I think, could be testing), x64.
However, did it with FPC trunk/Laz trunk, you're probably using another version?
Quote
Number of run tests: 120
Number of errors:    0
Number of failures:  0

Perhaps locale-related??
Quote
locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Quote
file stringtests.pas
stringtests.pas: UTF-8 Unicode text
... as expected
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Running fpspreadsheet on Ubuntu
« Reply #2 on: December 27, 2013, 11:17:12 am »
Just compiled tests FPC 2.6.2+Laz (some revision) on that Debian machine and still all tests succeed...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

wp

  • Hero Member
  • *****
  • Posts: 13560
Re: Running fpspreadsheet on Ubuntu
« Reply #3 on: December 27, 2013, 01:23:19 pm »
Quote
FPC trunk/Laz trunk, you're probably using another version
fpc 2.6.3, Laz trunk (r.43585), x84

Quote
Perhaps locale-related??
Mine is de_DE.utf8 in all cases.


BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Running fpspreadsheet on Ubuntu
« Reply #4 on: December 27, 2013, 01:33:48 pm »
Mmm... I wonder if we need to explicitly add lconvencoding, lazutf8 etc to the strings test page and/or cwstring?
TBH, I've ignored encoding for a while and haven't looked into what kind of magic is needed to get everything set up in FPC 2.6 as well as trunk. I was just glad the tests worked...

The other issue:
Does testcase TSpreadInternalTests.OverwriteExistingFile fail for you?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

wp

  • Hero Member
  • *****
  • Posts: 13560
Re: Running fpspreadsheet on Ubuntu
« Reply #5 on: December 27, 2013, 07:33:42 pm »
Quote
Does testcase TSpreadInternalTests.OverwriteExistingFile fail for you?
No, but TSpreadManualTests.TestBiff8CellBackgroundColor() fails in Workbook.WriteToFile (manual xls file, of course, is closed). Debugging deeper, I come into TOLEStorage.WriteOLEFile which crashes in the line

Code: [Select]
OLEStream:=fsOLE.CreateStream(VLAbsolutePath,fmCreate); 
Unfortunately, this OLE thing is beyond my capabilities...

Regarding the localization issue, I saw a record "COUNTRY" in the biff description: "This record stores two Windows country identifiers. The first represents the Windows user interface language of the Excel version that saved the file, and the second represents the system regional settingsat the time the file was saved" (section 5.22). As far as I can see see this record is missing in xlsbiff8.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Running fpspreadsheet on Ubuntu
« Reply #6 on: December 27, 2013, 08:16:44 pm »
Quote
Does testcase TSpreadInternalTests.OverwriteExistingFile fail for you?
No, but TSpreadManualTests.TestBiff8CellBackgroundColor() fails in Workbook.WriteToFile (manual xls file, of course, is closed).
Stranger and stranger. The test OverwriteExistingFile  uses biff8 format as well... What's the difference, I'd say!?!
Will have a look at the exact code probably tomorrow.

Debugging deeper, I come into TOLEStorage.WriteOLEFile which crashes in the line

Code: [Select]
OLEStream:=fsOLE.CreateStream(VLAbsolutePath,fmCreate); 
Unfortunately, this OLE thing is beyond my capabilities...
Certainly beyond mine.

Regarding the localization issue, I saw a record "COUNTRY" in the biff description: "This record stores two Windows country identifiers. The first represents the Windows user interface language of the Excel version that saved the file, and the second represents the system regional settingsat the time the file was saved" (section 5.22). As far as I can see see this record is missing in xlsbiff8.
Well, given that the tests don't fail on my Linux machine and we're not yet testing interoperability with Excel, I wonder whether that record would have any effect...

Time to expand the test suite to at least Libre/OpenOffice, I'd think...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Running fpspreadsheet on Ubuntu
« Reply #7 on: January 08, 2014, 04:43:31 pm »
Just committed an explicit codepage specification for FPC trunk (has no influence on 2.6.x) for stringtests.pas which may fix the issue - at least on trunk...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

wp

  • Hero Member
  • *****
  • Posts: 13560
Re: Running fpspreadsheet on Ubuntu
« Reply #8 on: January 09, 2014, 12:20:26 am »
Upgraded my Ubuntu fpc and Laz to current trunk each and ran the test. TestReadString4 and TestReadString6, however, still failing.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Running fpspreadsheet on Ubuntu
« Reply #9 on: January 09, 2014, 10:29:29 am »
Arggh. Thanks for testing.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018