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

radare2-cutter: 1.3 -> 1.4 #42572

Merged
merged 1 commit into from Jul 2, 2018
Merged

Conversation

dtzWill
Copy link
Member

@dtzWill dtzWill commented Jun 25, 2018

Added new required deps, minor org touchup.

WIP because it seems to crash on startup, I haven't determined why.
It may need to use its internally pinned r2 version
instead of the "system" (currently 2.6.0) version we build against.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

Added new required deps, minor org touchup.
@dtzWill
Copy link
Member Author

dtzWill commented Jun 25, 2018

Any idea what's causing the problem? Not a high priority at all but LMK if you have any insights/experience with this... :).

@Mic92
Copy link
Member

Mic92 commented Jun 26, 2018

Where does it crash? It works well for me: https://dl.thalheim.io/1b4cmDvETvFNmda-kYkspQ/Screenshot_20180626_103810.png

@dtzWill
Copy link
Member Author

dtzWill commented Jun 26, 2018

Oh, good! Here's what I'm seeing:

(gdb) bt
#0  0x00007f04b0ae8be0 in raise () from /nix/store/83lrbvbmxrgv7iz49mgd42yvhi473xp6-glibc-2.27/lib/libc.so.6
#1  0x00007f04b0ae9dc1 in abort () from /nix/store/83lrbvbmxrgv7iz49mgd42yvhi473xp6-glibc-2.27/lib/libc.so.6
#2  0x00007f04b0b2a2ac in __libc_message () from /nix/store/83lrbvbmxrgv7iz49mgd42yvhi473xp6-glibc-2.27/lib/libc.so.6
#3  0x00007f04b0b3049a in malloc_printerr () from /nix/store/83lrbvbmxrgv7iz49mgd42yvhi473xp6-glibc-2.27/lib/libc.so.6
#4  0x00007f04b0b3110c in _int_free () from /nix/store/83lrbvbmxrgv7iz49mgd42yvhi473xp6-glibc-2.27/lib/libc.so.6
#5  0x00007f04c02df670 in r_core_config_init () from /nix/store/2wdfqblcmvh2r1rh31z6fp2bdqhvi68m-radare2-2.6.0/lib/libr_core.so.2.6.0
#6  0x00007f04c034ef3b in r_core_init () from /nix/store/2wdfqblcmvh2r1rh31z6fp2bdqhvi68m-radare2-2.6.0/lib/libr_core.so.2.6.0
#7  0x00007f04c034f180 in r_core_new () from /nix/store/2wdfqblcmvh2r1rh31z6fp2bdqhvi68m-radare2-2.6.0/lib/libr_core.so.2.6.0
#8  0x0000000000443f7a in ?? ()
#9  0x00000000004440b1 in ?? ()
#10 0x00000000004795ab in ?? ()
#11 0x0000000000500c12 in ?? ()
#12 0x000000000043ce3f in ?? ()
#13 0x00007f04b0ad5b8e in __libc_start_main () from /nix/store/83lrbvbmxrgv7iz49mgd42yvhi473xp6-glibc-2.27/lib/libc.so.6
#14 0x000000000043e91a in ?? ()
(gdb) 

.... Whoa!

I'm seeing same crash simply running radare2 (2.6.0) from latest-- the r2 in my profile earlier (2.5.0, not sure where from) doesn't have this issue.

Maybe it doesn't like my config or something? Will investigate, glad it works for you, sounds like problem with (or at least specific to) my setup!

@dtzWill dtzWill changed the title [WIP] radare2-cutter: 1.3 -> 1.4 radare2-cutter: 1.3 -> 1.4 Jun 26, 2018
@dtzWill
Copy link
Member Author

dtzWill commented Jun 26, 2018

r2 works if I run it like this:

$ nix run --store $HOME/test-store -f channel:nixos-unstable radare2 -c r2 --version

But not like this:

$ nix run  -f channel:nixos-unstable radare2  -c r2 --version

So a)looks like r2 bug, if anything and b)seems to definitely be related to my environment somehow.

If this looks good to you, please merge :). I'll debug this separately and file issue(s) as appropriate or not :).

@dtzWill
Copy link
Member Author

dtzWill commented Jun 26, 2018

valgrind complains:

==31071== Invalid free() / delete / delete[] / realloc()
==31071==    at 0x4C2E278: free (in /nix/store/1i9jrscpis8gawy0iarm3k888wqy0331-valgrind-3.13.0/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31071==    by 0x518666F: r_core_config_init (in /nix/store/mgww57p9i9jbgkhnp9s98k5ssjka0qsx-radare2-2.6.0/lib/libr_core.so.2.6.0)
==31071==    by 0x51F5F3A: r_core_init (in /nix/store/mgww57p9i9jbgkhnp9s98k5ssjka0qsx-radare2-2.6.0/lib/libr_core.so.2.6.0)
==31071==    by 0x4038E5: main (in /nix/store/mgww57p9i9jbgkhnp9s98k5ssjka0qsx-radare2-2.6.0/bin/radare2)
==31071==  Address 0x5248118 is in a r-x mapped file /nix/store/mgww57p9i9jbgkhnp9s98k5ssjka0qsx-radare2-2.6.0/lib/libr_core.so.2.6.0 segment

Which I'm saying because wut.

Hacking our expression to use latest radare2 from git fixes things, and hopefully indicates it's a bug they've since fixed in the 300+ commits made since 2.6.0 :).

Unfortunately Cutter 1.4 doesn't build against it, haha, but I'm good for now. Thanks!

@Mic92
Copy link
Member

Mic92 commented Jun 27, 2018

Probably pinning radare2 in cutter is the best solution, given that it is not always en par with it.

@dtzWill
Copy link
Member Author

dtzWill commented Jun 30, 2018

Yeah, I think that's probably best too. Should we merge this as-is and handle pinning r2 in a future PR?

i'm sad I haven't sorted why it crashes for me but since it seems unrelated to Cutter (since r2 on master crashes for me, Cutter 1.3 crashes the same as 1.4) I think we can go ahead with this?

@Mic92 Mic92 merged commit 1b26963 into NixOS:master Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants