icupkg: string storage overflow

6 views
Skip to first unread message

Christian Maurer

unread,
7:51 AM (12 hours ago) 7:51 AM
to icu-support
Hi all!

When compiling icu4c with additional locales in the most recent ICU 78.1 the build stops with a 'string storage overflow' error.

echo "$ICUDATA_LIST_CONTENT" > ./out/tmp/icudata.lst
echo timestamp > build-local
LD_LIBRARY_PATH=../stubdata:../tools/ctestfw:../lib:$LD_LIBRARY_PATH  ../bin/pkgdata -O ../data/icupkg.inc -q -c -s /home/build/devel/EXTLIBS/linux/clang21el10/ICU/78.1/shared/data/out/build/icudt78l -d ../lib -e icudt78  -T ./out/tmp -p icudt78l -m dll -r 78.1 -L icudata ./out/tmp/icudata.lst
icupkg: string storage overflow
make[1]: *** [Makefile:162: packagedata] Error 15

When building icu4c I would like to package additional locales by adding them into the directory icu4c/source/data/mappings - this worked well up to ICU 76.1

Debugging the root cause shows, that the current icu4c packagedata almost hits the configured maximum value of 100000 characters.

Debugging
Patched Package::writePackage() of ICU 78.1
--- icu4c/source/tools/toolutil/package.cpp       2025-11-20 07:41:36.000000000 +0100
+++ icu4c.modified/source/tools/toolutil/package.cpp        2025-11-21 10:54:34.798047432 +0100
@@ -795,9 +795,11 @@
         sortItems();
     }

+    fprintf(stderr, "Target items: %i\n", itemCount);
     // create the output item names in sorted order, with the package name prepended to each
     for(i=0; i<itemCount; ++i) {
         length = static_cast<int32_t>(strlen(items[i].name));
+        fprintf(stderr, "%05d: %s %06d\n", i, items[i].name, outStringTop);
         name=allocString(false, length+prefixLength);
         memcpy(name, prefix, prefixLength);
         memcpy(name+prefixLength, items[i].name, length+1);

Output of the patched run:
Target items: 4305
...
04303: zu.res 099069
04304: zu_ZA.res 099085


Is there anything I can do? Maybe just increase the STRING_STORE_SIZE?
icu4c\source\tools\toolutil\package.h
#define STRING_STORE_SIZE 100000

Markus Scherer

unread,
12:31 PM (8 hours ago) 12:31 PM
to Christian Maurer, icu-support
On Fri, Nov 21, 2025 at 4:51 AM Christian Maurer <c.mau...@gmail.com> wrote:
Is there anything I can do? Maybe just increase the STRING_STORE_SIZE?
icu4c\source\tools\toolutil\package.h
#define STRING_STORE_SIZE 100000

sgtm
triple? 1M?

We could also consider moving to more standard string classes and collections in these offline tools.
I think we were overly conservative in limiting ourselves to homegrown basics.

Would you like to create a Jira ticket and a pull request, at least for the STRING_STORE_SIZE?

markus

Steven Loomis

unread,
4:29 PM (4 hours ago) 4:29 PM
to Christian Maurer, icu-support
By the way, I would recommend customizing the locale contents via CLDR data - see https://unicode-org.github.io/icu/processes/cldr-icu.html and not the .txt/res files. 


Enviado desde mi iPad

El nov 21, 2025, a la(s) 6:51 a.m., Christian Maurer <c.mau...@gmail.com> escribió:


--
You received this message because you are subscribed to the Google Groups "icu-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to icu-support...@unicode.org.
To view this discussion visit https://groups.google.com/a/unicode.org/d/msgid/icu-support/303fc6cf-678e-4fbf-9dd0-3462be56eb53n%40unicode.org.

--
You received this message because you are subscribed to the Google Groups "ICU - Team" group.
To unsubscribe from this group and stop receiving emails from it, send an email to icu-team+u...@unicode.org.
To view this discussion visit https://groups.google.com/a/unicode.org/d/msgid/icu-team/303fc6cf-678e-4fbf-9dd0-3462be56eb53n%40unicode.org.
Reply all
Reply to author
Forward
0 new messages