Bug 121337 - FileDateTime("\\nonexistent\smb\path") returns bogus result rather than throwing error
Summary: FileDateTime("\\nonexistent\smb\path") returns bogus result rather than throw...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: All Linux (All)
: medium normal
Assignee: Stephan Bergmann
URL:
Whiteboard: target:6.2.0 target:6.3.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2018-11-10 19:34 UTC by Jim Avera
Modified: 2019-04-27 11:03 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
FileDateTimeOnError.ods (contains a macro which demos the problem) (16.81 KB, application/vnd.oasis.opendocument.spreadsheet)
2018-11-10 19:35 UTC, Jim Avera
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Avera 2018-11-10 19:34:11 UTC
Description:
In BASIC macro code, FileDateTime("/unix/style/nonexistentfile") throws an error as it should, which can be caught with the "on error" mechanism.

However FileDateTime("\\smb\style\nonexistentfile"), when executed on a Unix platform at least, returns a bogus result string "01/03/-0001 00:00:00" instead of throwing an error.

Steps to Reproduce:
1. In a BASIC macro, call FileDateTime("\\bogus\path") in the context of an "on error" hook

(or run the macro in the attached demo spreadsheet)


Actual Results:
A bogus result string is returned. An error is not thrown.

Expected Results:
Should throw an error, or in any case behave the same way with Unix and SMB-style paths.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.2.0.0.alpha1
Build ID: ff46ad24d1d3cbcea45895520483ed1fd4ff488b
CPU threads: 12; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: threaded
Comment 1 Jim Avera 2018-11-10 19:35:48 UTC
Created attachment 146529 [details]
FileDateTimeOnError.ods (contains a macro which demos the problem)
Comment 2 Jim Avera 2018-11-10 19:37:36 UTC
In case it's relevant, I'm running Ubuntu 18.04
and package "smbfs" is versuib 2:4.7.6+dfsg~ubuntu-0ubuntu2.2
Comment 3 raal 2018-11-11 19:21:00 UTC
This seems to have begun at the below commit.
Adding Cc: to  Stephan Bergmann ; Could you possibly take a look at this one?
Thanks

d3d42ce1f5f0ba4ace90f2d4eba830f43fbd4e53 is the first bad commit
commit d3d42ce1f5f0ba4ace90f2d4eba830f43fbd4e53
Author: Matthew Francis <mjay.francis@gmail.com>
Date:   Fri Sep 18 10:53:27 2015 +0800

    source-hash-048e64e71fad3187d2165ed6eb0a42fdcd6e0caa
    
    commit 048e64e71fad3187d2165ed6eb0a42fdcd6e0caa
    Author:     Stephan Bergmann <sbergman@redhat.com>
    AuthorDate: Thu Mar 28 15:35:05 2013 +0100
    Commit:     Stephan Bergmann <sbergman@redhat.com>
    CommitDate: Thu Mar 28 15:35:43 2013 +0100
    
        Drop redundant typedef
    
        Change-Id: I13f1858babb1fb2b4120bcbf0e2e04a2a1f4bf88
Comment 4 Stephan Bergmann 2018-11-12 12:00:19 UTC
(In reply to raal from comment #3)
> This seems to have begun at the below commit.
> Adding Cc: to  Stephan Bergmann ; Could you possibly take a look at this one?
> Thanks
> 
> d3d42ce1f5f0ba4ace90f2d4eba830f43fbd4e53 is the first bad commit
> commit d3d42ce1f5f0ba4ace90f2d4eba830f43fbd4e53
> Author: Matthew Francis <mjay.francis@gmail.com>
> Date:   Fri Sep 18 10:53:27 2015 +0800

what bibisect repo is that from?
Comment 5 raal 2018-11-12 12:47:29 UTC
(In reply to Stephan Bergmann from comment #4)
> (In reply to raal from comment #3)
> > This seems to have begun at the below commit.
> > Adding Cc: to  Stephan Bergmann ; Could you possibly take a look at this one?
> > Thanks
> > 
> > d3d42ce1f5f0ba4ace90f2d4eba830f43fbd4e53 is the first bad commit
> > commit d3d42ce1f5f0ba4ace90f2d4eba830f43fbd4e53
> > Author: Matthew Francis <mjay.francis@gmail.com>
> > Date:   Fri Sep 18 10:53:27 2015 +0800
> 
> what bibisect repo is that from?

Hello, https://wiki.documentfoundation.org/QA/Bibisect/Linux#Versions
IIRC 41max repo
Comment 6 Commit Notification 2018-11-13 07:14:39 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/ca0308797df86ebece19260f3ca438a0cb437208%5E%21

tdf#121337: Fail on GIO error in GIO UCP getPropertyValue

It will be available in 6.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Stephan Bergmann 2018-11-13 08:09:50 UTC
(In reply to raal from comment #5)
> (In reply to Stephan Bergmann from comment #4)
> > (In reply to raal from comment #3)
> > > This seems to have begun at the below commit.
> > > Adding Cc: to  Stephan Bergmann ; Could you possibly take a look at this one?
> > > Thanks
> > > 
> > > d3d42ce1f5f0ba4ace90f2d4eba830f43fbd4e53 is the first bad commit
> > > commit d3d42ce1f5f0ba4ace90f2d4eba830f43fbd4e53
> > > Author: Matthew Francis <mjay.francis@gmail.com>
> > > Date:   Fri Sep 18 10:53:27 2015 +0800
> > 
> > what bibisect repo is that from?
> 
> Hello, https://wiki.documentfoundation.org/QA/Bibisect/Linux#Versions
> IIRC 41max repo

Looks bogus; note how

> $ git show --stat d3d42ce1f5f0ba4ace90f2d4eba830f43fbd4e53
> commit d3d42ce1f5f0ba4ace90f2d4eba830f43fbd4e53 (tag: source-hash-048e64e71fad3187d2165ed6eb0a42fdcd6e0caa)
> Author: Matthew Francis <mjay.francis@gmail.com>
> Date:   Fri Sep 18 10:53:27 2015 +0800
> 
>     source-hash-048e64e71fad3187d2165ed6eb0a42fdcd6e0caa
>     
>     commit 048e64e71fad3187d2165ed6eb0a42fdcd6e0caa
>     Author:     Stephan Bergmann <sbergman@redhat.com>
>     AuthorDate: Thu Mar 28 15:35:05 2013 +0100
>     Commit:     Stephan Bergmann <sbergman@redhat.com>
>     CommitDate: Thu Mar 28 15:35:43 2013 +0100
>     
>         Drop redundant typedef
>     
>         Change-Id: I13f1858babb1fb2b4120bcbf0e2e04a2a1f4bf88
> 
>  opt/program/classes/ScriptFramework.jar             | Bin 79755 -> 79755 bytes
>  opt/program/classes/ScriptProviderForBeanShell.jar  | Bin 19538 -> 19538 bytes
>  opt/program/classes/ScriptProviderForJava.jar       | Bin 10408 -> 10408 bytes
>  opt/program/classes/ScriptProviderForJavaScript.jar | Bin 14976 -> 14976 bytes
>  opt/program/classes/XMergeBridge.jar                | Bin 7008 -> 7008 bytes
>  opt/program/classes/bsh.jar                         | Bin 269036 -> 269036 bytes
>  opt/program/classes/commons-logging-1.1.1.jar       | Bin 51051 -> 51051 bytes
>  opt/program/classes/commonwizards.jar               | Bin 304457 -> 304457 bytes
>  opt/program/classes/flow-engine-0.9.4.jar           | Bin 280485 -> 280485 bytes
>  opt/program/classes/flute-1.1.6.jar                 | Bin 82841 -> 82841 bytes
>  opt/program/classes/form.jar                        | Bin 47915 -> 47915 bytes
>  opt/program/classes/hsqldb.jar                      | Bin 701102 -> 701102 bytes
>  opt/program/classes/js.jar                          | Bin 621769 -> 621769 bytes
>  opt/program/classes/libbase-1.1.6.jar               | Bin 121321 -> 121321 bytes
>  opt/program/classes/libfonts-1.1.6.jar              | Bin 207513 -> 207513 bytes
>  opt/program/classes/libformula-1.1.7.jar            | Bin 393458 -> 393458 bytes
>  opt/program/classes/liblayout-0.2.10.jar            | Bin 801656 -> 801656 bytes
>  opt/program/classes/libloader-1.1.6.jar             | Bin 124235 -> 124235 bytes
>  opt/program/classes/librepository-1.1.6.jar         | Bin 64066 -> 64066 bytes
>  opt/program/classes/libserializer-1.1.6.jar         | Bin 21763 -> 21763 bytes
>  opt/program/classes/libxml-1.1.7.jar                | Bin 76344 -> 76344 bytes
>  opt/program/classes/officebean.jar                  | Bin 45578 -> 45578 bytes
>  opt/program/classes/query.jar                       | Bin 16638 -> 16638 bytes
>  opt/program/classes/report.jar                      | Bin 58946 -> 58946 bytes
>  opt/program/classes/reportbuilder.jar               | Bin 295650 -> 295650 bytes
>  opt/program/classes/sac.jar                         | Bin 12967 -> 12967 bytes
>  opt/program/classes/sdbc_hsqldb.jar                 | Bin 10163 -> 10163 bytes
>  opt/program/classes/table.jar                       | Bin 31496 -> 31496 bytes
>  opt/program/classes/unoil.jar                       | Bin 1623077 -> 1623077 bytes
>  opt/program/classes/web.jar                         | Bin 115447 -> 115447 bytes
>  opt/program/classes/xmerge.jar                      | Bin 151645 -> 151645 bytes
>  opt/program/libfreebl3.so                           | Bin 902154 -> 902154 bytes
>  opt/program/libneon.so                              | Bin 1968093 -> 1968093 bytes
>  opt/program/libnspr4.so                             | Bin 734916 -> 734916 bytes
>  opt/program/libnss3.so                              | Bin 4315872 -> 4315872 bytes
>  opt/program/libnssckbi.so                           | Bin 989850 -> 989850 bytes
>  opt/program/libnssdbm3.so                           | Bin 491907 -> 491907 bytes
>  opt/program/libnssutil3.so                          | Bin 364355 -> 364355 bytes
>  opt/program/libooxlo.so                             | Bin 9092195 -> 9092195 bytes
>  opt/program/libplc4.so                              | Bin 51773 -> 51773 bytes
>  opt/program/libplds4.so                             | Bin 33950 -> 33950 bytes
>  opt/program/libqstart_gtklo.so                      | Bin 36940 -> 41560 bytes
>  opt/program/libscfiltlo.so                          | Bin 5900944 -> 5900944 bytes
>  opt/program/libsmime3.so                            | Bin 747159 -> 747159 bytes
>  opt/program/libsmlo.so                              | Bin 1455675 -> 1455675 bytes
>  opt/program/libsoftokn3.so                          | Bin 689388 -> 689388 bytes
>  opt/program/libssl3.so                              | Bin 895667 -> 895667 bytes
>  opt/program/libvcllo.so                             | Bin 7144615 -> 7144615 bytes
>  opt/program/libvclplug_gtklo.so                     | Bin 726142 -> 784503 bytes
>  opt/program/libwriterfilterlo.so                    | Bin 4917598 -> 4917598 bytes
>  opt/program/services/services.rdb                   |   2 +-
>  opt/program/setuprc                                 |   2 +-
>  opt/program/versionrc                               |   2 +-
>  opt/sdk/lib/libsalcpprt.a                           | Bin 5216 -> 5216 bytes
>  opt/share/Scripts/java/HelloWorld/HelloWorld.jar    | Bin 1540 -> 1540 bytes
>  opt/share/Scripts/java/Highlight/Highlight.jar      | Bin 4219 -> 4219 bytes
>  opt/share/Scripts/java/MemoryUsage/MemoryUsage.jar  | Bin 3193 -> 3193 bytes
>  opt/share/autocorr/acor_af-ZA.dat                   | Bin 4946 -> 4946 bytes
>  opt/share/autocorr/acor_bg-BG.dat                   | Bin 1249 -> 1249 bytes
>  opt/share/autocorr/acor_ca.dat                      | Bin 6383 -> 6383 bytes
>  opt/share/autocorr/acor_cs-CZ.dat                   | Bin 5940 -> 5940 bytes
>  opt/share/autocorr/acor_da-DK.dat                   | Bin 7259 -> 7259 bytes
>  opt/share/autocorr/acor_de-DE.dat                   | Bin 4003 -> 4003 bytes
>  opt/share/autocorr/acor_en-AU.dat                   | Bin 8212 -> 8212 bytes
>  opt/share/autocorr/acor_en-GB.dat                   | Bin 8185 -> 8185 bytes
>  opt/share/autocorr/acor_en-US.dat                   | Bin 8130 -> 8130 bytes
>  opt/share/autocorr/acor_en-ZA.dat                   | Bin 8035 -> 8035 bytes
>  opt/share/autocorr/acor_es-ES.dat                   | Bin 4526 -> 4526 bytes
>  opt/share/autocorr/acor_fa-IR.dat                   | Bin 58323 -> 58323 bytes
>  opt/share/autocorr/acor_fi-FI.dat                   | Bin 1514 -> 1514 bytes
>  opt/share/autocorr/acor_fr-FR.dat                   | Bin 4377 -> 4377 bytes
>  opt/share/autocorr/acor_ga-IE.dat                   | Bin 14029 -> 14029 bytes
>  opt/share/autocorr/acor_hr-HR.dat                   | Bin 5908 -> 5908 bytes
>  opt/share/autocorr/acor_hu-HU.dat                   | Bin 10124 -> 10124 bytes
>  opt/share/autocorr/acor_it-IT.dat                   | Bin 2093 -> 2093 bytes
>  opt/share/autocorr/acor_ja-JP.dat                   | Bin 7422 -> 7422 bytes
>  opt/share/autocorr/acor_ko-KR.dat                   | Bin 7422 -> 7422 bytes
>  opt/share/autocorr/acor_lb-LU.dat                   | Bin 5131 -> 5131 bytes
>  opt/share/autocorr/acor_lt-LT.dat                   | Bin 3176 -> 3176 bytes
>  opt/share/autocorr/acor_mn-MN.dat                   | Bin 4369 -> 4369 bytes
>  opt/share/autocorr/acor_nl-BE.dat                   | Bin 2802 -> 2802 bytes
>  opt/share/autocorr/acor_nl-NL.dat                   | Bin 2791 -> 2791 bytes
>  opt/share/autocorr/acor_pl-PL.dat                   | Bin 7925 -> 7925 bytes
>  opt/share/autocorr/acor_pt-BR.dat                   | Bin 21780 -> 21780 bytes
>  opt/share/autocorr/acor_pt-PT.dat                   | Bin 2360 -> 2360 bytes
>  opt/share/autocorr/acor_ru-RU.dat                   | Bin 4034 -> 4034 bytes
>  opt/share/autocorr/acor_sh-ME.dat                   | Bin 1371 -> 1371 bytes
>  opt/share/autocorr/acor_sh-RS.dat                   | Bin 1371 -> 1371 bytes
>  opt/share/autocorr/acor_sh-YU.dat                   | Bin 1371 -> 1371 bytes
>  opt/share/autocorr/acor_sk-SK.dat                   | Bin 4985 -> 4985 bytes
>  opt/share/autocorr/acor_sl-SI.dat                   | Bin 4957 -> 4957 bytes
>  opt/share/autocorr/acor_sr-ME.dat                   | Bin 1478 -> 1478 bytes
>  opt/share/autocorr/acor_sr-RS.dat                   | Bin 1478 -> 1478 bytes
>  opt/share/autocorr/acor_sr-YU.dat                   | Bin 1478 -> 1478 bytes
>  opt/share/autocorr/acor_sv-SE.dat                   | Bin 2773 -> 2773 bytes
>  opt/share/autocorr/acor_tr-TR.dat                   | Bin 2522 -> 2522 bytes
>  opt/share/autocorr/acor_vi-VN.dat                   | Bin 9532 -> 9532 bytes
>  opt/share/autocorr/acor_zh-CN.dat                   | Bin 7396 -> 7396 bytes
>  opt/share/autocorr/acor_zh-TW.dat                   | Bin 7396 -> 7396 bytes
>  opt/ure/share/java/java_uno.jar                     | Bin 5147 -> 5147 bytes
>  opt/ure/share/java/juh.jar                          | Bin 55844 -> 55844 bytes
>  opt/ure/share/java/jurt.jar                         | Bin 109080 -> 109080 bytes
>  opt/ure/share/java/ridl.jar                         | Bin 246697 -> 246697 bytes
>  opt/ure/share/java/unoloader.jar                    | Bin 4303 -> 4303 bytes
>  104 files changed, 3 insertions(+), 3 deletions(-)

changed way more files than looks plausible from the underlying source change <https://cgit.freedesktop.org/libreoffice/core/commit/?id=048e64e71fad3187d2165ed6eb0a42fdcd6e0caa> "Drop redundant typedef" (and which looks implausible to be related to this issue).

Anyway, the commit from comment 6 should fix the issue, for LO installations using the Linux GIO UCP to access smb URLs.
Comment 8 Commit Notification 2018-11-13 20:51:50 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/9950e50a0f304362f569d4dc0bd9ca30b7b6291d%5E%21

Set error also in non-UNO/UCB case file date failures, tdf#121337 follow-up

It will be available in 6.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2018-12-03 16:59:33 UTC
Zdeněk Crhonek committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/834c7c2698443332a347374db10e17d7862d6e4f%5E%21

add test for bug tdf#121337

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.