[Qt] ###!!! ABORT: JS_SetICUMemoryFunctions failed.: file xpcom/build/nsXPComInit.cpp, line 831

NEW
Unassigned

Status

()

Core
Internationalization
3 years ago
3 years ago

People

(Reporter: tatiana, Unassigned)

Tracking

Trunk
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
Qt build still assert at

#0  mozalloc_abort (msg=msg@entry=0x7fffffffc744 "[22240] ###!!! ABORT: JS_SetICUMemoryFunctions failed.: file /xpcom/build/nsXPComInit.cpp, line 831")
    at /memory/mozalloc/mozalloc_abort.cpp:30
#1  0x00007ffff134ce09 in Abort (
    aMsg=0x7fffffffc744 "[22240] ###!!! ABORT: JS_SetICUMemoryFunctions failed.: file /xpcom/build/nsXPComInit.cpp, line 831")
    at /xpcom/base/nsDebugImpl.cpp:421
#2  NS_DebugBreak (aSeverity=<optimized out>, aStr=0x7ffff3763bf3 "JS_SetICUMemoryFunctions failed.", aExpr=0x0, 
    aFile=0x7ffff37637b5 "/xpcom/build/nsXPComInit.cpp", aLine=831)
    at /xpcom/base/nsDebugImpl.cpp:408
#3  0x00007ffff1340420 in mozilla::SetICUMemoryFunctions () at /xpcom/build/nsXPComInit.cpp:831
#4  0x00007ffff2b60b1c in nsQAppInstance::AddRef (aArgc=@0x7ffff5827658: 3, aArgv=0x7fffffffe288, aDefaultProcess=aDefaultProcess@entry=true)
    at /toolkit/xre/nsQAppInstance.cpp:20
#5  0x00007ffff2b631fe in XREMain::XRE_mainStartup (this=this@entry=0x7fffffffce10, aExitFlag=aExitFlag@entry=0x7fffffffcdc7)
    at /toolkit/xre/nsAppRunner.cpp:3401
#6  0x00007ffff2b668d4 in XREMain::XRE_main (this=this@entry=0x7fffffffce10, argc=argc@entry=4, argv=argv@entry=0x7fffffffe288, aAppData=aAppData@entry=0x7fffffffd000)
    at /toolkit/xre/nsAppRunner.cpp:4073
#7  0x00007ffff2b66b73 in XRE_main (argc=4, argv=0x7fffffffe288, aAppData=0x7fffffffd000, aFlags=<optimized out>) at /toolkit/xre/nsAppRunner.cpp:4300
#8  0x0000000000403eb0 in do_main (argc=argc@entry=4, argv=argv@entry=0x7fffffffe288, xreDirectory=0x7ffff6c306c0) at /browser/app/nsBrowserApp.cpp:282
#9  0x00000000004037db in main (argc=4, argv=0x7fffffffe288) at /browser/app/nsBrowserApp.cpp:643


It does happen because Qt static methods do call ICU methods before XPCOM Init

#0  uprv_malloc_52 (s=56) at /intl/icu/source/common/cmemory.c:81
#1  0x00007ffff36582e8 in UDataMemory_createNewInstance_52 (pErr=0x7fffffffa4e4) at /intl/icu/source/common/udatamem.c:45
#2  0x00007ffff3656f0f in setCommonICUData (pData=pData@entry=0x7fffffffa2a0, warn=warn@entry=0 '\000', pErr=pErr@entry=0x7fffffffa4e4)
    at /intl/icu/source/common/udata.cpp:165
#3  0x00007ffff3657906 in setCommonICUDataPointer (pData=<optimized out>, pErrorCode=0x7fffffffa4e4) at /intl/icu/source/common/udata.cpp:206
#4  openCommonData (path=path@entry=0x7ffff3ae02c6 "icudt52l", commonDataIndex=commonDataIndex@entry=0, pErrorCode=pErrorCode@entry=0x7fffffffa4e4)
    at /intl/icu/source/common/udata.cpp:689
#5  0x00007ffff3657a37 in doLoadFromCommonData (isICUData=isICUData@entry=1 '\001', tocEntryName=0x7fffffffa52d "icudt52l/cnvalias.icu", path=path@entry=0x7ffff3ae02c6 "icudt52l", 
    type=type@entry=0x7ffff49092d4 <DATA_TYPE> "icu", name=name@entry=0x7ffff49092d8 <DATA_NAME> "cnvalias", 
    isAcceptable=isAcceptable@entry=0x7ffff372e9bc <isAcceptable(void*, char const*, char const*, UDataInfo const*)>, context=context@entry=0x0, subErrorCode=subErrorCode@entry=0x7fffffffa4e4, 
    pErrorCode=pErrorCode@entry=0x7fffffffa7cc) at /intl/icu/source/common/udata.cpp:1027
#6  0x00007ffff365811a in doOpenChoice (path=0x7ffff3ae02c6 "icudt52l", type=0x7ffff49092d4 <DATA_TYPE> "icu", name=0x7ffff49092d8 <DATA_NAME> "cnvalias", 
    isAcceptable=0x7ffff372e9bc <isAcceptable(void*, char const*, char const*, UDataInfo const*)>, context=0x0, pErrorCode=0x7fffffffa7cc)
    at /intl/icu/source/common/udata.cpp:1274
#7  0x00007ffff372eb49 in initAliasData (errCode=@0x7fffffffa7cc: U_ZERO_ERROR) at /intl/icu/source/common/ucnv_io.cpp:240
#8  0x00007ffff372ed09 in umtx_initOnce (errCode=@0x7fffffffa7cc: U_ZERO_ERROR, fp=0x7ffff372eae7 <initAliasData(UErrorCode&)>, uio=...)
    at /intl/icu/source/common/umutex.h:235
#9  haveAliasData (pErrorCode=pErrorCode@entry=0x7fffffffa7cc) at /intl/icu/source/common/ucnv_io.cpp:312
#10 0x00007ffff372f3ed in ucnv_getStandardName_52 (alias=0x7fffea81b024 "UTF-8", standard=0x7fffedfbc280 "MIME", pErrorCode=0x7fffffffa7cc)
    at /intl/icu/source/common/ucnv_io.cpp:956
#11 0x00007fffedec1bec in QIcuCodec::codecForNameUnlocked (name=0x7fffea81b024 "UTF-8") at codecs/qicucodec.cpp:466
#12 0x00007fffedec26fd in QIcuCodec::defaultCodecUnlocked () at codecs/qicucodec.cpp:445
#13 0x00007fffedebe687 in QTextCodec::codecForLocale () at codecs/qtextcodec.cpp:688
#14 0x00007fffeddcabe6 in QTextStreamPrivate::reset (this=this@entry=0x7ffff6c19aa0) at io/qtextstream.cpp:399
#15 0x00007fffeddcad38 in QTextStreamPrivate::QTextStreamPrivate (this=0x7ffff6c19aa0, q_ptr=0x7fffeebeccf0 <(anonymous namespace)::qout>) at io/qtextstream.cpp:330
#16 0x00007fffeddd46db in QTextStream::QTextStream (this=0x7fffeebeccf0 <(anonymous namespace)::qout>, fileHandle=0x7ffff719a060 <_IO_2_1_stderr_>, openMode=...) at io/qtextstream.cpp:1030
#17 0x00007fffee6781ff in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at compiler/qv4isel_p.cpp:56
#18 _GLOBAL__sub_I_qv4isel_p.cpp(void) () at compiler/qv4isel_p.cpp:403
#19 0x00007ffff7deb92a in call_init (l=<optimized out>, argc=argc@entry=4, argv=argv@entry=0x7fffffffe288, env=env@entry=0x7fffffffe2b0) at dl-init.c:78
#20 0x00007ffff7deba13 in call_init (env=0x7fffffffe2b0, argv=0x7fffffffe288, argc=4, l=<optimized out>) at dl-init.c:36
#21 _dl_init (main_map=main_map@entry=0x7ffff6c13000, argc=4, argv=0x7fffffffe288, env=0x7fffffffe2b0) at dl-init.c:126
#22 0x00007ffff7defb98 in dl_open_worker (a=a@entry=0x7fffffffad68) at dl-open.c:577
#23 0x00007ffff7deb7b4 in _dl_catch_error (objname=objname@entry=0x7fffffffad58, errstring=errstring@entry=0x7fffffffad60, mallocedp=mallocedp@entry=0x7fffffffad57, 
    operate=operate@entry=0x7ffff7def8c0 <dl_open_worker>, args=args@entry=0x7fffffffad68) at dl-error.c:177
#24 0x00007ffff7def38b in _dl_open (file=0x7fffffffafa0 "/obj-ff-qt/dist/bin/libxul.so", mode=-2147483391, caller_dlopen=<optimized out>, nsid=-2, 
    argc=4, argv=0x7fffffffe288, env=0x7fffffffe2b0) at dl-open.c:661
#25 0x00007ffff79bd02b in dlopen_doit (a=a@entry=0x7fffffffaf70) at dlopen.c:66
#26 0x00007ffff7deb7b4 in _dl_catch_error (objname=0x7ffff6c0a050, errstring=0x7ffff6c0a058, mallocedp=0x7ffff6c0a048, operate=0x7ffff79bcfd0 <dlopen_doit>, args=0x7fffffffaf70) at dl-error.c:177
#27 0x00007ffff79bd5dd in _dlerror_run (operate=operate@entry=0x7ffff79bcfd0 <dlopen_doit>, args=args@entry=0x7fffffffaf70) at dlerror.c:163
#28 0x00007ffff79bd0c1 in __dlopen (file=<optimized out>, mode=<optimized out>) at dlopen.c:87
#29 0x0000000000404c7e in GetLibHandle (aDependentLib=0x7fffffffafa0 "/obj-ff-qt/dist/bin/libxul.so")
    at /xpcom/glue/standalone/nsXPCOMGlue.cpp:224
#30 ReadDependentCB (do_preload=<optimized out>, aDependentLib=0x7fffffffafa0 "/obj-ff-qt/dist/bin/libxul.so")
    at /xpcom/glue/standalone/nsXPCOMGlue.cpp:271
#31 XPCOMGlueLoad (xpcomFile=<optimized out>) at /xpcom/glue/standalone/nsXPCOMGlue.cpp:415
#32 0x0000000000404ddf in XPCOMGlueStartup (xpcomFile=<optimized out>) at /xpcom/glue/standalone/nsXPCOMGlue.cpp:475
#33 0x0000000000403aa5 in InitXPCOMGlue (argv0=<optimized out>, xreDirectory=xreDirectory@entry=0x7fffffffe048) at /browser/app/nsBrowserApp.cpp:551
#34 0x000000000040377e in main (argc=4, argv=0x7fffffffe288) at /browser/app/nsBrowserApp.cpp:612
(Reporter)

Comment 1

3 years ago
For now I'm using ac_add_options --without-intl-api in order to workaround this problem, but would be nice to find better solution
Bug 969498 was supposed to have fixed this...
(Reporter)

Updated

3 years ago
Depends on: 746800
Oleg is the expert here.
in bug 969498 we had chance to workaround this problem by calling SetICUMemoryFunctions before any QApplication class instantiated, but here it looks like Qt has static initializers which touching ICU API and this is all happens during libxul.so dlopen
29 0x0000000000404c7e in GetLibHandle (aDependentLib=0x7fffffffafa0 "/obj-ff-qt/dist/bin/libxul.so")

and it is not really possible to call mozilla::SetICUMemoryFunctions before libxul.so is opened.

I'm not exactly sure what would be the right behavior here, because if we hide problem by using --without-intl-api then there is no guarantee that tomorrow Gtk would not start touching ICU API during static initialization of libglib or libgtk library. 

I think right solution here would be to isolate Gecko ICU from toolkit ICU somehow, but not sure how it would fit into current integration and synchronization with ICU upstream.
You need to log in before you can comment on or make changes to this bug.