Re: [Libguestfs] Python Hivex Assertion Failed
On Fri, Apr 01, 2011 at 03:01:58PM -0400, Elizabeth Schweinsberg wrote:
Richard,
Thanks for the reply. I'm beginning to think it's Ubuntu that's the problem. I acquired a SOFTWARE hive and ran the code you sent on it and I get the same error. I even upgraded to Python 2.7.
My runs:
-------- Your code with my software hive -------- emschwe@station12:~/jean2$ cat test-hivex.py #!/usr/bin/python import hivex h = hivex.Hivex("software") r = h.root() node = h.node_get_child(r, "Microsoft") print r print h.node_name(r) print h.node_name(node)
emschwe@station12:~/jean2$ ./test-hivex.py python: hivex-py.c:52: get_handle: Assertion `obj' failed. Aborted emschwe@station12:~/jean2$
----- My version on NTUSER.DAT ----- emschwe@station12:~/jean2$ cat test-hivex.py #!/usr/bin/python import hivex h = hivex.Hivex("NTUSER.004.DAT") r = h.root() node = h.node_get_child(r, "Software") print r print h.node_name(r) print h.node_name(node)
emschwe@station12:~/jean2$ ./test-hivex.py python: hivex-py.c:52: get_handle: Assertion `obj' failed. Aborted emschwe@station12:~/jean2$
I uploaded the NTUSER.DAT file here:
[...]
I cannot get to that URL. It wants me to log in or something.
If you are able to process it on your system, then I'll know it's the installation and I should start all over (again).
Which version are you running? The Ubuntu version in universe doesn't even have any Python bindings. Are you compiling it from source? Please let's keep replies on the list to benefit others who might come across the same problem. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
Sorry -- I guess I don't have a good place to put a large file right now, but will work on that this weekend. I am running v1.2.4 and compiling from source using gcc 4.4.5 on Ubuntu 10.10. Anyone else get it running on Ubuntu before? Elizabeth On Fri, Apr 1, 2011 at 3:16 PM, Richard W.M. Jones <rjones@redhat.com> wrote:
On Fri, Apr 01, 2011 at 03:01:58PM -0400, Elizabeth Schweinsberg wrote:
Richard,
Thanks for the reply. I'm beginning to think it's Ubuntu that's the problem. I acquired a SOFTWARE hive and ran the code you sent on it and I get the same error. I even upgraded to Python 2.7.
My runs:
-------- Your code with my software hive -------- emschwe@station12:~/jean2$ cat test-hivex.py #!/usr/bin/python import hivex h = hivex.Hivex("software") r = h.root() node = h.node_get_child(r, "Microsoft") print r print h.node_name(r) print h.node_name(node)
emschwe@station12:~/jean2$ ./test-hivex.py python: hivex-py.c:52: get_handle: Assertion `obj' failed. Aborted emschwe@station12:~/jean2$
----- My version on NTUSER.DAT ----- emschwe@station12:~/jean2$ cat test-hivex.py #!/usr/bin/python import hivex h = hivex.Hivex("NTUSER.004.DAT") r = h.root() node = h.node_get_child(r, "Software") print r print h.node_name(r) print h.node_name(node)
emschwe@station12:~/jean2$ ./test-hivex.py python: hivex-py.c:52: get_handle: Assertion `obj' failed. Aborted emschwe@station12:~/jean2$
I uploaded the NTUSER.DAT file here:
[...]
I cannot get to that URL. It wants me to log in or something.
If you are able to process it on your system, then I'll know it's the installation and I should start all over (again).
Which version are you running? The Ubuntu version in universe doesn't even have any Python bindings. Are you compiling it from source?
Please let's keep replies on the list to benefit others who might come across the same problem.
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
On Fri, Apr 01, 2011 at 04:39:19PM -0400, Elizabeth Schweinsberg wrote:
Sorry -- I guess I don't have a good place to put a large file right now, but will work on that this weekend.
I am running v1.2.4 and compiling from source using gcc 4.4.5 on Ubuntu 10.10. Anyone else get it running on Ubuntu before?
Yes, I've compiled it from git on Ubuntu 10.10 (x86-64) right now, and all the tests pass fine. The Python tests were broken on Debian (for a very minor reason unrelated to Python); this commit fixes that: http://git.annexia.org/?p=hivex.git;a=commitdiff;h=77b3cd202857a0763cecc8856... Ubuntu 10.10 (maverick) python 2.6.6-2ubuntu2 gcc 4:4.4.4-1ubuntu2 Furthermore I ran your script on /Users/Default/NTUSER.DAT downloaded from a Windows 7 VM: $ file /tmp/NTUSER.DAT /tmp/NTUSER.DAT: MS Windows registry file, NT/2000 or above $ cat /tmp/test.py #!/usr/bin/python import hivex h = hivex.Hivex("/tmp/NTUSER.DAT") r = h.root() node = h.node_get_child(r, "Software") print r print h.node_name(r) print h.node_name(node) $ export LD_LIBRARY_PATH=/home/rjones/d/hivex/lib/.libs $ export PYTHONPATH=/home/rjones/d/hivex/python:/home/rjones/d/hivex/python/.libs $ python /tmp/test.py 4128 CMI-CreateHive{6A1C4018-979D-4291-A7DC-7AED1C75B67C} Software So it all appears to work fine for me on Ubuntu. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
BTW what is the value of HAVE_PYCAPSULE_NEW in config.h? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
The value of HAVE_PYCAPSULE_NEW is undefined in config.h. I found: /* #undef HAVE_PYCAPSULE_NEW */ Is that what you were expecting? I didn't touch config.h. Elizabeth On Fri, Apr 1, 2011 at 6:33 PM, Richard W.M. Jones <rjones@redhat.com> wrote:
BTW what is the value of HAVE_PYCAPSULE_NEW in config.h?
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
_______________________________________________ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
On Mon, Apr 04, 2011 at 03:59:42PM -0400, Elizabeth Schweinsberg wrote:
The value of HAVE_PYCAPSULE_NEW is undefined in config.h. I found:
/* #undef HAVE_PYCAPSULE_NEW */
Is that what you were expecting? I didn't touch config.h.
It's a little bit surprising. AIUI all new versions of Python should support the PyCapsule interface (calls like PyCapsule_new and others). I checked Fedora, and HAVE_PYCAPSULE_NEW is defined. But I also checked Ubuntu 10.10, and HAVE_PYCAPSULE_NEW is _not_ defined, same as for you. This means that you're executing code down a different path from what I'm using (except when I'm using Ubuntu -- where it works for me just fine for whatever reason). I'm not clear what's happening, but you can still help by providing: (a) a minimal test program that fails for you (b) a registry on which it fails I don't yet have an accurate bug reproducer for this, so I'm limited in what I can do to help. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
Hi, I've finally been able to post a hive that is not working on the internet: http://bethlogic.net/NTUSER.004.DAT And then this script has the failed assertion (same as in the email): http://bethlogic.net/test-hivex.py I'm trying checking out the code via git just to see if that produces other results. I'll try setting HAVE_PYCAPSULE_NEW, too. I think this just might be something weird with the set up of my system that the assert fails. I did some "printf debugging" with hivex-py.c and right before the "assert(obj);" line, obj is not 0, which means it should pass, right? Thanks for your assistance so far. Elizabeth On Mon, Apr 4, 2011 at 4:31 PM, Richard W.M. Jones <rjones@redhat.com> wrote:
On Mon, Apr 04, 2011 at 03:59:42PM -0400, Elizabeth Schweinsberg wrote:
The value of HAVE_PYCAPSULE_NEW is undefined in config.h. I found:
/* #undef HAVE_PYCAPSULE_NEW */
Is that what you were expecting? I didn't touch config.h.
It's a little bit surprising.
AIUI all new versions of Python should support the PyCapsule interface (calls like PyCapsule_new and others).
I checked Fedora, and HAVE_PYCAPSULE_NEW is defined.
But I also checked Ubuntu 10.10, and HAVE_PYCAPSULE_NEW is _not_ defined, same as for you.
This means that you're executing code down a different path from what I'm using (except when I'm using Ubuntu -- where it works for me just fine for whatever reason).
I'm not clear what's happening, but you can still help by providing:
(a) a minimal test program that fails for you (b) a registry on which it fails
I don't yet have an accurate bug reproducer for this, so I'm limited in what I can do to help.
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
On Tue, Apr 05, 2011 at 08:18:19AM -0400, Elizabeth Schweinsberg wrote:
I've finally been able to post a hive that is not working on the internet:
There's nothing unusual about this registry file. Hivex is able to decode the whole thing and finds no errors. My small Python test program also can handle it perfectly.
And then this script has the failed assertion (same as in the email):
This gives a 500 internal server error.
I'm trying checking out the code via git just to see if that produces other results. I'll try setting HAVE_PYCAPSULE_NEW, too.
I think this just might be something weird with the set up of my system that the assert fails. I did some "printf debugging" with hivex-py.c and right before the "assert(obj);" line, obj is not 0, which means it should pass, right?
If obj != 0 and yet assert(obj) is throwing an assertion failure, then there's something seriously wrong. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
participants (2)
-
Elizabeth Schweinsberg -
Richard W.M. Jones