movableink / webkit

Unofficial mirror of the WebKit SVN repository
http://www.webkit.org/
59 stars 11 forks source link

JavaScriptCore crashes in assembly code (SIGSEGV) #31

Closed quarcko closed 6 months ago

quarcko commented 6 months ago

So maybe there are some one who understands assemly better than me, i am completely stuck:

after building with MINGW (running jsc.exe or QtTestBrowser.exe) crashes same way in LowLevelInterpreter.asm so no point building futher until we successfully can run jsc.exe:

llint_entry () at C:/Qt/webkit/Source/JavaScriptCore/llint\LowLevelInterpreter.asm:2022 2022 bbeq [t3], 0, .notFrozen => 0x000000014057471f <llint_entry+14536>: 41 80 39 00 cmpb $0x0,(%r9) 0x0000000140574723 <llint_entry+14540>: 74 05 je 0x14057472a <llint_entry+14547>

I analyzed a bit in GDB linux version of jsc vs jsc.exe: this part corresponds to line 2015 (which is defined marco at line 1928) of LowLevelInterpreter.asm and actual instruction is line 1932 pop pcBase

LINUX one: 0x5555560b4810 <llint_entry>: push %rbp (gdb) 0x5555560b4811 <llint_entry+1>: mov %rsp,%rbp (gdb) 0x5555560b4814 <llint_entry+4>: call 0x5555560b4819 <llint_relativePCBase> (gdb) 0x5555560b4819 <llint_relativePCBase>: pop %rcx (gdb) 0x5555560b481a <llint_relativePCBase+1>: lea 0x1e9ed(%rcx),%r8

WINDOWS one: 0x140570e57 <llint_entry>: push %rbp (gdb) 0x140570e58 <llint_entry+1>: mov %rsp,%rbp (gdb) 0x140570e5b <llint_entry+4>: call 0x140570e60 <llint_entry+9> (gdb) 0x140570e60 <llint_entry+9>: pop %r9 (gdb) 0x140570e62 <llint_entry+11>: lea 0x22773(%r9),%r10

In case on WINDOWS there is no switch to label llint_relativePCBase and later (line 2021-2022 on WIndows):

0x140574714 <llint_entry+14525>: mov 0x6e5105(%rip),%r9 # 0x140c59820 <g_jscConfig@GOTPCREL> (gdb) => 0x14057471b <llint_entry+14532>: add $0x6,%r9 (gdb) 0x14057471f <llint_entry+14536>: cmpb $0x0,(%r9)

it crashes while trying to access g_jscConfig variable on linux this part passes ok, but on linux it is in label llint_relativePCBase while running this...

anu ideas?

aquiles2k commented 6 months ago

@quarcko Sorry, cant help there. Perhaps you can ask annulen in the qtwebkit repo. He was very quick to respond yesterday to my question (see https://github.com/qtwebkit/qtwebkit/issues/1101). Or you ask the webkit mailinglist for general guidance.

quarcko commented 6 months ago

@aquiles2k - lets continue discussion here:

1) This asm crash had nothing to do with JIT or C_LOOP being enabled; 2) But based on all the comments from github and others -> i ended up enabling JIT and fixing 1 compilation issue there (MINGW specific)

also - yesterday i only finished compiling jsc.exe and tried to run few simple JS mathematical calculations as a test :) rest of webkit has to be rebuilt, which im doing now. so stay tuned

also when im finished building i will push all changes to my fork of repository and you can look there for any fixes you need.

quarcko commented 6 months ago

Also - closing this issue.