Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

options/internal: SIGSEGV in locking code #111

Closed
Dennisbonke opened this issue Jun 12, 2020 · 0 comments · Fixed by #115
Closed

options/internal: SIGSEGV in locking code #111

Dennisbonke opened this issue Jun 12, 2020 · 0 comments · Fixed by #115

Comments

@Dennisbonke
Copy link
Member

While testing git on managarm, the following bug came to my attention.
By doing the following operations in order, the program can be killed with an SIGSEGV
To reproduce:

  • Have git installed and a git repo available, in this test case managarm
  • Do the required git setup, for managarm, this is touch /dev/null, and setting the global username and email (git will complain about this)
  • In the git repo, touch a file, and run git add .
  • Run git commit -m <message>, where message is the commit message (irrelevant for triggering this bug) and watch it crash.

Running addr2line on libc.so gives the following line

dennis@DENNIS-MAIN-LAPTOP-SIDUCTION:~/managarm-clone/build$ addr2line --e system-root/usr/lib/libc.so 
0x987d0
/home/dennis/managarm-clone/build/pkg-builds/mlibc/../../../src/mlibc/options/internal/include/mlibc/lock.hpp:24

which translates to

if(__atomic_compare_exchange_n(&_futex, &expected, 1,
							false, __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE)) {

where the first part of the if statement is line 24 in lock.hpp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant