[parted-devel] GNU Parted Official Repository: Changes to 'master'

Otavio Salvador otavio at debian.org
Thu Jan 11 14:26:15 CET 2007


"Debarshi Ray" <debarshi.ray at gmail.com> writes:

>>  parted/parted.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> New commits:
>> commit 9e05418de3477666b0709f5d1996149febd33100
>> Author: Otavio Salvador <otavio at debian.org>
>> Date:   Sat Dec 16 18:47:53 2006 -0200
>
> This causes Parted to abort, after dumping the customary stack trace
> and the command history. The reason this happens is that
> ped_device_free_all also closes and destroys the device with which
> Parted was invoked by the user. Therefore any subsequent command whose
> do* counterpart needs PedDevice **dev causes a segmentation fault.
> eg., print (do_print), check (do_check)
>
> (parted) print
> (parted) print devices
> (parted) print
>
> Just give the above commands to recreate the bug.
>
> A way to fix this is to create a deep copy duplicate of PedDeice **dev
> before doing ped_device_free_all. This would require a
> ped_device_duplicate function (similar to ped_disk_duplicate) to be
> written.
>
> What do you think?

I got it. I think it would be nice to have it done and rightly
implemented.

I won't be able to work on it in next days so if you could hack it
would be awesome!

>>     parted/parted.c: Destroy all objects before return when called with --list or --all option.
>
> In fact objects are destroyed only for:
> (parted) print devices
>
> It remains to be done for --list and 'print all'.

Ouch! I don't see why but I will check the code again later. However,
you can fix it too if you want.

-- 
        O T A V I O    S A L V A D O R
---------------------------------------------
 E-mail: otavio at debian.org      UIN: 5906116
 GNU/Linux User: 239058     GPG ID: 49A5F855
 Home Page: http://otavio.ossystems.com.br
---------------------------------------------
"Microsoft sells you Windows ... Linux gives
 you the whole house."



More information about the parted-devel mailing list