Hide Forgot
Description of problem: when partnum >= 1185, part-get-gpt-type will give an error. libguestfs: error: part_get_gpt_type: sgdisk /dev/sda -i 1185: *** Segmentation fault Register dump: RAX: 0000000000000000 RBX: 00000000019e6018 RCX: 0000000035383131 RDX: 0000000000353831 RSI: 0000000000000200 RDI: 00000000019e6018 RBP: 0000000000000000 R8 : 0000000000000000 R9 : 0000000000000002 ... but guestfish is still alive. It looks like a bug of sgdisk Version-Release number of selected component (if applicable): libguestfs-1.22.6-5.el7.x86_64 gdisk-0.8.6-1.el7.x86_64 How reproducible: 100% Steps to Reproduce: # guestfish -N fs part-disk /dev/sda gpt : part-get-gpt-type /dev/sda 1185 Actual result: Gives a "Segmentation fault" error Expect result: Not return "Segmentation fault" Additional info: I tried "sgdisk /dev/sda -i 1185" in linux, it failed # sgdisk /dev/sda -i 1185 *************************************************************** Found invalid GPT and valid MBR; converting MBR to GPT format. *************************************************************** Segmentation fault (core dumped)
You were right that this is a bug in gdisk. Easily reproducible on the command line: $ sgdisk /dev/sda -i 1185 *************************************************************** Found invalid GPT and valid MBR; converting MBR to GPT format in memory. *************************************************************** Segmentation fault (core dumped) The stack trace is: Program received signal SIGSEGV, Segmentation fault. GPTPart::ShowDetails (this=0x851018, blockSize=512) at gptpart.cc:210 210 if (firstLBA != 0) { (gdb) bt #0 GPTPart::ShowDetails (this=0x851018, blockSize=512) at gptpart.cc:210 #1 0x000000000041015e in GPTData::ShowPartDetails ( this=this@entry=0x7fffffffc470, partNum=<optimized out>) at gpt.cc:1406 #2 0x00000000004193d1 in GPTDataCL::DoOptions ( this=this@entry=0x7fffffffc470, argc=argc@entry=4, argv=argv@entry=0x7fffffffde48) at gptcl.cc:255 #3 0x0000000000402dd6 in main (argc=4, argv=0x7fffffffde48) at sgdisk.cc:20
Backported changes from bug 1007847 and built gdisk-0.8.6-2.el7
This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request.