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

Crash in entry_equals <- find_entry_ptr <- hashmap_get <- recurse_create_git_tree #337

Open
riastradh opened this issue Oct 22, 2024 · 9 comments

Comments

@riastradh
Copy link

git-cinnabar 0.6.3

$ git clone hg::https://www.mercurial-scm.org/repo/hg hg.git
Cloning into 'hg.git'...
warning: redirecting to https://repo.mercurial-scm.org/hg
Reading 52026 changesets
Reading and importing 52000 manifests
Reading and importing 103872 revisions of 3874 files
error: git-remote-hg died of signal 11
fatal: could not read ref refs/cinnabar/refs/heads/branches/default/tip
$ gdb /path/to/git-remote-hg ./git-remote-hg.core
GNU gdb (GDB) 8.3                                               
...
Reading symbols from /home/riastradh/pkgsrc/current/pkg/libexec/git-core/git-remote-hg...
[New process 5045]
[New process 22437]
Core was generated by `git-remote-hg'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000000000 in ?? ()
[Current thread is 1 (process 5045)]
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000024daf857 in entry_equals (map=0x252d19c0 <git_tree_cache>,
    map=0x252d19c0 <git_tree_cache>, keydata=0x0, e2=0x7f7fff5cdb80,
    e1=<optimized out>)
    at /home/riastradh/pkgsrc/current/work/devel/git-cinnabar/work/git-cinnabar-0.6.3/git-core/hashmap.c:101
#2  find_entry_ptr (keydata=0x0, key=0x7f7fff5cdb80,
    map=0x252d19c0 <git_tree_cache>)
    at /home/riastradh/pkgsrc/current/work/devel/git-cinnabar/work/git-cinnabar-0.6.3/git-core/hashmap.c:140
#3  hashmap_get (map=map@entry=0x252d19c0 <git_tree_cache>,
    key=key@entry=0x7f7fff5cdb80, keydata=keydata@entry=0x0)
    at /home/riastradh/pkgsrc/current/work/devel/git-cinnabar/work/git-cinnabar-0.6.3/git-core/hashmap.c:218
#4  0x0000000024d52557 in recurse_create_git_tree (
    tree_id=tree_id@entry=0x7f7fff5cdf90, reference=0x7f7fff5cde50,
    merge_tree_id=0x0, result=result@entry=0x7f7fff5cde10,
    cache=0x252d19c0 <git_tree_cache>)
    at /home/riastradh/pkgsrc/current/work/devel/git-cinnabar/work/git-cinnabar-0.6.3/src/cinnabar-helper.c:750
#5  0x0000000024d524b6 in recurse_create_git_tree (tree_id=0x7f7fff5ce7e0,
    reference=0x7f7fff5ce564, merge_tree_id=0x0, result=0x7f7fff5ce5e0,
    cache=0x252d19c0 <git_tree_cache>)
    at /home/riastradh/pkgsrc/current/work/devel/git-cinnabar/work/git-cinnabar-0.6.3/src/cinnabar-helper.c:797
#6  0x0000000024cb73eb in git_cinnabar::store::store_changegroup ()
#7  0x0000000024cd8efe in git_cinnabar::hg_connect::get_store_bundle ()
#8  0x0000000024d29e64 in git_cinnabar::remote_helper_import ()
#9  0x0000000024d34906 in git_cinnabar::git_remote_hg ()
#10 0x0000000024d1dec3 in git_cinnabar::git_cinnabar ()
#11 0x0000000024d39c28 in cinnabar_main ()
#12 0x0000000024d1f8b4 in git_cinnabar::main ()
#13 0x0000000024c472c3 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#14 0x000078bde4357010 in ?? ()
#15 0x0000000024c5ecf9 in std::rt::lang_start::{{closure}} ()
#16 0x000078bde4357010 in ?? ()
#17 0x0000000024fa5125 in std::rt::lang_start_internal ()
#18 0x0000000024d49835 in main ()
@riastradh
Copy link
Author

Worked fine in 0.6.2 + patch to fix #315.

@riastradh
Copy link
Author

Looks like something is calling into create_git_tree before git_tree_cache has been initialized.

@glandium
Copy link
Owner

I can't reproduce with 0.6.3. Would you be able to record your crash with rr?

@riastradh
Copy link
Author

What is rr and how do I record it?

@glandium
Copy link
Owner

https://rr-project.org/

@riastradh
Copy link
Author

CMake Error at CMakeLists.txt:338 (message):
  Couldn't find linux/seccomp.h.  You may need to upgrade your kernel.

Is rr linux-only? This is on NetBSD.

@glandium
Copy link
Owner

Yes, rr is linux-only.

@riastradh
Copy link
Author

I can share more information out of the core dump if that would be helpful. For example:

(gdb) print git_tree_cache 
$1 = {table = 0x7a5921f42c00, cmpfn = 0x0, cmpfn_data = 0x0, private_size = 0, 
  tablesize = 64, grow_at = 51, shrink_at = 0, do_count_items = 0}
(gdb) print nongit 
$2 = 1
(gdb) print initialized
$3 = <optimized out>
(gdb) print metadata_oid
$4 = {hash = '\000' <repeats 31 times>, algo = 0}

@glandium
Copy link
Owner

That state of git_tree_cache makes no sense.

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

No branches or pull requests

2 participants