Comments (30)
~/src/firefox-102.9.0> grep -R "Couldn't load XPCOM." --exclude-dir=obj-x86_64-unknown-haiku/ --exclude-dir=.git
browser/app/nsBrowserApp.cpp: Output("Couldn't load XPCOM.\n");
from inari.
~/src/firefox-102.9.0> cat obj-x86_64-unknown-haiku/dist/bin/dependentlibs.list
liblgpllibs.so
libmozsqlite3.so
libmozgtk.so
libmozwayland.so
libxul.so
from inari.
~/src/firefox-102.9.0> nm /boot/home/src/firefox-102.9.0/obj-x86_64-unknown-haiku/dist/bin/libxul.so | grep XRE_GetBootstrap
0000000007eb9334 b _ZZ16XRE_GetBootstrapE21sBootstrapInitialized
0000000003d81320 T XRE_GetBootstrap
from inari.
it seems to dlopen() succeed
BootstrapResult GetBootstrap(const char* aXPCOMFile,
LibLoadingStrategy aLibLoadingStrategy) {
// snip
GetBootstrapType func =
(GetBootstrapType)GetSymbol(sTop->libHandle, "XRE_GetBootstrap");
if (!func) {
return Err(AsVariant(NS_ERROR_NOT_AVAILABLE));
}
from inari.
Now I comes to same place with debug build
~/src/firefox-102.9.0> export MOZ_ANDROID_LIBDIR=/boot/home/src/firefox-102.9.0/obj-ff-dbg/dist/bin/firefox
~/src/firefox-102.9.0> ./mach run
0:01.12 /boot/home/src/firefox-102.9.0/obj-ff-dbg/dist/bin/firefox -no-remote -profile /boot/home/src/firefox-102.9.0/obj-ff-dbg/tmp/profile-default
Couldn't load XPCOM.
~/src/firefox-102.9.0>
from inari.
Added MOZ_ANDROID_LIBDIR
export to bash profile to be passed to Debugger launched team
~/src/firefox-102.9.0> tail ~/config/settings/profile
export PATH=/boot/home/src/cbindgen/target/release:$PATH
#export PATH=/boot/home/bin:$PATH
export MOZ_ANDROID_LIBDIR=/boot/home/src/firefox-102.9.0/obj-ff-dbg/dist/bin/firefox
from inari.
Debugger couldn't find source code, so debugging experience was very bad. By step-execution, fopen
called, but fgets
was not called so
static XPCOMGlueLoadResult XPCOMGlueLoad(
const char* aXPCOMFile, LibLoadingStrategy aLibLoadingStrategy) {
#if defined(MOZ_LINKER) || defined(__ANDROID__)
//snip
#else
char xpcomDir[MAXPATHLEN];
# ifdef XP_WIN
// snip
# elif XP_MACOSX
// snip
# else
const char* lastSlash = strrchr(aXPCOMFile, '/');
# endif
char* cursor;
if (lastSlash) {
size_t len = size_t(lastSlash - aXPCOMFile);
if (len > MAXPATHLEN - sizeof(XPCOM_FILE_PATH_SEPARATOR
# ifdef XP_MACOSX
// snip
# endif
XPCOM_DEPENDENT_LIBS_LIST)) {
return Err(AsVariant(NS_ERROR_FAILURE));
}
memcpy(xpcomDir, aXPCOMFile, len);
strcpy(xpcomDir + len, XPCOM_FILE_PATH_SEPARATOR
# ifdef XP_MACOSX
// snip
# endif
XPCOM_DEPENDENT_LIBS_LIST);
cursor = xpcomDir + len + 1;
} else {
strcpy(xpcomDir, XPCOM_DEPENDENT_LIBS_LIST);
cursor = xpcomDir;
}
if (getenv("MOZ_RUN_GTEST")
# ifdef FUZZING
// snip
# endif
) {
strcat(xpcomDir, ".gtest");
}
ScopedCloseFile flist;
flist = TS_tfopen(xpcomDir, READ_TEXTMODE);
if (!flist) {
return Err(AsVariant(NS_ERROR_FAILURE));
}
failed here? why?
# ifdef XP_MACOSX
// snip
# endif
*cursor = '\0';
char buffer[MAXPATHLEN];
while (fgets(buffer, sizeof(buffer), flist)) {
int l = strlen(buffer);
// ignore empty lines and comments
if (l == 0 || *buffer == '#') {
continue;
}
# ifdef XP_WIN
// snip
# endif
// cut the trailing newline, if present
if (buffer[l - 1] == '\n') {
buffer[l - 1] = '\0';
}
if (l + size_t(cursor - xpcomDir) > MAXPATHLEN) {
return Err(AsVariant(NS_ERROR_FAILURE));
}
strcpy(cursor, buffer);
ReadDependentCBResult readDependentCBResult =
ReadDependentCB(xpcomDir, aLibLoadingStrategy);
if (readDependentCBResult.isErr()) {
XPCOMGlueUnload();
return Err(AsVariant(readDependentCBResult.unwrapErr()));
}
# ifdef XP_WIN
// snip
# endif
}
#endif
return Ok();
}
from inari.
TS_tfopen: path: /boot/home/src/firefox-102.9.0/obj-ff-dbg/dist/bin/firefox/dependentlibs.list
okay, maybe MOZ_ANDROID_LIBDIR environment variable was not correct.
from inari.
for dependentlibs.list this was correct, but again crashing on dlopen()
~/src/firefox-102.9.0> export MOZ_ANDROID_LIBDIR=/boot/home/src/firefox-102.9.0/obj-ff-dbg/dist/bin
~/src/firefox-102.9.0> ./mach run
0:02.10 /boot/home/src/firefox-102.9.0/obj-ff-dbg/dist/bin/firefox -no-remote -profile /boot/home/src/firefox-102.9.0/obj-ff-dbg/tmp/profile-default
TS_tfopen: path: /boot/home/src/firefox-102.9.0/obj-ff-dbg/dist/bin/dependentlibs.list
from inari.
dlopen() other than libxul.so succeeded.
so, libxul.so or its dependency was problematic.
from inari.
symlinking may be OK
~/src/firefox-102.9.0> file obj-ff-dbg/dist/bin/libxul.so
obj-ff-dbg/dist/bin/libxul.so: symbolic link to ../../toolkit/library/build/libxul.so
~/src/firefox-102.9.0> file obj-ff-dbg/dist/bin/libmozsqlite3.so
obj-ff-dbg/dist/bin/libmozsqlite3.so: symbolic link to ../../config/external/sqlite/libmozsqlite3.so
from inari.
file command looks same
~/src/firefox-102.9.0> file obj-ff-dbg/toolkit/library/build/libxul.so
obj-ff-dbg/toolkit/library/build/libxul.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=c05a6cdf970666cc5208a9c1920387d233a7da88, with debug_info, not stripped
~/src/firefox-102.9.0> file obj-ff-dbg/config/external/sqlite/libmozsqlite3.so
obj-ff-dbg/config/external/sqlite/libmozsqlite3.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=da3dd8c3e919b2425481faa5942d677e5230ca8c, with debug_info, not stripped
from inari.
large binary may cause something bad result
~/src/firefox-102.9.0> ls -l obj-ff-dbg/config/external/sqlite/libmozsqlite3.so
-rwxr-xr-x 1 user root 7189456 5月 4 01:13 obj-ff-dbg/config/external/sqlite/libmozsqlite3.so
~/src/firefox-102.9.0> ls -l obj-ff-dbg/toolkit/library/build/libxul.so
-rwxr-xr-x 1 user root 1930727176 5月 4 12:24 obj-ff-dbg/toolkit/library/build/libxul.so
from inari.
passed on dlopen()ing libxul.so
- load_image()
- load_immediate_dependencies()
- check_needed_image_versions()
- set_image_flags_recursively()
- relocate_dependencies()
- remap_imags()
from inari.
init_dependencies()
- get_sorted_image_list()
- elf_hash()
- find_symbol()
- libnspr4.so + 0xb760
first init_dependencies() passed. no
- set_image_flags_recursively()
- relocate_dependencies()
I'm now load_library() in load_library()
from inari.
init_dependencies()
- image_event()
- libplds4.so + 0xb70
- libplc4.so + 0x10e8
- libicudata.so.66.1 +
- libicuuc.so.66.1 +
- libicui18n.so.66.1 +
- libicuio.so.66.1 +
- here __GLOBAL() pass
- libzstd.so.1.5.2 +
from inari.
second init_dependency() from initialize_locale_kit()
- locale/catalogs/plaintext +
internal init_dependency(), load_library() succeed
next load_library(), init_dependencies()
- locale/catalogs/plaintext +
succeed
- libbe.so + 0x13cb38
from inari.
- libnssutil3.so +
- libnss3.so +
- libssl3.so +
- libsmime3.so +
- libexecinfo.so +
- libdbus-1.so.3.19.13 +
- libdbus-glib-1.so.2.3.4 +
- libxul.so + 0xf08af0
- initialize routine succeed
- but maybe calling array initialize routine failed for some reason
from inari.
in array initialize routine
- libxul.so + 0xf0fc10
- std::ios_base::Init::Init()
- libxul.so + 0xf0b6c0
- __cxa_atexit
- libxul.so + 0Xf0b6c0 (again?)
- __cxa_atexit
- libxul.so + 0xf0b6c0
- __cxa_atexit
nsTSubstring<char>::AssertValid()
- libxul.so + 0xf0b6c0
- __cxa_atexit
- :
- libxul.so + 0xf0b930 -> crash
from inari.
Haiku runtime_loader/elf.cpp
static void
init_dependencies(image_t *image, bool initHead)
{
image_t **initList = NULL;
ssize_t count, i;
if (initHead && image->preinit_array) {
uint count_preinit = image->preinit_array_len / sizeof(addr_t);
for (uint j = 0; j < count_preinit; j++)
((initfini_array_function)image->preinit_array[j])();
}
count = get_sorted_image_list(image, &initList, RFLAG_INITIALIZED);
if (count <= 0) {
free(initList);
return;
}
if (!initHead) {
// this removes the "calling" image
image->flags &= ~RFLAG_INITIALIZED;
initList[--count] = NULL;
}
TRACE(("%ld: init dependencies\n", find_thread(NULL)));
for (i = 0; i < count; i++) {
image = initList[i];
TRACE(("%ld: init: %s\n", find_thread(NULL), image->name));
init_term_function before;
if (find_symbol(image,
SymbolLookupInfo(B_INIT_BEFORE_FUNCTION_NAME, B_SYMBOL_TYPE_TEXT),
(void**)&before) == B_OK) {
before(image->id);
}
if (image->init_routine != 0)
((init_term_function)image->init_routine)(image->id);
crashes on init_array[i] execution here.
if (image->init_array) {
uint count_init = image->init_array_len / sizeof(addr_t);
for (uint j = 0; j < count_init; j++)
((initfini_array_function)image->init_array[j])();
}
init_term_function after;
if (find_symbol(image,
SymbolLookupInfo(B_INIT_AFTER_FUNCTION_NAME, B_SYMBOL_TYPE_TEXT),
(void**)&after) == B_OK) {
after(image->id);
}
image_event(image, IMAGE_EVENT_INITIALIZED);
}
TRACE(("%ld: init done.\n", find_thread(NULL)));
free(initList);
}
from inari.
objdump -D
.init
at&t syntax
Disassembly of section .init:
0000000000f08af0 <_init>:
f08af0: 55 push %rbp
f08af1: 48 89 e5 mov %rsp,%rbp
f08af4: 57 push %rdi
f08af5: 48 83 ec 08 sub $0x8,%rsp
f08af9: e8 e2 c5 09 00 callq fa50e0 <frame_dummy>
f08afe: e8 ad 9c e0 06 callq 7d127b0 <__do_global_ctors_aux>
f08b03: 48 83 c4 08 add $0x8,%rsp
f08b07: 5f pop %rdi
f08b08: 48 89 ec mov %rbp,%rsp
f08b0b: 5d pop %rbp
f08b0c: c3 retq
intel syntax
Disassembly of section .init:
0000000000f08af0 <_init>:
f08af0: 55 push rbp
f08af1: 48 89 e5 mov rbp,rsp
f08af4: 57 push rdi
f08af5: 48 83 ec 08 sub rsp,0x8
f08af9: e8 e2 c5 09 00 call fa50e0 <frame_dummy>
f08afe: e8 ad 9c e0 06 call 7d127b0 <__do_global_ctors_aux>
f08b03: 48 83 c4 08 add rsp,0x8
f08b07: 5f pop rdi
f08b08: 48 89 ec mov rsp,rbp
f08b0b: 5d pop rbp
f08b0c: c3 ret
from inari.
routines succeeded
at&t syntax
0000000000f0fc10 <_ZNSt8ios_base4InitC1Ev@plt>:
f0fc10: ff 25 7a 5c 2b 0a jmpq *0xa2b5c7a(%rip) # b1c5890 <_ZNSt8ios_base4InitC1Ev@GLIBCXX_3.4>
f0fc16: 68 0f 07 00 00 pushq $0x70f
f0fc1b: e9 f0 8e ff ff jmpq f08b10 <.plt>
intel syntax
0000000000f0fc10 <_ZNSt8ios_base4InitC1Ev@plt>:
f0fc10: ff 25 7a 5c 2b 0a jmp QWORD PTR [rip+0xa2b5c7a] # b1c5890 <_ZNSt8ios_base4InitC1Ev@GLIBCXX_3.4>
f0fc16: 68 0f 07 00 00 push 0x70f
f0fc1b: e9 f0 8e ff ff jmp f08b10 <.plt>
at&t syntax
0000000000f0b6c0 <__cxa_atexit@plt>:
f0b6c0: ff 25 22 7f 2b 0a jmpq *0xa2b7f22(%rip) # b1c35e8 <__cxa_atexit>
f0b6c6: 68 ba 02 00 00 pushq $0x2ba
f0b6cb: e9 40 d4 ff ff jmpq f08b10 <.plt>
intel syntax
0000000000f0b6c0 <__cxa_atexit@plt>:
f0b6c0: ff 25 22 7f 2b 0a jmp QWORD PTR [rip+0xa2b7f22] # b1c35e8 <__cxa_atexit>
f0b6c6: 68 ba 02 00 00 push 0x2ba
f0b6cb: e9 40 d4 ff ff jmp f08b10 <.plt>
- these address (which executable) not found in libxul.so asm (maybe sane)
- b1c5890
- b1c35e8
from inari.
failed init routine
at&t syntax
0000000000f0b930 <moz_create_arena_with_params@plt>:
f0b930: ff 25 ea 7d 2b 0a jmpq *0xa2b7dea(%rip) # b1c3720 <moz_create_arena_with_params>
f0b936: 68 e1 02 00 00 pushq $0x2e1
f0b93b: e9 d0 d1 ff ff jmpq f08b10 <.plt>
intel syntax
0000000000f0b930 <moz_create_arena_with_params@plt>:
f0b930: ff 25 ea 7d 2b 0a jmp QWORD PTR [rip+0xa2b7dea] # b1c3720 <moz_create_arena_with_params>
f0b936: 68 e1 02 00 00 push 0x2e1
f0b93b: e9 d0 d1 ff ff jmp f08b10 <.plt>
from inari.
b1c3720: 36 b9 f0 00 00 00 ss mov $0xf0,%ecx
b1c3726: 00 00 add %al,(%rax)
b1c3728: 46 b9 f0 00 00 00 rex.RX mov $0xf0,%ecx
b1c372e: 00 00 add %al,(%rax)
b1c3730: 56 push %rsi
b1c3731: b9 f0 00 00 00 mov $0xf0,%ecx
b1c3736: 00 00 add %al,(%rax)
b1c3738: 66 b9 f0 00 mov $0xf0,%cx
b1c373c: 00 00 add %al,(%rax)
b1c373e: 00 00 add %al,(%rax)
b1c3740: 76 b9 jbe b1c36fb <_GLOBAL_OFFSET_TABLE_+0x16fb>
b1c3742: f0 00 00 lock add %al,(%rax)
b1c3745: 00 00 add %al,(%rax)
b1c3747: 00 86 b9 f0 00 00 add %al,0xf0b9(%rsi)
b1c374d: 00 00 add %al,(%rax)
b1c374f: 00 96 b9 f0 00 00 add %dl,0xf0b9(%rsi)
b1c3755: 00 00 add %al,(%rax)
b1c3757: 00 a6 b9 f0 00 00 add %ah,0xf0b9(%rsi)
b1c375d: 00 00 add %al,(%rax)
b1c375f: 00 b6 b9 f0 00 00 add %dh,0xf0b9(%rsi)
b1c3765: 00 00 add %al,(%rax)
b1c3767: 00 c6 add %al,%dh
b1c3769: b9 f0 00 00 00 mov $0xf0,%ecx
b1c376e: 00 00 add %al,(%rax)
b1c3770: d6 (bad)
from inari.
objdump by default uses AT&T syntax
from inari.
https://dev.haiku-os.org/ticket/14531
from inari.
will -no-pie
help this
situation?
if CONFIG["MOZ_NO_PIE_COMPAT"]:
GeckoProgram(CONFIG["MOZ_APP_NAME"] + "-bin")
DIRS += ["no-pie"]
else:
GeckoProgram(CONFIG["MOZ_APP_NAME"])
from inari.
https://dev.haiku-os.org/ticket/15432
from inari.
~/src/firefox-102.9.0> nm obj-ff-dbg/dist/bin/libxul.so | grep moz_create_arena_with_params
w moz_create_arena_with_params
from inari.
moz_create_arena_with_params issue was fixed by
from inari.
Related Issues (20)
- atk build error HOT 3
- Haiku doesn't have syscall.h? HOT 1
- Chromium IPC build failures HOT 3
- libevent build failures HOT 4
- GLContextProviderGLX build error though we're building for wayland-only HOT 3
- WasmSignalHandlers.cpp build failures HOT 1
- firefox binary linker error HOT 2
- security manager build error HOT 3
- libmozavcodec.so link failed HOT 2
- gkrust build failure HOT 1
- xptcall build error? HOT 3
- other linker issues HOT 12
- Undefined symbols pthread_*_np HOT 1
- Firefox couldn't find the application directory. HOT 10
- debug build fails with LLVM OOM HOT 10
- moz_create_arena_with_params dynamic load error HOT 9
- error: no DISPLAY environment variable specified HOT 18
- git clone gecko-dev HOT 2
- cubeb_oss failed to build HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inari.