Created attachment 67931 [details] The file has two macroses. See Attachment full description: Calling Shell causes hang if Pathname not found. Steps to reproduce (assumed that a command sp8bnrf2kx9s is invalid): 1. Download TestShell.ods 2. SAVE ALL DOCUMENTS IN LIBREOFFICE! Possible hanging! 3. Open TestShell.ods. Allow macros. 4. Press one of two buttons Current behaviour Hang. Only kill helps Expected behaviour Rising error 53: File not found. Operating system: Ubuntu 12.04 x86-64 Attachment full description: The file has two macroses associated with two buttons: Sub TestWait 'Associated with "TEST SHELL WITH WAITING" shell("sp8bnrf2kx9s",6,"",True) End Sub Sub TestNoWait 'Associated with "TEST SHELL WITHOUT WAITING" shell("sp8bnrf2kx9s",6,"",False) End Sub
On 4.3.3. I get "File not found" and crash. On 4.4 I get: Assertion failed! Program: ...gram Files (x86)\LibreOfficeDev 4\program\sblo.dll File : C:\cygwin\home\tinderbox\master\include\rtl/ustring.hxx Line: 421 Expression: index >= 0 &&static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength()) Win 7 64-bit 4.3.3.2 and Version: 4.4.0.0.alpha1+ Build ID: 8b21b5cbe78945b27525b4ce78ae3d981f90590f TinderBox: Win-x86@39, Branch:master, Time: 2014-11-06_03:55:51
Just a follow-up. Confirmed on: Ubuntu 14.04 LibreOffice 3.3 (inherited from OOo). Are we 100% sure that this isn't an enhancement request? Anyways, Updating version to reflect that I've confirmed on the oldest version (and thus not a regression). Also: Lowering priority. Major - hang but not going to affect the majority of users (probably going to affect a tiny fraction of users). Critical is reserved for crashes/hangs that will affect a large number of users. High - default is fine here.
On pc Debian x86-64 with master sources updated today, I could reproduce this. Part of bt: #2 0x00002aaaab2b5226 in __assert_fail_base (fmt=0x2aaaab3ebce8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x2aaaae2ecf10 "index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength())", file=file@entry=0x2aaaae2ecec8 "/home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx", line=line@entry=500, function=function@entry=0x2aaaae2ed740 <rtl::OUString::operator[](int) const::__PRETTY_FUNCTION__> "sal_Unicode rtl::OUString::operator[](sal_Int32) const") at assert.c:92 #3 0x00002aaaab2b52d2 in __GI___assert_fail (assertion=0x2aaaae2ecf10 "index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength())", file=0x2aaaae2ecec8 "/home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx", line=500, function=0x2aaaae2ed740 <rtl::OUString::operator[](int) const::__PRETTY_FUNCTION__> "sal_Unicode rtl::OUString::operator[](sal_Int32) const") at assert.c:101 #4 0x00002aaaae1f44f8 in rtl::OUString::operator[] (this=0x7fffffff36b0, index=13) at /home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx:500 #5 0x00002aaaae274036 in SbRtl_Shell (pBasic=0x3531fc0, rPar=..., bWrite=false) at /home/julien/compile-libreoffice/libreoffice/basic/source/runtime/methods.cxx:3613 #6 0x00002aaaae264be2 in SbiStdObject::Notify (this=0x3532380, rBC=..., rHint=...) at /home/julien/compile-libreoffice/libreoffice/basic/source/runtime/stdobj.cxx:848
Julien Nabet committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=41392516ca0fc099c383c4319923b895ecc16be6 tdf#55502: Shell BASIC function with empty third param hangs It will be available in 5.0.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.
For 4.4, there's a patch on gerrit: https://gerrit.libreoffice.org/#/c/15380/ I'd prefer waiting for the validation of this patch before putting this one to WFM. Indeed, even if with the patch, it doesn't crash, perhaps it's not right way to fix this.
Julien Nabet committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=a75d90740647414f55ef5a37bdfb230d624ec2eb Related tdf#55502: Harden a bit It will be available in 5.0.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.
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-4-4": http://cgit.freedesktop.org/libreoffice/core/commit/?id=ec485dc13bd16a3a9c168758cd742fe38e78b482&h=libreoffice-4-4 tdf#55502: Shell BASIC function with empty third param hangs It will be available in 4.4.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.