SerenityOS / serenity

The Serenity Operating System 🐞
https://serenityos.org
BSD 2-Clause "Simplified" License
30.27k stars 3.17k forks source link

LibPthread: Assertion fail during git clone #5849

Open giridharprasath opened 3 years ago

giridharprasath commented 3 years ago

Repro: git clone git://github.com/shellphish/how2heap

pthread_setcancelstate() is invoked by git port testcases

https://github.com/SerenityOS/serenity/blob/d792200a5531bf9872e19c7c7a3ba4c865ad43b6/Userland/Libraries/LibPthread/pthread.cpp#L636-639

Can we return zero from here as pthread_cancel() is not implemented yet?

bcoles commented 3 years ago

pthread_setcancelstate() has not been implemented. It probably makes more sense to leave this as a TODO().

Edit: pthread_cancel() also has not been implemented.

maxgerhardt commented 3 years ago

Still running into this error when trying to clone anything, e.g.

> git clone https://github.com/rofl0r/gnuboy
Cloning into 'gnuboy'...
git(29:29): FIXME: fflush(nullptr) should flush all open streams
git(29:29): USERSPACE(29) ASSERTION FAILED: false
../../Userland/Libraries/LibPthread/pthread.cpp:554
[git(29:29)]: CRASH: CPU #0 Illegal instruction in ring 3
[#0 git(29:29)]: Exception code: 0000 (isr: 0000)
[#0 git(29:29)]:     pc=001b:7286a2f0 eflags=00010246
[#0 git(29:29)]:  stack=0023:009ff94c
[#0 git(29:29)]:     ds=0023 es=0023 fs=0023 gs=002b
[#0 git(29:29)]:    eax=00000000 ebx=728e869c ecx=00a0a000 edx=fffffffc
[#0 git(29:29)]:    ebp=009ff978 esp=c1031f28 esi=009ff968 edi=009ff9c4
[#0 git(29:29)]:    cr0=80010013 cr2=c2f85000 cr3=049bf000 cr4=000406e4
[#0 git(29:29)]: 0x7286a2f0  (?)
[#0 git(29:29)]: 0xc0378193  Kernel::Process::crash(int, unsigned int, bool) +0x333
[#0 git(29:29)]: 0xc0572c8e  illegal_instruction_handler +0x0
[#0 git(29:29)]: 0xc0572d95  divide_error_handler +0x0
[#0 git(29:29)]: 0xc0569eca  illegal_instruction_asm_entry +0x28
...
CrashDaemon(15:15): --- Backtrace for thread #0 (TID 29) ---
CrashDaemon(15:15): 0x7286a2f0: [libc.so] _abort +0x0 (assert.cpp:37)
CrashDaemon(15:15): 0x7286a28b: [libc.so] __assertion_failed +0xeb (Format.h:236)
CrashDaemon(15:15): 0x3ebb490e: [libpthread.so] pthread_setcancelstate +0x1e (pthread.cpp:554)
CrashDaemon(15:15): 0xaa811ec5: [/usr/local/bin/git] ??