Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#35374 - [util-linux] fdisk segfault with flash drives

Attached to Project: Arch Linux
Opened by Eugene (Infy) - Monday, 20 May 2013, 08:36 GMT
Last edited by Dave Reisner (falconindy) - Wednesday, 22 May 2013, 15:27 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Dave Reisner (falconindy)
Architecture i686
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
Fdisk program crashes when you try to perform certain actions with a flash drive.
Error consistently repeated on three flash drives, which are at enya at hand. Perhaps that affect other types of drives, but with my hard drive error does not occur.

Error does not occur on the old version of util-linux package version 2.22-7.

Additional info:
* package version(s)
[eugene@myatom ~]$ fdisk -v
fdisk from util-linux 2.23

[eugene@myatom ~]$ p -Qi util-linux
Name : util-linux
Version : 2.23-2
Description : Miscellaneous system utilities for Linux
Architecture : i686
URL : http://www.kernel.org/pub/linux/utils/util-linux/
Licences : GPL2
Groups : base base-devel
Provides : util-linux-ng=2.23 eject
Depends On : pam shadow coreutils glibc
Optional Deps : None
Required By : apr cryptsetup e2fsprogs fakeroot jfsutils libsm mkinitcpio ntfs-3g pmount qemu rasqal reiserfsprogs systemd sysvinit-tools udisks udisks2 wget
xfsprogs
Optional For : spacefm
Conflicts With : util-linux-ng eject
Replaces : None
Installed Size : 8743.00 KiB
Packager : Dave Reisner <dreisner@archlinux.org>
Build Date : Mon 13 May 2013 18:28:20 MSK
Install Date : Mon 20 May 2013 12:05:09 MSK
Install Reason : Explicitly installed
Install Script : Yes
Validated By : Signature

* config and/or log files etc.
[eugene@myatom ~]$ dmesg | tail -1
[11762.081885] fdisk[3067]: segfault at 0 ip b75d03d4 sp bfd71630 error 4 in libc-2.17.so[b7589000+1a9000]

Steps to reproduce:
1. Connect the flash drive to the computer;

2. run fdisk:
[eugene @ myatom ~] $ sudo fdisk / dev / sdb
Welcome to fdisk (util-linux 2.23).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p

Disk / dev / sdb: 16.1 GB, 16059990016 bytes, 31367168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical / physical): 512 bytes / 512 bytes
I / O size (minimum / optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x6a81cdd7

Device Boot Start End Blocks Id System
/ dev/sdb1 2048 31367167 15682560 7 HPFS / NTFS / exFAT

Command (m for help):

3. Try some action. For example, to change the system identifier:
Command (m for help): t
[eugene @ myatom ~] $

Same happens with the actions of a, d, g.

4. See dmesg:
[11762.081885] fdisk [3067]: segfault at 0 ip b75d03d4 sp bfd71630 error 4 in libc-2.17.so [b7589000 +1 a9000]
[eugene @ myatom ~] $

// Sorry for my english.
This task depends upon

Closed by  Dave Reisner (falconindy)
Wednesday, 22 May 2013, 15:27 GMT
Reason for closing:  Fixed
Additional comments about closing:  util-linux 2.23-3
Comment by Eugene (Infy) - Monday, 20 May 2013, 09:14 GMT
The problem disappears when building the program with debugging.
Comment by Eugene (Infy) - Monday, 20 May 2013, 09:17 GMT
It seems that the program is compiled with incorrect CFLAGS.
Comment by Eugene (Infy) - Monday, 20 May 2013, 13:15 GMT
Part from make check:
fdisk: align 512/4K ... IGNORE (not root permissions)
fdisk: align 512/4K +alignment_offset ... IGNORE (not root permissions)
fdisk: align 512/4K +MD ... IGNORE (not root permissions)
fdisk: align 512/512 ... IGNORE (not root permissions)
fdisk: align 512/512 +topology ... IGNORE (not root permissions)
fdisk: nested BSD ... OK
fdisk: GPT .../home/eugene/tmp/util-linux/src/util-linux-2.23/tests/ts/fdisk/gpt: line 50: 16380 Done echo -e "${FDISK_CMD_CREATE_GPTLABEL}${FDISK_CMD_WRITE_CLOSE}"
16381 Segmentation fault (core dumped) | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &>/dev/null
FAILED (fdisk/gpt)
fdisk: MBR - id ... OK
fdisk: MBR - dos mode .../home/eugene/tmp/util-linux/src/util-linux-2.23/tests/ts/fdisk/mbr-dos-mode: line 74: 16878 Done echo -e "${FDISK_CMD_INIT}${FDISK_CMD_CHANGE_PARTTYPE}${FDISK_CMD_WRITE_CLOSE}"
16879 Segmentation fault (core dumped) | $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &>/dev/null
/home/eugene/tmp/util-linux/src/util-linux-2.23/tests/ts/fdisk/mbr-dos-mode: line 81: 16913 Done echo -e "${FDISK_CMD_INIT}${FDISK_CMD_SET_ACTIVE}${FDISK_CMD_WRITE_CLOSE}"
16914 Segmentation fault (core dumped) | $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &>/dev/null
/home/eugene/tmp/util-linux/src/util-linux-2.23/tests/ts/fdisk/mbr-dos-mode: line 88: 16948 Done echo -e "${FDISK_CMD_INIT}d\n${FDISK_CMD_CREATE_PRIMARY}${FDISK_CMD_WRITE_CLOSE}"
16949 Segmentation fault (core dumped) | $TS_CMD_FDISK -c=dos -u=cylinders ${TEST_IMAGE_NAME} &>/dev/null
FAILED (fdisk/mbr-dos-mode)
fdisk: MBR - non-dos mode .../home/eugene/tmp/util-linux/src/util-linux-2.23/tests/ts/fdisk/mbr-nondos-mode: line 69: 17306 Done echo -e "${FDISK_CMD_INIT}${FDISK_CMD_SET_ACTIVE}${FDISK_CMD_WRITE_CLOSE}"
17307 Segmentation fault (core dumped) | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &>/dev/null
/home/eugene/tmp/util-linux/src/util-linux-2.23/tests/ts/fdisk/mbr-nondos-mode: line 76: 17341 Done echo -e "${FDISK_CMD_INIT}d\n${FDISK_CMD_CREATE_1PRIMARY}${FDISK_CMD_WRITE_CLOSE}"
17342 Segmentation fault (core dumped) | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &>/dev/null
FAILED (fdisk/mbr-nondos-mode)
fdisk: invalid input tests ... OK
fdisk: sunlabel tests .../home/eugene/tmp/util-linux/src/util-linux-2.23/tests/ts/fdisk/sunlabel: line 41: 17793 Done echo -e "${FDISK_CMD_INIT}${FDISK_CMD_DELETEALL}${FDISK_CMD_WRITE_CLOSE}"
17794 Segmentation fault (core dumped) | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &>/dev/null
FAILED (fdisk/sunlabel)
fsck: is mounted ... IGNORE (not root permissions)
Comment by Dave Reisner (falconindy) - Monday, 20 May 2013, 13:20 GMT
> The problem disappears when building the program with debugging.
Which only means it's a memory corruption or invalid read/write issue. It has nothing to do with CFLAGS being "wrong".
Comment by Dave Reisner (falconindy) - Monday, 20 May 2013, 13:27 GMT
Please rebuild with debug symbols and get a proper backtrace from gdb (bt full)
Comment by Dave Reisner (falconindy) - Monday, 20 May 2013, 13:53 GMT Comment by Dave Reisner (falconindy) - Wednesday, 22 May 2013, 13:04 GMT
ping?
Comment by max (maxmbx) - Wednesday, 22 May 2013, 14:50 GMT
I have this problem only on i686, x86_64 works as it should.
Comment by Dave Reisner (falconindy) - Wednesday, 22 May 2013, 15:25 GMT
-3 in testing fixes your crash.

Loading...