Apache OpenOffice (AOO) Bugzilla – Issue 128589
Crash if use EnumableMap put method embed in a function
Last modified: 2024-02-02 17:39:04 UTC
This code works: Sub Main oVar = com.sun.star.container.EnumerableMap.create("string", "string") oVar.put("Foo","") oVar.put("Bar","") End Sub So now, I create 2 functions to embed .put method and check if key exists Warning, this code crashed AOO: Sub Main oVar = com.sun.star.container.EnumerableMap.create("string", "string") EnumAddKey(oVar, "Foo") EnumAddKey(oVar, "Bar") End Sub Function EnumAddKey(oTmp, sTmp) if EnumCheckKey(oTmp, sTmp) then msgbox "Key already exists: " & sTmp exit function endif oTmp.put(sTmp, "") EnumAddKey = oTmp End function Function EnumCheckKey(oTmp, sTmp) sRet = false oEnum = oTmp.createKeyEnumeration(False) Do While oEnum.hasMoreElements sItem = oEnum.nextElement if sTmp = sItem then sRet = true : exit do Loop EnumCheckKey = sRet End function It failed on second EnumAddKey function call in oTmp.put line for no reason Tested on Debian and Win10 with same (bad) result.
Works perfectly here, on FreeBSD 14.0, AOO trunk at commit f772f8bcada2271f2a87d325fb11fb21c8a19b20, debug build. Also works fine on FreeBSD with: - an older version of AOO trunk, debug build. - f331e23ffae9e26f93997dc8f02086c5733e80df (the merge base between trunk and 4.1.x) from 2014-02-25, debug build. But crashes on: - 4e549649559c9592d2292549945507e18df42348 from 2018-01-04, Windows build on Wine on FreeBSD, release build. - 71bc2237ed32a770b27c542d9e9f101134b193a4 from 2017-07-01, Windows build on Wine on FreeBSD, release build. - f9124e1e1a8486de2fb603f628b652a5ff012fd6 from 2015-11-25, Windows build on Wine on FreeBSD, release build. So do debug builds work while release builds crash, or is FreeBSD particularly immune to crashes for some reason?
Can you please try with our AOO420-dev5 build: https://dist.apache.org/repos/dist/dev/openoffice/4.2.0-Dev5/
(In reply to Matthias Seidel from comment #2) > Can you please try with our AOO420-dev5 build: > > https://dist.apache.org/repos/dist/dev/openoffice/4.2.0-Dev5/ This crashes too :-(.
(In reply to damjan from comment #3) > (In reply to Matthias Seidel from comment #2) > > Can you please try with our AOO420-dev5 build: > > > > https://dist.apache.org/repos/dist/dev/openoffice/4.2.0-Dev5/ > > This crashes too :-(. OK, Windows and Linux?
(In reply to Matthias Seidel from comment #4) > (In reply to damjan from comment #3) > > (In reply to Matthias Seidel from comment #2) > > > Can you please try with our AOO420-dev5 build: > > > > > > https://dist.apache.org/repos/dist/dev/openoffice/4.2.0-Dev5/ > > > > This crashes too :-(. > > OK, Windows and Linux? Windows crashes. Xubuntu 23.04 works - I only get a crash later, when exiting, in a Bitmap destructor in vcl, probably unrelated to this bug.