[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] Memory corruption when testing nbdkit python plugin with nbd-tester-client?



On Mon, Sep 26, 2016 at 02:18:02PM +0200, Carl-Daniel Hailfinger wrote:
> Hi,
> 
> has anyone ever run "make check" from nbd against nbdkit with a python
> plugin? I usually get segfaults during such a run, and sometimes various
> other errors happen before the segfault, suggesting that some memory
> corruption is underway.
> AFAICS a pure python plugin should not be able to cause memory corruption.

Correct, a python plugin should not cause memory corruption,
and nbdkit shouldn't segfault ever.

Did you get a stack trace from C (not from Python)?

Rich.

> Examples of nbdkit logs for running "make check" or subsets of it from
> nbd against nbdkit:
> 
> nbdkit -n -f python script=ssd-ftl-wearleveling.py disksize=52428800
> nbdkit: python[6]: error: ssd-ftl-wearleveling.py: callback failed: close
> nbdkit: python[7]: error: invalid flush request: expecting offset and
> length == 0
> nbdkit: python[7]: error: write reply: Connection reset by peer
> Segmentation fault
> 
> nbdkit -n -f python script=ssd-ftl-wearleveling.py disksize=52428800
> Fatal Python error: GC object already tracked
> Segmentation fault
> 
> nbdkit -n -f python script=ssd-ftl-wearleveling.py disksize=52428800
> Segmentation fault
> 
> nbdkit -n -f python script=ssd-ftl-wearleveling.py disksize=52428800
> nbdkit: python[1]: error: invalid flush request: expecting offset and
> length == 0
> nbdkit: python[1]: error: write reply: Broken pipe
> nbdkit: python[3]: error: client sent NBD_OPT_ABORT to abort the connection
> nbdkit: python[6]: error: ssd-ftl-wearleveling.py: callback failed: close
> Traceback (most recent call last):
>   File "ssd-ftl-wearleveling.py", line 221, in close
>     pickle.dump(lbahist, f)
>   File "/usr/lib/python2.7/pickle.py", line 1370, in dump
> Segmentation fault (core dumped)
> 
> My close function just dumps the disk image and write access history
> with python pickle. It does not have any return statement, and because
> of that I seriously doubt that said close function can fail.
> 
> I'm now trying to replicate this with example.py. Will report back.
> 
> Regards,
> Carl-Daniel
> 
> _______________________________________________
> Libguestfs mailing list
> Libguestfs redhat com
> https://www.redhat.com/mailman/listinfo/libguestfs

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]