* util-linux-2.23 mount segmentation fault error @ 2013-05-25 15:46 plan9assembler 2013-05-25 16:26 ` Rich Felker 0 siblings, 1 reply; 25+ messages in thread From: plan9assembler @ 2013-05-25 15:46 UTC (permalink / raw) To: musl [-- Attachment #1: Type: text/plain, Size: 685 bytes --] Hi, i had compile util-linux-2.23 successfully, but when i test mount binary, it getting segmentation fault. http://plan9assembler.wordpress.com/2013/05/25/udev-in-x86_64-linux-musl/ $ cd util-linux-2.23 $ cd .libs $ ./mount mount[5449]: segfault at 2f ip 00007f593a84f903 sp 00008fff894870e8 error 4 in libc.so[7f593a804000+72000] Segmentation fault $ util-linux-2.23 version use qsort_r(), so i added it from ccl (C Containers library <https://code.google.com/p/ccl/>) and changed parameter order. https://ccl.googlecode.com/svn/trunk/qsort_r.c vi musl/include/stdlib.h typedef int cmp_t(void *, const void*, const void*); void qsort_r(void *, size_t, size_t, cmp_t *, void*); [-- Attachment #2: Type: text/html, Size: 1146 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-25 15:46 util-linux-2.23 mount segmentation fault error plan9assembler @ 2013-05-25 16:26 ` Rich Felker 2013-05-25 21:34 ` plan9assembler 0 siblings, 1 reply; 25+ messages in thread From: Rich Felker @ 2013-05-25 16:26 UTC (permalink / raw) To: musl On Sun, May 26, 2013 at 12:46:17AM +0900, plan9assembler wrote: > Hi, > > i had compile util-linux-2.23 successfully, but when i test mount binary, > it getting segmentation fault. > http://plan9assembler.wordpress.com/2013/05/25/udev-in-x86_64-linux-musl/ Did you get any warnings building it? My best guess, since you're on a 64-bit system, is that mount used some function which returns a pointer without having a prototype in scope, and thus the return value got treated as an int then extended to a pointer via gcc's harmful implicit int-to-pointer conversion. Rich ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-25 16:26 ` Rich Felker @ 2013-05-25 21:34 ` plan9assembler 2013-05-26 9:14 ` Szabolcs Nagy 0 siblings, 1 reply; 25+ messages in thread From: plan9assembler @ 2013-05-25 21:34 UTC (permalink / raw) To: musl [-- Attachment #1.1: Type: text/plain, Size: 867 bytes --] Hi, i attached build log, and i have commented out text-utils/pg.c://#include <sys/termios.h> changed __sighandler_t to sighandler_t fdisks/cfdisk.c:sighandler_t old_SIGINT, old_SIGTERM; On Sun, May 26, 2013 at 1:26 AM, Rich Felker <dalias@aerifal.cx> wrote: > On Sun, May 26, 2013 at 12:46:17AM +0900, plan9assembler wrote: > > Hi, > > > > i had compile util-linux-2.23 successfully, but when i test mount binary, > > it getting segmentation fault. > > > http://plan9assembler.wordpress.com/2013/05/25/udev-in-x86_64-linux-musl/ > > Did you get any warnings building it? My best guess, since you're on a > 64-bit system, is that mount used some function which returns a > pointer without having a prototype in scope, and thus the return value > got treated as an int then extended to a pointer via gcc's harmful > implicit int-to-pointer conversion. > > Rich > [-- Attachment #1.2: Type: text/html, Size: 1435 bytes --] [-- Attachment #2: build.log --] [-- Type: application/octet-stream, Size: 21533 bytes --] make all-recursive make[1]: Entering directory `/util-linux-2.23' Making all in po make[2]: Entering directory `/util-linux-2.23/po' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/util-linux-2.23/po' make[2]: Entering directory `/util-linux-2.23' CC lib/libcommon_la-at.lo CC lib/libcommon_la-blkdev.lo CC lib/libcommon_la-canonicalize.lo CC lib/libcommon_la-colors.lo CC lib/libcommon_la-crc32.lo CC lib/libcommon_la-env.lo CC lib/libcommon_la-fileutils.lo CC lib/libcommon_la-ismounted.lo CC lib/libcommon_la-mangle.lo CC lib/libcommon_la-match.lo CC lib/libcommon_la-mbsalign.lo CC lib/libcommon_la-md5.lo CC lib/libcommon_la-pager.lo CC lib/libcommon_la-path.lo lib/path.c:240:1: warning: no previous prototype for 'path_set_prefix' [-Wmissing-prototypes] path_set_prefix(const char *prefix) ^ CC lib/libcommon_la-procutils.lo CC lib/libcommon_la-randutils.lo CC lib/libcommon_la-setproctitle.lo CC lib/libcommon_la-strutils.lo CC lib/libcommon_la-sysfs.lo CC lib/libcommon_la-tt.lo CC lib/libcommon_la-wholedisk.lo CC lib/libcommon_la-ttyutils.lo CC lib/libcommon_la-xgetpass.lo CC lib/libcommon_la-exec_shell.lo lib/exec_shell.c: In function 'exec_shell': lib/exec_shell.c:25:2: warning: missing sentinel in function call [-Wformat=] execl(shell, arg0, NULL); ^ CC lib/libcommon_la-linux_version.lo CC lib/libcommon_la-loopdev.lo CCLD libcommon.la CC libfdisk/src/libfdisk_la-init.lo CC libfdisk/src/libfdisk_la-test.lo CC libfdisk/src/libfdisk_la-ask.lo CC libfdisk/src/libfdisk_la-alignment.lo CC libfdisk/src/libfdisk_la-label.lo CC libfdisk/src/libfdisk_la-utils.lo CC libfdisk/src/libfdisk_la-context.lo CC libfdisk/src/libfdisk_la-parttype.lo CC libfdisk/src/libfdisk_la-gpt.lo CC libblkid/src/libblkid_la-init.lo CC libblkid/src/libblkid_la-cache.lo CC libblkid/src/libblkid_la-config.lo CC libblkid/src/libblkid_la-dev.lo CC libblkid/src/libblkid_la-devname.lo CC libblkid/src/libblkid_la-devno.lo CC libblkid/src/libblkid_la-encode.lo CC libblkid/src/libblkid_la-evaluate.lo CC libblkid/src/libblkid_la-getsize.lo CC libblkid/src/libblkid_la-llseek.lo CC libblkid/src/libblkid_la-probe.lo CC libblkid/src/libblkid_la-read.lo CC libblkid/src/libblkid_la-resolve.lo CC libblkid/src/libblkid_la-save.lo CC libblkid/src/libblkid_la-tag.lo CC libblkid/src/libblkid_la-verify.lo CC libblkid/src/libblkid_la-version.lo CC libblkid/src/partitions/libblkid_la-aix.lo CC libblkid/src/partitions/libblkid_la-bsd.lo CC libblkid/src/partitions/libblkid_la-dos.lo CC libblkid/src/partitions/libblkid_la-gpt.lo CC libblkid/src/partitions/libblkid_la-mac.lo CC libblkid/src/partitions/libblkid_la-minix.lo CC libblkid/src/partitions/libblkid_la-partitions.lo CC libblkid/src/partitions/libblkid_la-sgi.lo CC libblkid/src/partitions/libblkid_la-solaris_x86.lo CC libblkid/src/partitions/libblkid_la-sun.lo CC libblkid/src/partitions/libblkid_la-ultrix.lo CC libblkid/src/partitions/libblkid_la-unixware.lo CC libblkid/src/superblocks/libblkid_la-adaptec_raid.lo CC libblkid/src/superblocks/libblkid_la-befs.lo CC libblkid/src/superblocks/libblkid_la-bfs.lo CC libblkid/src/superblocks/libblkid_la-btrfs.lo CC libblkid/src/superblocks/libblkid_la-cramfs.lo CC libblkid/src/superblocks/libblkid_la-ddf_raid.lo CC libblkid/src/superblocks/libblkid_la-drbd.lo CC libblkid/src/superblocks/libblkid_la-drbdproxy_datalog.lo CC libblkid/src/superblocks/libblkid_la-exfat.lo CC libblkid/src/superblocks/libblkid_la-ext.lo CC libblkid/src/superblocks/libblkid_la-f2fs.lo CC libblkid/src/superblocks/libblkid_la-gfs.lo CC libblkid/src/superblocks/libblkid_la-hfs.lo CC libblkid/src/superblocks/libblkid_la-highpoint_raid.lo CC libblkid/src/superblocks/libblkid_la-hpfs.lo CC libblkid/src/superblocks/libblkid_la-iso9660.lo CC libblkid/src/superblocks/libblkid_la-isw_raid.lo CC libblkid/src/superblocks/libblkid_la-jfs.lo CC libblkid/src/superblocks/libblkid_la-jmicron_raid.lo CC libblkid/src/superblocks/libblkid_la-linux_raid.lo CC libblkid/src/superblocks/libblkid_la-lsi_raid.lo CC libblkid/src/superblocks/libblkid_la-luks.lo CC libblkid/src/superblocks/libblkid_la-lvm.lo CC libblkid/src/superblocks/libblkid_la-minix.lo CC libblkid/src/superblocks/libblkid_la-netware.lo CC libblkid/src/superblocks/libblkid_la-nilfs.lo CC libblkid/src/superblocks/libblkid_la-ntfs.lo CC libblkid/src/superblocks/libblkid_la-nvidia_raid.lo CC libblkid/src/superblocks/libblkid_la-ocfs.lo CC libblkid/src/superblocks/libblkid_la-promise_raid.lo CC libblkid/src/superblocks/libblkid_la-reiserfs.lo CC libblkid/src/superblocks/libblkid_la-romfs.lo CC libblkid/src/superblocks/libblkid_la-silicon_raid.lo CC libblkid/src/superblocks/libblkid_la-squashfs.lo CC libblkid/src/superblocks/libblkid_la-superblocks.lo CC libblkid/src/superblocks/libblkid_la-swap.lo CC libblkid/src/superblocks/libblkid_la-sysv.lo CC libblkid/src/superblocks/libblkid_la-ubifs.lo CC libblkid/src/superblocks/libblkid_la-udf.lo CC libblkid/src/superblocks/libblkid_la-ufs.lo CC libblkid/src/superblocks/libblkid_la-vfat.lo CC libblkid/src/superblocks/libblkid_la-via_raid.lo CC libblkid/src/superblocks/libblkid_la-vmfs.lo CC libblkid/src/superblocks/libblkid_la-vxfs.lo CC libblkid/src/superblocks/libblkid_la-xfs.lo CC libblkid/src/superblocks/libblkid_la-zfs.lo CC libblkid/src/topology/libblkid_la-topology.lo CC libblkid/src/topology/libblkid_la-dm.lo CC libblkid/src/topology/libblkid_la-evms.lo In file included from /include/sys/ioctl.h:7:0, from libblkid/src/topology/evms.c:18: libblkid/src/topology/evms.c: In function 'probe_evms_tp': libblkid/src/topology/evms.c:31:60: warning: overflow in implicit constant conversion [-Woverflow] #define EVMS_GET_STRIPE_INFO _IOR(EVMS_MAJOR, 0xF0, struct evms_stripe_info) ^ libblkid/src/topology/evms.c:59:20: note: in expansion of macro 'EVMS_GET_STRIPE_INFO' if (ioctl(pr->fd, EVMS_GET_STRIPE_INFO, &evms)) ^ CC libblkid/src/topology/libblkid_la-ioctl.lo CC libblkid/src/topology/libblkid_la-lvm.lo CC libblkid/src/topology/libblkid_la-md.lo In file included from /include/sys/ioctl.h:7:0, from libblkid/src/topology/md.c:18: libblkid/src/topology/md.c: In function 'probe_md_tp': libblkid/src/topology/md.c:33:62: warning: overflow in implicit constant conversion [-Woverflow] #define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, struct md_array_info) ^ libblkid/src/topology/md.c:109:16: note: in expansion of macro 'GET_ARRAY_INFO' if (ioctl(fd, GET_ARRAY_INFO, &md)) ^ CC libblkid/src/topology/libblkid_la-sysfs.lo CC libuuid/src/libuuid_la-clear.lo CC libuuid/src/libuuid_la-compare.lo CC libuuid/src/libuuid_la-copy.lo CC libuuid/src/libuuid_la-gen_uuid.lo CC libuuid/src/libuuid_la-isnull.lo CC libuuid/src/libuuid_la-pack.lo CC libuuid/src/libuuid_la-parse.lo CC libuuid/src/libuuid_la-unpack.lo CC libuuid/src/libuuid_la-unparse.lo CC libuuid/src/libuuid_la-uuid_time.lo CC lib/libuuid_la-randutils.lo CCLD libuuid.la CCLD libblkid.la copying selected object files to avoid basename conflicts... CCLD libfdisk.la CC libmount/src/libmount_la-cache.lo CC libmount/src/libmount_la-context.lo CC libmount/src/libmount_la-context_loopdev.lo CC libmount/src/libmount_la-context_mount.lo CC libmount/src/libmount_la-context_umount.lo CC libmount/src/libmount_la-fs.lo CC libmount/src/libmount_la-init.lo CC libmount/src/libmount_la-iter.lo CC libmount/src/libmount_la-lock.lo CC libmount/src/libmount_la-optmap.lo CC libmount/src/libmount_la-optstr.lo CC libmount/src/libmount_la-tab.lo CC libmount/src/libmount_la-tab_diff.lo CC libmount/src/libmount_la-tab_parse.lo CC libmount/src/libmount_la-tab_update.lo CC libmount/src/libmount_la-test.lo CC libmount/src/libmount_la-utils.lo CC libmount/src/libmount_la-version.lo CCLD libmount.la CC text-utils/more.o text-utils/more.c: In function 'main': text-utils/more.c:342:6: warning: variable 'left' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] int left; ^ text-utils/more.c:343:6: warning: variable 'prnames' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] int prnames = 0; ^ text-utils/more.c:344:6: warning: variable 'initopt' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] int initopt = 0; ^ text-utils/more.c:345:6: warning: variable 'srchopt' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] int srchopt = 0; ^ text-utils/more.c:348:8: warning: variable 'initbuf' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] char *initbuf = NULL; ^ CCLD more CC sys-utils/dmesg.o CCLD dmesg CC sys-utils/mount-mount.o CCLD mount CC sys-utils/umount-umount.o CCLD umount CC sys-utils/wdctl.o CCLD wdctl CC sys-utils/mountpoint-mountpoint.o CCLD mountpoint CC misc-utils/lsblk-lsblk.o CCLD lsblk CC misc-utils/findmnt-findmnt.o misc-utils/findmnt.c: In function 'get_tag': misc-utils/findmnt.c:413:75: warning: unused parameter 'col' [-Wunused-parameter] static const char *get_tag(struct libmnt_fs *fs, const char *tagname, int col) ^ CCLD findmnt CC misc-utils/kill.o CCLD kill CC term-utils/agetty.o CCLD agetty CC sys-utils/ctrlaltdel.o CCLD ctrlaltdel CC sys-utils/fsfreeze.o sys-utils/fsfreeze.c: In function 'freeze_f': sys-utils/fsfreeze.c:38:2: warning: overflow in implicit constant conversion [-Woverflow] return ioctl(fd, FIFREEZE, 0); ^ sys-utils/fsfreeze.c: In function 'unfreeze_f': sys-utils/fsfreeze.c:43:2: warning: overflow in implicit constant conversion [-Woverflow] return ioctl(fd, FITHAW, 0); ^ CCLD fsfreeze CC sys-utils/fstrim.o CCLD fstrim CC sys-utils/blkdiscard.o CCLD blkdiscard CC sys-utils/losetup.o sys-utils/losetup.c: In function 'printf_loopdev': sys-utils/losetup.c:139:3: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'ino_t' [-Wformat=] loopcxt_get_device(lc), (int) dev, ino, fname); ^ sys-utils/losetup.c: In function 'set_tt_data': sys-utils/losetup.c:269:5: warning: format '%ju' expects argument of type 'uintmax_t', but argument 3 has type 'ino_t' [-Wformat=] xasprintf(&np, "%ju", ino); ^ CCLD losetup CC sys-utils/swapon-swapon.o CC sys-utils/swapon-swapon-common.o CCLD swapon CC sys-utils/swapoff-swapoff.o CC sys-utils/swapoff-swapon-common.o CCLD swapoff CC sys-utils/pivot_root.o CCLD pivot_root CC sys-utils/switch_root.o CCLD switch_root CC sys-utils/hwclock.o sys-utils/hwclock.c: In function 'set_system_clock': sys-utils/hwclock.c:748:4: warning: passing argument 2 of 'settimeofday' discards 'const' qualifier from pointer target type [enabled by default] rc = settimeofday(&tv, &tz); ^ In file included from sys-utils/hwclock.c:69:0: /include/sys/time.h:36:5: note: expected 'void *' but argument is of type 'const struct timezone *' int settimeofday (const struct timeval *, void *); ^ sys-utils/hwclock.c: In function 'set_system_clock_timezone': sys-utils/hwclock.c:838:4: warning: passing argument 2 of 'settimeofday' discards 'const' qualifier from pointer target type [enabled by default] rc = settimeofday(tv_null, &tz_utc); ^ In file included from sys-utils/hwclock.c:69:0: /include/sys/time.h:36:5: note: expected 'void *' but argument is of type 'const struct timezone *' int settimeofday (const struct timeval *, void *); ^ sys-utils/hwclock.c:843:4: warning: passing argument 2 of 'settimeofday' discards 'const' qualifier from pointer target type [enabled by default] rc = settimeofday(tv_null, &tz); ^ In file included from sys-utils/hwclock.c:69:0: /include/sys/time.h:36:5: note: expected 'void *' but argument is of type 'const struct timezone *' int settimeofday (const struct timeval *, void *); ^ CC sys-utils/hwclock-cmos.o In file included from sys-utils/hwclock-cmos.c:96:0: sys-utils/hwclock.h:30:59: warning: 'struct timeval' declared inside parameter list [enabled by default] extern double time_diff(struct timeval subtrahend, struct timeval subtractor); ^ sys-utils/hwclock.h:30:59: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] CC sys-utils/hwclock-kd.o In file included from sys-utils/hwclock-kd.c:4:0: sys-utils/hwclock.h:30:59: warning: 'struct timeval' declared inside parameter list [enabled by default] extern double time_diff(struct timeval subtrahend, struct timeval subtractor); ^ sys-utils/hwclock.h:30:59: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] CC sys-utils/hwclock-rtc.o In file included from /include/sys/ioctl.h:7:0, from sys-utils/hwclock-rtc.c:10: sys-utils/hwclock-rtc.c: In function 'do_rtc_read_ioctl': sys-utils/hwclock-rtc.c:86:45: warning: overflow in implicit constant conversion [-Woverflow] # define RTC_RD_TIME _IOR('p', 0x09, struct linux_rtc_time) ^ sys-utils/hwclock-rtc.c:192:22: note: in expansion of macro 'RTC_RD_TIME' rc = ioctl(rtc_fd, RTC_RD_TIME, tm); ^ sys-utils/hwclock-rtc.c: In function 'get_epoch_rtc': sys-utils/hwclock-rtc.c:440:2: warning: overflow in implicit constant conversion [-Woverflow] if (ioctl(rtc_fd, RTC_EPOCH_READ, epoch_p) == -1) { ^ CCLD hwclock CC misc-utils/blkid-blkid.o CCLD blkid CC misc-utils/findfs-findfs.o CCLD findfs CC misc-utils/wipefs-wipefs.o CCLD wipefs CC disk-utils/fsck.minix.o disk-utils/fsck.minix.c: In function 'check_file2': disk-utils/fsck.minix.c:1051:11: warning: format '%ju' expects argument of type 'uintmax_t', but argument 2 has type 'ino_t' [-Wformat=] inode->i_nlinks); ^ CCLD fsck.minix CC disk-utils/mkfs.minix.o CCLD mkfs.minix CC disk-utils/mkfs.o CCLD mkfs CC disk-utils/mkfs.bfs.o CCLD mkfs.bfs CC disk-utils/mkswap-mkswap.o CCLD mkswap CC disk-utils/swaplabel-swaplabel.o CCLD swaplabel CC disk-utils/fsck-fsck.o CCLD fsck CC disk-utils/raw.o CCLD raw CC disk-utils/fsck.cramfs.o CC disk-utils/cramfs_common.o CCLD fsck.cramfs CC disk-utils/mkfs.cramfs.o CCLD mkfs.cramfs CC disk-utils/blockdev.o disk-utils/blockdev.c: In function 'report_device': disk-utils/blockdev.c:453:6: warning: overflow in implicit constant conversion [-Woverflow] ioctl(fd, BLKBSZGET, &bsz) == 0 && ^ CCLD blockdev CC fdisks/fdisk-fdisk.o CC fdisks/fdisk-fdisk-ask.o CC fdisks/fdisk-fdiskbsdlabel.o CC fdisks/fdisk-fdiskdoslabel.o CC fdisks/fdisk-fdiskmaclabel.o CC fdisks/fdisk-fdisksgilabel.o CC fdisks/fdisk-fdisksunlabel.o fdisks/fdisksunlabel.c: In function 'sun_verify_disklabel': fdisks/fdisksunlabel.c:454:4: warning: passing argument 4 of 'qsort_r' from incompatible pointer type [enabled by default] verify_sun_starts); ^ In file included from fdisks/fdisksunlabel.c:14:0: /include/stdlib.h:56:6: note: expected 'int (*)(void *, const void *, const void *)' but argument is of type 'int (*)(const void *, const void *, void *)' void qsort_r (void *, size_t, size_t, cmp_t *, void *); ^ CC fdisks/fdisk-partname.o CCLD fdisk CC fdisks/partname.o CC fdisks/sfdisk.o CCLD sfdisk CC fdisks/cfdisk-cfdisk.o fdisks/cfdisk.c: In function 'get_string': fdisks/cfdisk.c:456:2: warning: implicit declaration of function 'get_wch' [-Wimplicit-function-declaration] if (get_wch(&c) == ERR) { ^ CCLD cfdisk CC schedutils/chrt.o CCLD chrt CC schedutils/ionice.o CCLD ionice CC text-utils/col.o CCLD col CC text-utils/colcrt.o CCLD colcrt CC text-utils/colrm.o CCLD colrm CC text-utils/column.o CCLD column CC text-utils/conv.o CC text-utils/display.o CC text-utils/hexdump.o CC text-utils/hexsyntax.o CC text-utils/parse.o CCLD hexdump CC text-utils/rev.o CCLD rev CC text-utils/tailf.o CCLD tailf CC text-utils/pg.o text-utils/pg.c: In function 'pgfile': text-utils/pg.c:1352:13: warning: missing sentinel in function call [-Wformat=] cmd.cmdline + 1, NULL); ^ text-utils/pg.c:880:21: warning: variable 'fpos' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] off_t pos, oldpos, fpos; ^ text-utils/pg.c:891:11: warning: variable 'searchcount' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] unsigned searchcount = 0; ^ text-utils/pg.c:897:6: warning: variable 'nobuf' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] int nobuf = 0; ^ CCLD pg CC text-utils/ul.o CCLD ul CC term-utils/script.o CCLD script CC term-utils/scriptreplay.o CCLD scriptreplay CC term-utils/setterm.o CCLD setterm CC term-utils/wall-wall.o CC term-utils/wall-ttymsg.o CCLD wall CC sys-utils/flock.o CCLD flock CC sys-utils/ipcmk.o CCLD ipcmk CC sys-utils/ipcrm.o CCLD ipcrm CC sys-utils/ipcs.o CC sys-utils/ipcutils.o CCLD ipcs CC sys-utils/renice.o CCLD renice CC sys-utils/setsid.o CCLD setsid CC sys-utils/cytune.o CCLD cytune CC sys-utils/setarch.o CCLD setarch CC sys-utils/prlimit.o sys-utils/prlimit.c: In function 'do_prlimit': sys-utils/prlimit.c:356:5: warning: format '%ju' expects argument of type 'uintmax_t', but argument 2 has type 'rlim_t' [-Wformat=] printf("<%ju", new->rlim_cur); ^ sys-utils/prlimit.c:361:5: warning: format '%ju' expects argument of type 'uintmax_t', but argument 2 has type 'rlim_t' [-Wformat=] printf(":%ju>\n", new->rlim_max); ^ CCLD prlimit CC sys-utils/fallocate.o CCLD fallocate CC sys-utils/unshare.o CCLD unshare CC sys-utils/nsenter.o CCLD nsenter CC misc-utils/cal.o CC lib/mbsalign.o CC lib/strutils.o CCLD cal CC misc-utils/logger.o CCLD logger CC misc-utils/look.o CCLD look CC misc-utils/mcookie.o CC lib/md5.o CCLD mcookie CC misc-utils/namei.o CCLD namei CC misc-utils/whereis.o CCLD whereis CC misc-utils/lslocks-lslocks.o misc-utils/lslocks.c: In function 'get_dev_inode': misc-utils/lslocks.c:222:2: warning: format '%ju' expects argument of type 'uintmax_t *', but argument 5 has type 'ino_t *' [-Wformat=] sscanf(str, "%02x:%02x:%ju", &maj, &min, &inum); ^ CCLD lslocks CC misc-utils/uuidgen-uuidgen.o CCLD uuidgen CC misc-utils/rename.o CCLD rename CC misc-utils/getopt.o CCLD getopt CC disk-utils/isosize.o CCLD isosize CC sys-utils/readprofile.o CCLD readprofile CC sys-utils/ldattach.o CCLD ldattach CC sys-utils/rtcwake.o CCLD rtcwake CC misc-utils/uuidd-uuidd.o CCLD uuidd CC disk-utils/fdformat.o CCLD fdformat CC disk-utils/partx-partx.o CCLD partx CC disk-utils/addpart.o CCLD addpart CC disk-utils/delpart.o CCLD delpart CC disk-utils/resizepart.o CCLD resizepart GEN misc-utils/uuidd.8 GEN sys-utils/linux32.8 GEN sys-utils/linux64.8 GEN sys-utils/i386.8 GEN sys-utils/x86_64.8 GEN libuuid/uuid.pc GEN libblkid/blkid.pc GEN libmount/mount.pc make[2]: Leaving directory `/util-linux-2.23' make[1]: Leaving directory `/util-linux-2.23' ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-25 21:34 ` plan9assembler @ 2013-05-26 9:14 ` Szabolcs Nagy 2013-05-26 11:22 ` plan9assembler 0 siblings, 1 reply; 25+ messages in thread From: Szabolcs Nagy @ 2013-05-26 9:14 UTC (permalink / raw) To: musl * plan9assembler <plan9assembler@gmail.com> [2013-05-26 06:34:12 +0900]: > Hi, i attached build log, and there were some minor musl issues: _IOR macro for ioctl should use 2U<<30 instead of 2<<30 settimeofday should follow the bsd declaration x86_64 posix types should be long instead of long long (glibc is not entirely consistent on x86_64: the types in user.h use long long) (i can prepare patches for these) your qsort_r seem to have the wrong prototype (does not match cmp_t) there are some other problems as well, i'm not sure which one trips mount, maybe you should recompile musl and util-linux with -O0 -g3 and get a backtrace from the crash ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-26 9:14 ` Szabolcs Nagy @ 2013-05-26 11:22 ` plan9assembler 2013-05-27 14:05 ` plan9assembler 0 siblings, 1 reply; 25+ messages in thread From: plan9assembler @ 2013-05-26 11:22 UTC (permalink / raw) To: musl [-- Attachment #1: Type: text/plain, Size: 1112 bytes --] 1,2 was fixed, but still gets segfault. 2 trivial, cmp(t,x,y) to cmp(x,y,t), (thunk,a,b) to (a,b,thunk) etc. 1. _IOR macro for ioctl should use 2U<<30 instead of 2<<30 2. your qsort_r seem to have the wrong prototype 3 is fine by me. 3. settimeofday should follow the bsd declaration other points need to be checked, i will look at these. TIA On Sun, May 26, 2013 at 6:14 PM, Szabolcs Nagy <nsz@port70.net> wrote: > * plan9assembler <plan9assembler@gmail.com> [2013-05-26 06:34:12 +0900]: > > Hi, i attached build log, and > > there were some minor musl issues: > _IOR macro for ioctl should use 2U<<30 instead of 2<<30 > settimeofday should follow the bsd declaration > x86_64 posix types should be long instead of long long > > (glibc is not entirely consistent on x86_64: > the types in user.h use long long) > > (i can prepare patches for these) > > your qsort_r seem to have the wrong prototype > (does not match cmp_t) > > there are some other problems as well, i'm not sure > which one trips mount, maybe you should recompile > musl and util-linux with -O0 -g3 and get a backtrace > from the crash > [-- Attachment #2: Type: text/html, Size: 1651 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-26 11:22 ` plan9assembler @ 2013-05-27 14:05 ` plan9assembler 2013-05-27 14:29 ` Szabolcs Nagy 0 siblings, 1 reply; 25+ messages in thread From: plan9assembler @ 2013-05-27 14:05 UTC (permalink / raw) To: musl [-- Attachment #1.1: Type: text/plain, Size: 1745 bytes --] util-linux-2.23 mount segfault error seems to be solved. no more segfault error, when i test mount binary. i modified follow macros in musl /include/bits/ioctl.h and musl libc reinstalled. - #define _IOR(a,b,c) _IOC(2,(a),(b),sizeof(c)) - #define _IOWR(a,b,c) _IOC(3,(a),(b),sizeof(c)) + #define _IOR(a,b,c) _IOC(2U,(a),(b),sizeof(c)) + #define _IOWR(a,b,c) _IOC(3U,(a),(b),sizeof(c)) other points just removed some warings. ex) , ino); to , (uintmax_t) ino); // etc build log attached. TIA On Sun, May 26, 2013 at 8:22 PM, plan9assembler <plan9assembler@gmail.com>wrote: > 1,2 was fixed, but still gets segfault. 2 trivial, cmp(t,x,y) to > cmp(x,y,t), (thunk,a,b) to (a,b,thunk) etc. > 1. _IOR macro for ioctl should use 2U<<30 instead of 2<<30 > 2. your qsort_r seem to have the wrong prototype > > 3 is fine by me. > 3. settimeofday should follow the bsd declaration > > other points need to be checked, i will look at these. > TIA > > > On Sun, May 26, 2013 at 6:14 PM, Szabolcs Nagy <nsz@port70.net> wrote: > >> * plan9assembler <plan9assembler@gmail.com> [2013-05-26 06:34:12 +0900]: >> > Hi, i attached build log, and >> >> there were some minor musl issues: >> _IOR macro for ioctl should use 2U<<30 instead of 2<<30 >> settimeofday should follow the bsd declaration >> x86_64 posix types should be long instead of long long >> >> (glibc is not entirely consistent on x86_64: >> the types in user.h use long long) >> >> (i can prepare patches for these) >> >> your qsort_r seem to have the wrong prototype >> (does not match cmp_t) >> >> there are some other problems as well, i'm not sure >> which one trips mount, maybe you should recompile >> musl and util-linux with -O0 -g3 and get a backtrace >> from the crash >> > > [-- Attachment #1.2: Type: text/html, Size: 2829 bytes --] [-- Attachment #2: build.log --] [-- Type: application/octet-stream, Size: 15923 bytes --] make all-recursive make[1]: Entering directory `/util-linux-2.23' Making all in po make[2]: Entering directory `/util-linux-2.23/po' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/util-linux-2.23/po' make[2]: Entering directory `/util-linux-2.23' CC lib/libcommon_la-at.lo CC lib/libcommon_la-blkdev.lo CC lib/libcommon_la-canonicalize.lo CC lib/libcommon_la-colors.lo CC lib/libcommon_la-crc32.lo CC lib/libcommon_la-env.lo CC lib/libcommon_la-fileutils.lo CC lib/libcommon_la-ismounted.lo CC lib/libcommon_la-mangle.lo CC lib/libcommon_la-match.lo CC lib/libcommon_la-mbsalign.lo CC lib/libcommon_la-md5.lo CC lib/libcommon_la-pager.lo CC lib/libcommon_la-path.lo lib/path.c:240:1: warning: no previous prototype for 'path_set_prefix' [-Wmissing-prototypes] path_set_prefix(const char *prefix) ^ CC lib/libcommon_la-procutils.lo CC lib/libcommon_la-randutils.lo CC lib/libcommon_la-setproctitle.lo CC lib/libcommon_la-strutils.lo CC lib/libcommon_la-sysfs.lo CC lib/libcommon_la-tt.lo CC lib/libcommon_la-wholedisk.lo CC lib/libcommon_la-ttyutils.lo CC lib/libcommon_la-xgetpass.lo CC lib/libcommon_la-exec_shell.lo CC lib/libcommon_la-linux_version.lo CC lib/libcommon_la-loopdev.lo CCLD libcommon.la CC libfdisk/src/libfdisk_la-init.lo CC libfdisk/src/libfdisk_la-test.lo CC libfdisk/src/libfdisk_la-ask.lo CC libfdisk/src/libfdisk_la-alignment.lo CC libfdisk/src/libfdisk_la-label.lo CC libfdisk/src/libfdisk_la-utils.lo CC libfdisk/src/libfdisk_la-context.lo CC libfdisk/src/libfdisk_la-parttype.lo CC libfdisk/src/libfdisk_la-gpt.lo CC libblkid/src/libblkid_la-init.lo CC libblkid/src/libblkid_la-cache.lo CC libblkid/src/libblkid_la-config.lo CC libblkid/src/libblkid_la-dev.lo CC libblkid/src/libblkid_la-devname.lo CC libblkid/src/libblkid_la-devno.lo CC libblkid/src/libblkid_la-encode.lo CC libblkid/src/libblkid_la-evaluate.lo CC libblkid/src/libblkid_la-getsize.lo CC libblkid/src/libblkid_la-llseek.lo CC libblkid/src/libblkid_la-probe.lo CC libblkid/src/libblkid_la-read.lo CC libblkid/src/libblkid_la-resolve.lo CC libblkid/src/libblkid_la-save.lo CC libblkid/src/libblkid_la-tag.lo CC libblkid/src/libblkid_la-verify.lo CC libblkid/src/libblkid_la-version.lo CC libblkid/src/partitions/libblkid_la-aix.lo CC libblkid/src/partitions/libblkid_la-bsd.lo CC libblkid/src/partitions/libblkid_la-dos.lo CC libblkid/src/partitions/libblkid_la-gpt.lo CC libblkid/src/partitions/libblkid_la-mac.lo CC libblkid/src/partitions/libblkid_la-minix.lo CC libblkid/src/partitions/libblkid_la-partitions.lo CC libblkid/src/partitions/libblkid_la-sgi.lo CC libblkid/src/partitions/libblkid_la-solaris_x86.lo CC libblkid/src/partitions/libblkid_la-sun.lo CC libblkid/src/partitions/libblkid_la-ultrix.lo CC libblkid/src/partitions/libblkid_la-unixware.lo CC libblkid/src/superblocks/libblkid_la-adaptec_raid.lo CC libblkid/src/superblocks/libblkid_la-befs.lo CC libblkid/src/superblocks/libblkid_la-bfs.lo CC libblkid/src/superblocks/libblkid_la-btrfs.lo CC libblkid/src/superblocks/libblkid_la-cramfs.lo CC libblkid/src/superblocks/libblkid_la-ddf_raid.lo CC libblkid/src/superblocks/libblkid_la-drbd.lo CC libblkid/src/superblocks/libblkid_la-drbdproxy_datalog.lo CC libblkid/src/superblocks/libblkid_la-exfat.lo CC libblkid/src/superblocks/libblkid_la-ext.lo CC libblkid/src/superblocks/libblkid_la-f2fs.lo CC libblkid/src/superblocks/libblkid_la-gfs.lo CC libblkid/src/superblocks/libblkid_la-hfs.lo CC libblkid/src/superblocks/libblkid_la-highpoint_raid.lo CC libblkid/src/superblocks/libblkid_la-hpfs.lo CC libblkid/src/superblocks/libblkid_la-iso9660.lo CC libblkid/src/superblocks/libblkid_la-isw_raid.lo CC libblkid/src/superblocks/libblkid_la-jfs.lo CC libblkid/src/superblocks/libblkid_la-jmicron_raid.lo CC libblkid/src/superblocks/libblkid_la-linux_raid.lo CC libblkid/src/superblocks/libblkid_la-lsi_raid.lo CC libblkid/src/superblocks/libblkid_la-luks.lo CC libblkid/src/superblocks/libblkid_la-lvm.lo CC libblkid/src/superblocks/libblkid_la-minix.lo CC libblkid/src/superblocks/libblkid_la-netware.lo CC libblkid/src/superblocks/libblkid_la-nilfs.lo CC libblkid/src/superblocks/libblkid_la-ntfs.lo CC libblkid/src/superblocks/libblkid_la-nvidia_raid.lo CC libblkid/src/superblocks/libblkid_la-ocfs.lo CC libblkid/src/superblocks/libblkid_la-promise_raid.lo CC libblkid/src/superblocks/libblkid_la-reiserfs.lo CC libblkid/src/superblocks/libblkid_la-romfs.lo CC libblkid/src/superblocks/libblkid_la-silicon_raid.lo CC libblkid/src/superblocks/libblkid_la-squashfs.lo CC libblkid/src/superblocks/libblkid_la-superblocks.lo CC libblkid/src/superblocks/libblkid_la-swap.lo CC libblkid/src/superblocks/libblkid_la-sysv.lo CC libblkid/src/superblocks/libblkid_la-ubifs.lo CC libblkid/src/superblocks/libblkid_la-udf.lo CC libblkid/src/superblocks/libblkid_la-ufs.lo CC libblkid/src/superblocks/libblkid_la-vfat.lo CC libblkid/src/superblocks/libblkid_la-via_raid.lo CC libblkid/src/superblocks/libblkid_la-vmfs.lo CC libblkid/src/superblocks/libblkid_la-vxfs.lo CC libblkid/src/superblocks/libblkid_la-xfs.lo CC libblkid/src/superblocks/libblkid_la-zfs.lo CC libblkid/src/topology/libblkid_la-topology.lo CC libblkid/src/topology/libblkid_la-dm.lo CC libblkid/src/topology/libblkid_la-evms.lo CC libblkid/src/topology/libblkid_la-ioctl.lo CC libblkid/src/topology/libblkid_la-lvm.lo CC libblkid/src/topology/libblkid_la-md.lo CC libblkid/src/topology/libblkid_la-sysfs.lo CC libuuid/src/libuuid_la-clear.lo CC libuuid/src/libuuid_la-compare.lo CC libuuid/src/libuuid_la-copy.lo CC libuuid/src/libuuid_la-gen_uuid.lo CC libuuid/src/libuuid_la-isnull.lo CC libuuid/src/libuuid_la-pack.lo CC libuuid/src/libuuid_la-parse.lo CC libuuid/src/libuuid_la-unpack.lo CC libuuid/src/libuuid_la-unparse.lo CC libuuid/src/libuuid_la-uuid_time.lo CC lib/libuuid_la-randutils.lo CCLD libuuid.la CCLD libblkid.la copying selected object files to avoid basename conflicts... CCLD libfdisk.la CC libmount/src/libmount_la-cache.lo CC libmount/src/libmount_la-context.lo CC libmount/src/libmount_la-context_loopdev.lo CC libmount/src/libmount_la-context_mount.lo CC libmount/src/libmount_la-context_umount.lo CC libmount/src/libmount_la-fs.lo CC libmount/src/libmount_la-init.lo CC libmount/src/libmount_la-iter.lo CC libmount/src/libmount_la-lock.lo CC libmount/src/libmount_la-optmap.lo CC libmount/src/libmount_la-optstr.lo CC libmount/src/libmount_la-tab.lo CC libmount/src/libmount_la-tab_diff.lo CC libmount/src/libmount_la-tab_parse.lo CC libmount/src/libmount_la-tab_update.lo CC libmount/src/libmount_la-test.lo CC libmount/src/libmount_la-utils.lo CC libmount/src/libmount_la-version.lo CCLD libmount.la CC text-utils/more.o text-utils/more.c: In function 'main': text-utils/more.c:342:6: warning: variable 'left' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] int left; ^ text-utils/more.c:343:6: warning: variable 'prnames' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] int prnames = 0; ^ text-utils/more.c:344:6: warning: variable 'initopt' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] int initopt = 0; ^ text-utils/more.c:345:6: warning: variable 'srchopt' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] int srchopt = 0; ^ text-utils/more.c:348:8: warning: variable 'initbuf' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] char *initbuf = NULL; ^ CCLD more CC sys-utils/dmesg.o CCLD dmesg CC sys-utils/mount-mount.o CCLD mount CC sys-utils/umount-umount.o CCLD umount CC sys-utils/wdctl.o CCLD wdctl CC sys-utils/mountpoint-mountpoint.o CCLD mountpoint CC misc-utils/lsblk-lsblk.o CCLD lsblk CC misc-utils/findmnt-findmnt.o misc-utils/findmnt.c: In function 'get_tag': misc-utils/findmnt.c:413:75: warning: unused parameter 'col' [-Wunused-parameter] static const char *get_tag(struct libmnt_fs *fs, const char *tagname, int col) ^ CCLD findmnt CC misc-utils/kill.o CCLD kill CC term-utils/agetty.o CCLD agetty CC sys-utils/ctrlaltdel.o CCLD ctrlaltdel CC sys-utils/fsfreeze.o CCLD fsfreeze CC sys-utils/fstrim.o CCLD fstrim CC sys-utils/blkdiscard.o CCLD blkdiscard CC sys-utils/losetup.o CCLD losetup CC sys-utils/swapon-swapon.o CC sys-utils/swapon-swapon-common.o CCLD swapon CC sys-utils/swapoff-swapoff.o CC sys-utils/swapoff-swapon-common.o CCLD swapoff CC sys-utils/pivot_root.o CCLD pivot_root CC sys-utils/switch_root.o CCLD switch_root CC sys-utils/hwclock.o CC sys-utils/hwclock-cmos.o In file included from sys-utils/hwclock-cmos.c:96:0: sys-utils/hwclock.h:30:59: warning: 'struct timeval' declared inside parameter list [enabled by default] extern double time_diff(struct timeval subtrahend, struct timeval subtractor); ^ sys-utils/hwclock.h:30:59: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] CC sys-utils/hwclock-kd.o In file included from sys-utils/hwclock-kd.c:4:0: sys-utils/hwclock.h:30:59: warning: 'struct timeval' declared inside parameter list [enabled by default] extern double time_diff(struct timeval subtrahend, struct timeval subtractor); ^ sys-utils/hwclock.h:30:59: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] CC sys-utils/hwclock-rtc.o CCLD hwclock CC misc-utils/blkid-blkid.o CCLD blkid CC misc-utils/findfs-findfs.o CCLD findfs CC misc-utils/wipefs-wipefs.o CCLD wipefs CC disk-utils/fsck.minix.o CCLD fsck.minix CC disk-utils/mkfs.minix.o CCLD mkfs.minix CC disk-utils/mkfs.o CCLD mkfs CC disk-utils/mkfs.bfs.o CCLD mkfs.bfs CC disk-utils/mkswap-mkswap.o CCLD mkswap CC disk-utils/swaplabel-swaplabel.o CCLD swaplabel CC disk-utils/fsck-fsck.o CCLD fsck CC disk-utils/raw.o CCLD raw CC disk-utils/fsck.cramfs.o CC disk-utils/cramfs_common.o CCLD fsck.cramfs CC disk-utils/mkfs.cramfs.o CCLD mkfs.cramfs CC disk-utils/blockdev.o CCLD blockdev CC fdisks/fdisk-fdisk.o CC fdisks/fdisk-fdisk-ask.o CC fdisks/fdisk-fdiskbsdlabel.o CC fdisks/fdisk-fdiskdoslabel.o CC fdisks/fdisk-fdiskmaclabel.o CC fdisks/fdisk-fdisksgilabel.o CC fdisks/fdisk-fdisksunlabel.o CC fdisks/fdisk-partname.o CCLD fdisk CC fdisks/partname.o CC fdisks/sfdisk.o CCLD sfdisk CC fdisks/cfdisk-cfdisk.o fdisks/cfdisk.c: In function 'get_string': fdisks/cfdisk.c:456:2: warning: implicit declaration of function 'get_wch' [-Wimplicit-function-declaration] if (get_wch(&c) == ERR) { ^ CCLD cfdisk CC schedutils/chrt.o CCLD chrt CC schedutils/ionice.o CCLD ionice CC text-utils/col.o CCLD col CC text-utils/colcrt.o CCLD colcrt CC text-utils/colrm.o CCLD colrm CC text-utils/column.o CCLD column CC text-utils/conv.o CC text-utils/display.o CC text-utils/hexdump.o CC text-utils/hexsyntax.o CC text-utils/parse.o CCLD hexdump CC text-utils/rev.o CCLD rev CC text-utils/tailf.o CCLD tailf CC text-utils/pg.o text-utils/pg.c: In function 'pgfile': text-utils/pg.c:1352:13: warning: missing sentinel in function call [-Wformat=] cmd.cmdline + 1, NULL); ^ text-utils/pg.c:880:21: warning: variable 'fpos' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] off_t pos, oldpos, fpos; ^ text-utils/pg.c:891:11: warning: variable 'searchcount' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] unsigned searchcount = 0; ^ text-utils/pg.c:897:6: warning: variable 'nobuf' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] int nobuf = 0; ^ CCLD pg CC text-utils/ul.o CCLD ul CC term-utils/script.o CCLD script CC term-utils/scriptreplay.o CCLD scriptreplay CC term-utils/setterm.o CCLD setterm CC term-utils/wall-wall.o CC term-utils/wall-ttymsg.o CCLD wall CC sys-utils/flock.o CCLD flock CC sys-utils/ipcmk.o CCLD ipcmk CC sys-utils/ipcrm.o CCLD ipcrm CC sys-utils/ipcs.o CC sys-utils/ipcutils.o CCLD ipcs CC sys-utils/renice.o CCLD renice CC sys-utils/setsid.o CCLD setsid CC sys-utils/cytune.o CCLD cytune CC sys-utils/setarch.o CCLD setarch CC sys-utils/prlimit.o CCLD prlimit CC sys-utils/fallocate.o CCLD fallocate CC sys-utils/unshare.o CCLD unshare CC sys-utils/nsenter.o CCLD nsenter CC misc-utils/cal.o CC lib/mbsalign.o CC lib/strutils.o CCLD cal CC misc-utils/logger.o CCLD logger CC misc-utils/look.o CCLD look CC misc-utils/mcookie.o CC lib/md5.o CCLD mcookie CC misc-utils/namei.o CCLD namei CC misc-utils/whereis.o CCLD whereis CC misc-utils/lslocks-lslocks.o CCLD lslocks CC misc-utils/uuidgen-uuidgen.o CCLD uuidgen CC misc-utils/rename.o CCLD rename CC misc-utils/getopt.o CCLD getopt CC disk-utils/isosize.o CCLD isosize CC sys-utils/readprofile.o CCLD readprofile CC sys-utils/ldattach.o CCLD ldattach CC sys-utils/rtcwake.o CCLD rtcwake CC misc-utils/uuidd-uuidd.o CCLD uuidd CC disk-utils/fdformat.o CCLD fdformat CC disk-utils/partx-partx.o CCLD partx CC disk-utils/addpart.o CCLD addpart CC disk-utils/delpart.o CCLD delpart CC disk-utils/resizepart.o CCLD resizepart GEN misc-utils/uuidd.8 GEN sys-utils/linux32.8 GEN sys-utils/linux64.8 GEN sys-utils/i386.8 GEN sys-utils/x86_64.8 GEN libuuid/uuid.pc GEN libblkid/blkid.pc GEN libmount/mount.pc make[2]: Leaving directory `/util-linux-2.23' make[1]: Leaving directory `/util-linux-2.23' ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-27 14:05 ` plan9assembler @ 2013-05-27 14:29 ` Szabolcs Nagy 2013-05-27 21:40 ` plan9assembler 0 siblings, 1 reply; 25+ messages in thread From: Szabolcs Nagy @ 2013-05-27 14:29 UTC (permalink / raw) To: musl * plan9assembler <plan9assembler@gmail.com> [2013-05-27 23:05:37 +0900]: > util-linux-2.23 mount segfault error seems to be solved. > no more segfault error, when i test mount binary. > > i modified follow macros in musl /include/bits/ioctl.h and musl libc > reinstalled. > > - #define _IOR(a,b,c) _IOC(2,(a),(b),sizeof(c)) > - #define _IOWR(a,b,c) _IOC(3,(a),(b),sizeof(c)) > > + #define _IOR(a,b,c) _IOC(2U,(a),(b),sizeof(c)) > + #define _IOWR(a,b,c) _IOC(3U,(a),(b),sizeof(c)) > hm are you sure this was the change that solved the segfault? that would be scary since the linux headers have signed int left shift overflows in many places (and as far as i know users of those headers dont use special compilation flags to make signed overflow well-defined like gcc -fwrapv) which compiler did you use and with what flags? (this could break a lot of legacy code) ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-27 14:29 ` Szabolcs Nagy @ 2013-05-27 21:40 ` plan9assembler 2013-05-29 13:46 ` plan9assembler 2013-05-29 14:11 ` Luca Barbato 0 siblings, 2 replies; 25+ messages in thread From: plan9assembler @ 2013-05-27 21:40 UTC (permalink / raw) To: musl [-- Attachment #1: Type: text/plain, Size: 1504 bytes --] Hi, i am sure but it works for me. actually, it little strange, because, after modification, first time, it getting segfaults, later, it works fine. flags in util-linux-2.23 was created automatically. musl linux system could be set by this method: https://github.com/pikhq/bootstrap-linux/issues/8 https://github.com/pikhq/bootstrap-linux/issues/9 http://plan9assembler.wordpress.com/2013/04/26/bootstrap-linux-musl-cross/ gcc-4.8 CC = gcc -std=gnu99 CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 CPP = gcc -E TIA On Mon, May 27, 2013 at 11:29 PM, Szabolcs Nagy <nsz@port70.net> wrote: > * plan9assembler <plan9assembler@gmail.com> [2013-05-27 23:05:37 +0900]: > > util-linux-2.23 mount segfault error seems to be solved. > > no more segfault error, when i test mount binary. > > > > i modified follow macros in musl /include/bits/ioctl.h and musl libc > > reinstalled. > > > > - #define _IOR(a,b,c) _IOC(2,(a),(b),sizeof(c)) > > - #define _IOWR(a,b,c) _IOC(3,(a),(b),sizeof(c)) > > > > + #define _IOR(a,b,c) _IOC(2U,(a),(b),sizeof(c)) > > + #define _IOWR(a,b,c) _IOC(3U,(a),(b),sizeof(c)) > > > > hm are you sure this was the change that solved the segfault? > > that would be scary since the linux headers have signed > int left shift overflows in many places > (and as far as i know users of those headers dont use > special compilation flags to make signed overflow > well-defined like gcc -fwrapv) > > which compiler did you use and with what flags? > (this could break a lot of legacy code) > [-- Attachment #2: Type: text/html, Size: 2383 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-27 21:40 ` plan9assembler @ 2013-05-29 13:46 ` plan9assembler 2013-05-29 14:11 ` Luca Barbato 1 sibling, 0 replies; 25+ messages in thread From: plan9assembler @ 2013-05-29 13:46 UTC (permalink / raw) To: musl [-- Attachment #1: Type: text/plain, Size: 2057 bytes --] Hi, it didn't solved, still get segfaults.. partially gets segfaults # this works .libs/mount /dev/sda1 /mnt # this segfaults .libs/umount /mnt after util-linux-2.23( mount, umount binary) installation, it segfaults when mount rootfs rw. so removed mount umount and symlink again. # rm /mnt/bin/{mount, umount} # ln -s /mnt/bin/busybox /mnt/bin/mount # ln -s /mnt/bin/busybox /mnt/bin/umount On Tue, May 28, 2013 at 6:40 AM, plan9assembler <plan9assembler@gmail.com>wrote: > Hi, i am sure but it works for me. > > actually, it little strange, because, > after modification, first time, it getting segfaults, > later, it works fine. > > flags in util-linux-2.23 was created automatically. > > musl linux system could be set by this method: > https://github.com/pikhq/bootstrap-linux/issues/8 > https://github.com/pikhq/bootstrap-linux/issues/9 > http://plan9assembler.wordpress.com/2013/04/26/bootstrap-linux-musl-cross/ > > gcc-4.8 > CC = gcc -std=gnu99 > CCDEPMODE = depmode=gcc3 > CFLAGS = -g -O2 > CPP = gcc -E > > TIA > > > > > On Mon, May 27, 2013 at 11:29 PM, Szabolcs Nagy <nsz@port70.net> wrote: > >> * plan9assembler <plan9assembler@gmail.com> [2013-05-27 23:05:37 +0900]: >> > util-linux-2.23 mount segfault error seems to be solved. >> > no more segfault error, when i test mount binary. >> > >> > i modified follow macros in musl /include/bits/ioctl.h and musl libc >> > reinstalled. >> > >> > - #define _IOR(a,b,c) _IOC(2,(a),(b),sizeof(c)) >> > - #define _IOWR(a,b,c) _IOC(3,(a),(b),sizeof(c)) >> > >> > + #define _IOR(a,b,c) _IOC(2U,(a),(b),sizeof(c)) >> > + #define _IOWR(a,b,c) _IOC(3U,(a),(b),sizeof(c)) >> > >> >> hm are you sure this was the change that solved the segfault? >> >> that would be scary since the linux headers have signed >> int left shift overflows in many places >> (and as far as i know users of those headers dont use >> special compilation flags to make signed overflow >> well-defined like gcc -fwrapv) >> >> which compiler did you use and with what flags? >> (this could break a lot of legacy code) >> > > [-- Attachment #2: Type: text/html, Size: 3456 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-27 21:40 ` plan9assembler 2013-05-29 13:46 ` plan9assembler @ 2013-05-29 14:11 ` Luca Barbato 2013-05-29 14:32 ` plan9assembler 1 sibling, 1 reply; 25+ messages in thread From: Luca Barbato @ 2013-05-29 14:11 UTC (permalink / raw) To: musl On 05/27/2013 11:40 PM, plan9assembler wrote: > Hi, i am sure but it works for me. > > actually, it little strange, because, > after modification, first time, it getting segfaults, > later, it works fine. A backtrace says anything useful? lu ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-29 14:11 ` Luca Barbato @ 2013-05-29 14:32 ` plan9assembler 2013-05-29 14:41 ` plan9assembler 0 siblings, 1 reply; 25+ messages in thread From: plan9assembler @ 2013-05-29 14:32 UTC (permalink / raw) To: musl [-- Attachment #1: Type: text/plain, Size: 1232 bytes --] sorry i don't know how to run bt, and i don't have gdb. my hdd info: /dev/sda1 # another linux : LMDE(linux mint based on debian) /dev/sda2 # swap /dev/sda3 # bootstrap-linux (using musl-cross as cross compiler instead of bootstrap-linux built-in). and more additional information about latest git-version musl libc. git pull right now. result: # cd util-linux-2.23/.libs # ./mount /dev/sda1 /mnt EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) < 30 - 40 seconds waiting without return to shell> mount: /mnt: filesystem mounted, but mount(8) failedOperation timed out // <-- this is weird. # and umount gets segfaults randomly.. # umount /mnt traps: umount[9444] general protection ip:7f9c48e618fb sp:7fff72447b88 error:0 in libc.so[7f9c48e16000+72000] Segmentation fault. maybe i should have to build new bootstrap-linux again using new musl libc. On Wed, May 29, 2013 at 11:11 PM, Luca Barbato <lu_zero@gentoo.org> wrote: > On 05/27/2013 11:40 PM, plan9assembler wrote: > > Hi, i am sure but it works for me. > > > > actually, it little strange, because, > > after modification, first time, it getting segfaults, > > later, it works fine. > > A backtrace says anything useful? > > lu > [-- Attachment #2: Type: text/html, Size: 1939 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-29 14:32 ` plan9assembler @ 2013-05-29 14:41 ` plan9assembler 2013-05-29 20:04 ` Szabolcs Nagy 0 siblings, 1 reply; 25+ messages in thread From: plan9assembler @ 2013-05-29 14:41 UTC (permalink / raw) To: musl [-- Attachment #1: Type: text/plain, Size: 1678 bytes --] correction: util-linux umount gets segfaults randomly..(X) util-linux umount gets segfaults always..(O) # ./umount /mnt traps: umount[9444] general protection ip:7f9c48e618fb sp:7fff72447b88 error:0 in libc.so[7f9c48e16000+72000] Segmentation fault. and busybox umount works fine. On Wed, May 29, 2013 at 11:32 PM, plan9assembler <plan9assembler@gmail.com>wrote: > sorry i don't know how to run bt, and i don't have gdb. > > my hdd info: > /dev/sda1 # another linux : LMDE(linux mint based on debian) > /dev/sda2 # swap > /dev/sda3 # bootstrap-linux (using musl-cross as cross compiler instead > of bootstrap-linux built-in). > > and more additional information about latest git-version musl libc. git > pull right now. > result: > > # cd util-linux-2.23/.libs > # ./mount /dev/sda1 /mnt > EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) > > < 30 - 40 seconds waiting without return to shell> > > mount: /mnt: filesystem mounted, but mount(8) failedOperation timed out > // <-- this is weird. > # > > and umount gets segfaults randomly.. > # umount /mnt > traps: umount[9444] general protection ip:7f9c48e618fb sp:7fff72447b88 > error:0 in libc.so[7f9c48e16000+72000] > Segmentation fault. > > maybe i should have to build new bootstrap-linux again using new musl libc. > > > > > > > > On Wed, May 29, 2013 at 11:11 PM, Luca Barbato <lu_zero@gentoo.org> wrote: > >> On 05/27/2013 11:40 PM, plan9assembler wrote: >> > Hi, i am sure but it works for me. >> > >> > actually, it little strange, because, >> > after modification, first time, it getting segfaults, >> > later, it works fine. >> >> A backtrace says anything useful? >> >> lu >> > > [-- Attachment #2: Type: text/html, Size: 2744 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-29 14:41 ` plan9assembler @ 2013-05-29 20:04 ` Szabolcs Nagy 2013-05-29 22:07 ` plan9assembler 0 siblings, 1 reply; 25+ messages in thread From: Szabolcs Nagy @ 2013-05-29 20:04 UTC (permalink / raw) To: musl * plan9assembler <plan9assembler@gmail.com> [2013-05-29 23:41:13 +0900]: > util-linux umount gets segfaults randomly..(X) > util-linux umount gets segfaults always..(O) > > # ./umount /mnt > traps: umount[9444] general protection ip:7f9c48e618fb sp:7fff72447b88 > error:0 in libc.so[7f9c48e16000+72000] > Segmentation fault. it seems util-linux uses sscanf with %ms to parse mtab in libmount in tab_parse.c after i fixed that mount and umount does not segfault here (used fixed size malloc and %s instead) ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-29 20:04 ` Szabolcs Nagy @ 2013-05-29 22:07 ` plan9assembler 2013-05-29 22:17 ` plan9assembler 0 siblings, 1 reply; 25+ messages in thread From: plan9assembler @ 2013-05-29 22:07 UTC (permalink / raw) To: musl [-- Attachment #1: Type: text/plain, Size: 1382 bytes --] could you send me the patch? i will test it. BTW, in latest musl-git version, i found something wrong with ioctl.h #if 1 #define _IO(a,b) _IOC(0U,(a),(b),0) //? #define _IOW(a,b,c) _IOC(1U,(a),(b),sizeof(c)) //? #else #define _IO(a,b) _IOC(0,(a),(b),0) //ok #define _IOW(a,b,c) _IOC(1,(a),(b),sizeof(c)) //ok #endif #define _IOR(a,b,c) _IOC(2U,(a),(b),sizeof(c)) //ok #define _IOW(a,b,c) _IOC(3U,(a),(b),sizeof(c)) //ok if i set 0, it works fine run as "./mount", but set 1 then, # ./mount /dev/sda1 /mnt EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) < 30 - 40 seconds waiting without return to shell> mount: /mnt: filesystem mounted, but mount(8) failedOperation timed out // <-- this is weird. # On Thu, May 30, 2013 at 5:04 AM, Szabolcs Nagy <nsz@port70.net> wrote: > * plan9assembler <plan9assembler@gmail.com> [2013-05-29 23:41:13 +0900]: > > util-linux umount gets segfaults randomly..(X) > > util-linux umount gets segfaults always..(O) > > > > # ./umount /mnt > > traps: umount[9444] general protection ip:7f9c48e618fb sp:7fff72447b88 > > error:0 in libc.so[7f9c48e16000+72000] > > Segmentation fault. > > it seems util-linux uses sscanf with %ms to parse mtab > in libmount in tab_parse.c > > after i fixed that mount and umount does not segfault here > (used fixed size malloc and %s instead) > [-- Attachment #2: Type: text/html, Size: 2077 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-29 22:07 ` plan9assembler @ 2013-05-29 22:17 ` plan9assembler 2013-05-30 6:11 ` plan9assembler 0 siblings, 1 reply; 25+ messages in thread From: plan9assembler @ 2013-05-29 22:17 UTC (permalink / raw) To: musl [-- Attachment #1: Type: text/plain, Size: 1951 bytes --] correction: #if 1 #define _IO(a,b) _IOC(0U,(a),(b),0) //? #define _IOW(a,b,c) _IOC(1U,(a),(b),sizeof(c)) //? #else #define _IO(a,b) _IOC(0,(a),(b),0) //ok #define _IOW(a,b,c) _IOC(1,(a),(b),sizeof(c)) //ok #endif #define _IOR(a,b,c) _IOC(2U,(a),(b),sizeof(c)) //ok - #define _IOW(a,b,c) _IOC(3U,(a),(b),sizeof(c)) //ok + #define _IOWR(a,b,c) _IOC(3U,(a),(b),sizeof(c)) //ok On Thu, May 30, 2013 at 7:07 AM, plan9assembler <plan9assembler@gmail.com>wrote: > could you send me the patch? i will test it. > > BTW, in latest musl-git version, i found something wrong with ioctl.h > > #if 1 > #define _IO(a,b) _IOC(0U,(a),(b),0) //? > #define _IOW(a,b,c) _IOC(1U,(a),(b),sizeof(c)) //? > #else > #define _IO(a,b) _IOC(0,(a),(b),0) //ok > #define _IOW(a,b,c) _IOC(1,(a),(b),sizeof(c)) //ok > #endif > > #define _IOR(a,b,c) _IOC(2U,(a),(b),sizeof(c)) //ok > #define _IOW(a,b,c) _IOC(3U,(a),(b),sizeof(c)) //ok > > if i set 0, it works fine run as "./mount", but set 1 then, > > > # ./mount /dev/sda1 /mnt > EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) > > < 30 - 40 seconds waiting without return to shell> > > mount: /mnt: filesystem mounted, but mount(8) failedOperation timed out > // <-- this is weird. > # > > > > > > On Thu, May 30, 2013 at 5:04 AM, Szabolcs Nagy <nsz@port70.net> wrote: > >> * plan9assembler <plan9assembler@gmail.com> [2013-05-29 23:41:13 +0900]: >> > util-linux umount gets segfaults randomly..(X) >> > util-linux umount gets segfaults always..(O) >> > >> > # ./umount /mnt >> > traps: umount[9444] general protection ip:7f9c48e618fb sp:7fff72447b88 >> > error:0 in libc.so[7f9c48e16000+72000] >> > Segmentation fault. >> >> it seems util-linux uses sscanf with %ms to parse mtab >> in libmount in tab_parse.c >> >> after i fixed that mount and umount does not segfault here >> (used fixed size malloc and %s instead) >> > > [-- Attachment #2: Type: text/html, Size: 3068 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-29 22:17 ` plan9assembler @ 2013-05-30 6:11 ` plan9assembler 2013-05-30 6:43 ` Szabolcs Nagy 0 siblings, 1 reply; 25+ messages in thread From: plan9assembler @ 2013-05-30 6:11 UTC (permalink / raw) To: musl [-- Attachment #1: Type: text/plain, Size: 3615 bytes --] here is backtrace of gdb for "./mount /dev/sda1 /mnt" Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7dd58fb in strlen () from /lib/ld-musl-x86_64.so.1 (gdb) at #0 0x00007ffff7dd58fb in strlen () from /lib/ld-musl-x86_64.so.1 #1 0x00007ffff79614b6 in unmangle_string (s=0x6164732f7665642f <Address 0x616732f7665642 out of bounds>) at ./include/mangle.h:17 #2 mnt_parse_table_line (s=0x7fffffffe640 "/dev/sda1 /mnt ext4 rw 0 0", fs=0x608f00) at libmount/src/tab_parse.c:78 #3 mnt_table_parse_next (tb=tb@entry=0x7ffff7ffb360, f=f@entry=0x608a00, fs=fs@entry=0x608f00, filename=filename@entry=0x7ffff7973e78 "/etc/mtab", nlines=nlines@entry=0x7fffffffeab4) at at libmount/src/tab_parse.c:396 #4 0x00007ffff79618e7 in mnt_table_parse_stream (tb=tb@entry=0x7ffff7ffb360, f=f@entry=0x608a00, filename=<optimzed out>, filename@entry=0x7ffff7973e78 "/etc/mtab") at libmount/src/tab_parse.c:529 #5 0x00007ffff7961e26 in mnt_table_parse_file (tb=0x7ffff7ffb360, filename=0x7ffff7973e78 "/etc/mtab") at libmount/src/tab_parse.c:584 #6 0x00007ffff796246f in mnt_table_parse_mtab (tb=0x7ffff7ffb360, filename=0x7ffff7973e78 "/etc/mtab") at libmount/src/tab_parse.c:968 #7 0x00007ffff794fbf5 in mnt_context_get_mtab (cxt=cxt@entry=0x7ffff7ffb260, tb=tb@entry=0x7fffffffec90) at libmount/src/context.c:958 #8 0x0000000000403c7d in print_all (show_label=0, pattern=0x0, cxt=0x7ffff7ffb260) at sys-utils/mount.c:130 #9 main (argc=0, argv=0x7fffffffed40) at sys-utils/mount.c:1004 (gdb) On Thu, May 30, 2013 at 7:17 AM, plan9assembler <plan9assembler@gmail.com>wrote: > correction: > > #if 1 > #define _IO(a,b) _IOC(0U,(a),(b),0) //? > #define _IOW(a,b,c) _IOC(1U,(a),(b),sizeof(c)) //? > #else > #define _IO(a,b) _IOC(0,(a),(b),0) //ok > #define _IOW(a,b,c) _IOC(1,(a),(b),sizeof(c)) //ok > #endif > > #define _IOR(a,b,c) _IOC(2U,(a),(b),sizeof(c)) //ok > - #define _IOW(a,b,c) _IOC(3U,(a),(b),sizeof(c)) //ok > + #define _IOWR(a,b,c) _IOC(3U,(a),(b),sizeof(c)) //ok > > > On Thu, May 30, 2013 at 7:07 AM, plan9assembler <plan9assembler@gmail.com>wrote: > >> could you send me the patch? i will test it. >> >> BTW, in latest musl-git version, i found something wrong with ioctl.h >> >> #if 1 >> #define _IO(a,b) _IOC(0U,(a),(b),0) //? >> #define _IOW(a,b,c) _IOC(1U,(a),(b),sizeof(c)) //? >> #else >> #define _IO(a,b) _IOC(0,(a),(b),0) //ok >> #define _IOW(a,b,c) _IOC(1,(a),(b),sizeof(c)) //ok >> #endif >> >> #define _IOR(a,b,c) _IOC(2U,(a),(b),sizeof(c)) //ok >> #define _IOW(a,b,c) _IOC(3U,(a),(b),sizeof(c)) //ok >> >> if i set 0, it works fine run as "./mount", but set 1 then, >> >> >> # ./mount /dev/sda1 /mnt >> EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) >> >> < 30 - 40 seconds waiting without return to shell> >> >> mount: /mnt: filesystem mounted, but mount(8) failedOperation timed out >> // <-- this is weird. >> # >> >> >> >> >> >> On Thu, May 30, 2013 at 5:04 AM, Szabolcs Nagy <nsz@port70.net> wrote: >> >>> * plan9assembler <plan9assembler@gmail.com> [2013-05-29 23:41:13 +0900]: >>> > util-linux umount gets segfaults randomly..(X) >>> > util-linux umount gets segfaults always..(O) >>> > >>> > # ./umount /mnt >>> > traps: umount[9444] general protection ip:7f9c48e618fb sp:7fff72447b88 >>> > error:0 in libc.so[7f9c48e16000+72000] >>> > Segmentation fault. >>> >>> it seems util-linux uses sscanf with %ms to parse mtab >>> in libmount in tab_parse.c >>> >>> after i fixed that mount and umount does not segfault here >>> (used fixed size malloc and %s instead) >>> >> >> > [-- Attachment #2: Type: text/html, Size: 5339 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-30 6:11 ` plan9assembler @ 2013-05-30 6:43 ` Szabolcs Nagy 2013-05-30 7:26 ` plan9assembler 0 siblings, 1 reply; 25+ messages in thread From: Szabolcs Nagy @ 2013-05-30 6:43 UTC (permalink / raw) To: musl [-- Attachment #1: Type: text/plain, Size: 1680 bytes --] * plan9assembler <plan9assembler@gmail.com> [2013-05-30 15:11:09 +0900]: > here is backtrace of gdb for "./mount /dev/sda1 /mnt" > > Program received signal SIGSEGV, Segmentation fault. > 0x00007ffff7dd58fb in strlen () from /lib/ld-musl-x86_64.so.1 > (gdb) at > #0 0x00007ffff7dd58fb in strlen () from /lib/ld-musl-x86_64.so.1 > #1 0x00007ffff79614b6 in unmangle_string (s=0x6164732f7665642f <Address > 0x616732f7665642 out of bounds>) at ./include/mangle.h:17 > #2 mnt_parse_table_line (s=0x7fffffffe640 "/dev/sda1 /mnt ext4 rw 0 0", > fs=0x608f00) at libmount/src/tab_parse.c:78 > #3 mnt_table_parse_next (tb=tb@entry=0x7ffff7ffb360, f=f@entry=0x608a00, > fs=fs@entry=0x608f00, filename=filename@entry=0x7ffff7973e78 "/etc/mtab", > nlines=nlines@entry=0x7fffffffeab4) at at libmount/src/tab_parse.c:396 yes this is the %ms issue i was talking about > On Thu, May 30, 2013 at 7:17 AM, plan9assembler <plan9assembler@gmail.com>wrote: > > correction: > > > > #if 1 > > #define _IO(a,b) _IOC(0U,(a),(b),0) //? > > #define _IOW(a,b,c) _IOC(1U,(a),(b),sizeof(c)) //? > > #else > > #define _IO(a,b) _IOC(0,(a),(b),0) //ok > > #define _IOW(a,b,c) _IOC(1,(a),(b),sizeof(c)) //ok > > #endif > > > > #define _IOR(a,b,c) _IOC(2U,(a),(b),sizeof(c)) //ok > > - #define _IOW(a,b,c) _IOC(3U,(a),(b),sizeof(c)) //ok > > + #define _IOWR(a,b,c) _IOC(3U,(a),(b),sizeof(c)) //ok this does not make sense to me > > On Thu, May 30, 2013 at 7:07 AM, plan9assembler <plan9assembler@gmail.com>wrote: > >> could you send me the patch? i will test it. my super sophisticated patch has no warranty you could do better parsing or wait for musl to support %ms [-- Attachment #2: ms.diff --] [-- Type: text/x-diff, Size: 1358 bytes --] --- util-linux-2.23/libmount/src/tab_parse.c 2013-04-12 12:04:05.000000000 +0200 +++ util-linux/libmount/src/tab_parse.c 2013-05-30 08:37:39.000000000 +0200 @@ -61,16 +61,18 @@ int rc, n = 0, xrc; char *src = NULL, *fstype = NULL, *optstr = NULL; +#undef UL_SCNsA +#define UL_SCNsA "%s" rc = sscanf(s, UL_SCNsA" " /* (1) source */ UL_SCNsA" " /* (2) target */ UL_SCNsA" " /* (3) FS type */ UL_SCNsA" " /* (4) options */ "%n", /* byte count */ - &src, - &fs->target, - &fstype, - &optstr, + src=malloc(200), + fs->target=malloc(200), + fstype=malloc(200), + optstr=malloc(200), &n); xrc = rc; @@ -147,9 +149,9 @@ &fs->id, &fs->parent, &maj, &min, - &fs->root, - &fs->target, - &fs->vfs_optstr, + fs->root=malloc(200), + fs->target=malloc(200), + fs->vfs_optstr=malloc(200), &end); if (rc >= 7 && end > 0) @@ -169,9 +171,9 @@ UL_SCNsA" " /* (9) source */ UL_SCNsA, /* (10) fs options (fs specific) */ - &fstype, - &src, - &fs->fs_optstr); + fstype=malloc(200), + src=malloc(200), + fs->fs_optstr=malloc(200)); if (rc >= 10) { fs->flags |= MNT_FS_KERNEL; @@ -285,8 +287,8 @@ "%jd" /* (4) used */ "%d", /* priority */ - &src, - &fs->swaptype, + src=malloc(200), + fs->swaptype=malloc(200), &fsz, &usz, &fs->priority); ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-30 6:43 ` Szabolcs Nagy @ 2013-05-30 7:26 ` plan9assembler 2013-05-30 8:37 ` Szabolcs Nagy 0 siblings, 1 reply; 25+ messages in thread From: plan9assembler @ 2013-05-30 7:26 UTC (permalink / raw) To: musl [-- Attachment #1: Type: text/plain, Size: 2387 bytes --] Hi, thanks for the patch, i tested it. it still gets same segfaults, same bt gdb result. # gdb ./mount /dev/sda1 /mnt r bt and it is clear to me that latest musl libc[2013/05/29] contain new bug, because, below abnormal operation never happened before. (musl version git pulled at 2013/05/03) # ./mount /dev/sda1 /mnt EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) < 30 - 40 seconds waiting without return to shell> mount: /mnt: filesystem mounted, but mount(8) failedOperation timed out // <-- this is weird. # On Thu, May 30, 2013 at 3:43 PM, Szabolcs Nagy <nsz@port70.net> wrote: > * plan9assembler <plan9assembler@gmail.com> [2013-05-30 15:11:09 +0900]: > > here is backtrace of gdb for "./mount /dev/sda1 /mnt" > > > > Program received signal SIGSEGV, Segmentation fault. > > 0x00007ffff7dd58fb in strlen () from /lib/ld-musl-x86_64.so.1 > > (gdb) at > > #0 0x00007ffff7dd58fb in strlen () from /lib/ld-musl-x86_64.so.1 > > #1 0x00007ffff79614b6 in unmangle_string (s=0x6164732f7665642f <Address > > 0x616732f7665642 out of bounds>) at ./include/mangle.h:17 > > #2 mnt_parse_table_line (s=0x7fffffffe640 "/dev/sda1 /mnt ext4 rw 0 0", > > fs=0x608f00) at libmount/src/tab_parse.c:78 > > #3 mnt_table_parse_next (tb=tb@entry=0x7ffff7ffb360, f=f@entry > =0x608a00, > > fs=fs@entry=0x608f00, filename=filename@entry=0x7ffff7973e78 > "/etc/mtab", > > nlines=nlines@entry=0x7fffffffeab4) at at libmount/src/tab_parse.c:396 > > yes this is the %ms issue i was talking about > > > On Thu, May 30, 2013 at 7:17 AM, plan9assembler < > plan9assembler@gmail.com>wrote: > > > correction: > > > > > > #if 1 > > > #define _IO(a,b) _IOC(0U,(a),(b),0) //? > > > #define _IOW(a,b,c) _IOC(1U,(a),(b),sizeof(c)) //? > > > #else > > > #define _IO(a,b) _IOC(0,(a),(b),0) //ok > > > #define _IOW(a,b,c) _IOC(1,(a),(b),sizeof(c)) //ok > > > #endif > > > > > > #define _IOR(a,b,c) _IOC(2U,(a),(b),sizeof(c)) //ok > > > - #define _IOW(a,b,c) _IOC(3U,(a),(b),sizeof(c)) //ok > > > + #define _IOWR(a,b,c) _IOC(3U,(a),(b),sizeof(c)) //ok > > this does not make sense to me > > > > On Thu, May 30, 2013 at 7:07 AM, plan9assembler < > plan9assembler@gmail.com>wrote: > > >> could you send me the patch? i will test it. > > my super sophisticated patch has no warranty > you could do better parsing or wait for musl to support %ms > > [-- Attachment #2: Type: text/html, Size: 3387 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-30 7:26 ` plan9assembler @ 2013-05-30 8:37 ` Szabolcs Nagy 2013-06-01 23:14 ` plan9assembler 0 siblings, 1 reply; 25+ messages in thread From: Szabolcs Nagy @ 2013-05-30 8:37 UTC (permalink / raw) To: musl * plan9assembler <plan9assembler@gmail.com> [2013-05-30 16:26:13 +0900]: > > it still gets same segfaults, same bt gdb result. > if you get the exact same segfault then you do something wrong ..or malloc(200) is not enough > and it is clear to me that latest musl libc[2013/05/29] contain new bug, > because, > below abnormal operation never happened before. (musl version git pulled at > 2013/05/03) > > # ./mount /dev/sda1 /mnt > EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) > > < 30 - 40 seconds waiting without return to shell> > > mount: /mnt: filesystem mounted, but mount(8) failedOperation timed out > // <-- this is weird. > # works here fine since you have local modifications i'd check those first i doubt that latest musl has any related bug but you could easily prove me wrong with a strace that shows bad flags passed to some syscall ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-05-30 8:37 ` Szabolcs Nagy @ 2013-06-01 23:14 ` plan9assembler 2013-06-01 23:16 ` plan9assembler 2013-06-02 1:50 ` John Spencer 0 siblings, 2 replies; 25+ messages in thread From: plan9assembler @ 2013-06-01 23:14 UTC (permalink / raw) To: musl [-- Attachment #1: Type: text/plain, Size: 2110 bytes --] Hi, latest musl libc seems to fixes mount segfault error partially. (mount: /mnt: filesystem mounted, but mount(8) failedOperation timed out) rebuild and test vanilla util-linux-2.23 result same. tested util-linux-2.23.1 same. tested gcc-4.8.1 same. sscanf "%ms" -> "%s" with malloc doesn't fixed the issue here. with patch or without it result same. i compile strace-4.7 to trace the bug, but get some build error: gcc -Wall -Wwrite-string -g -O2 -o strace strace.o syscall.o count.o util.o desc.o file.o ipc.o io.o ioctl.o mem.o net.o process.o bjm.o quota.o resource.o signal.o sock.o system.o term.o time.o scsi.o stream.o block.o pathtrace.o mtd.o vsprintf.o loop.o syscall.o:(.rodata+0x28080): undefined reference to `sys_getdents64' syscall.o:(.rodata+0x2b100): undefined reference to `sys_truncate64' syscall.o:(.rodata+0x2b118): undefined reference to `sys_ftruncate64' syscall.o:(.rodata+0x2b388): undefined reference to `sys_getdents64' syscall.o:(.rodata+0x2dd00): undefined reference to `sys_getdents64' BTW, i was quite surprised by base packages are so much "glibc-centric".. On Thu, May 30, 2013 at 5:37 PM, Szabolcs Nagy <nsz@port70.net> wrote: > * plan9assembler <plan9assembler@gmail.com> [2013-05-30 16:26:13 +0900]: > > > > it still gets same segfaults, same bt gdb result. > > > > if you get the exact same segfault then you do something wrong > ..or malloc(200) is not enough > > > and it is clear to me that latest musl libc[2013/05/29] contain new bug, > > because, > > below abnormal operation never happened before. (musl version git pulled > at > > 2013/05/03) > > > > # ./mount /dev/sda1 /mnt > > EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) > > > > < 30 - 40 seconds waiting without return to shell> > > > > mount: /mnt: filesystem mounted, but mount(8) failedOperation timed out > > // <-- this is weird. > > # > > works here fine > since you have local modifications i'd check those first > > i doubt that latest musl has any related bug > > but you could easily prove me wrong with a strace > that shows bad flags passed to some syscall > > [-- Attachment #2: Type: text/html, Size: 2951 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-06-01 23:14 ` plan9assembler @ 2013-06-01 23:16 ` plan9assembler 2013-06-02 1:50 ` John Spencer 1 sibling, 0 replies; 25+ messages in thread From: plan9assembler @ 2013-06-01 23:16 UTC (permalink / raw) To: musl [-- Attachment #1: Type: text/plain, Size: 2319 bytes --] ah! util-linux umount gets segfault always. On Sun, Jun 2, 2013 at 8:14 AM, plan9assembler <plan9assembler@gmail.com>wrote: > Hi, > > latest musl libc seems to fixes mount segfault error partially. > (mount: /mnt: filesystem mounted, but mount(8) failedOperation timed out) > rebuild and test vanilla util-linux-2.23 result same. > tested util-linux-2.23.1 same. > tested gcc-4.8.1 same. > > sscanf "%ms" -> "%s" with malloc doesn't fixed the issue here. > with patch or without it result same. > > i compile strace-4.7 to trace the bug, but get some build error: > gcc -Wall -Wwrite-string -g -O2 -o strace strace.o syscall.o count.o > util.o desc.o file.o ipc.o io.o ioctl.o mem.o net.o process.o bjm.o quota.o > resource.o signal.o sock.o system.o term.o time.o scsi.o stream.o block.o > pathtrace.o mtd.o vsprintf.o loop.o > syscall.o:(.rodata+0x28080): undefined reference to `sys_getdents64' > syscall.o:(.rodata+0x2b100): undefined reference to `sys_truncate64' > syscall.o:(.rodata+0x2b118): undefined reference to `sys_ftruncate64' > syscall.o:(.rodata+0x2b388): undefined reference to `sys_getdents64' > syscall.o:(.rodata+0x2dd00): undefined reference to `sys_getdents64' > > BTW, i was quite surprised by base packages are so much "glibc-centric".. > > > > On Thu, May 30, 2013 at 5:37 PM, Szabolcs Nagy <nsz@port70.net> wrote: > >> * plan9assembler <plan9assembler@gmail.com> [2013-05-30 16:26:13 +0900]: >> > >> > it still gets same segfaults, same bt gdb result. >> > >> >> if you get the exact same segfault then you do something wrong >> ..or malloc(200) is not enough >> >> > and it is clear to me that latest musl libc[2013/05/29] contain new bug, >> > because, >> > below abnormal operation never happened before. (musl version git >> pulled at >> > 2013/05/03) >> > >> > # ./mount /dev/sda1 /mnt >> > EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) >> > >> > < 30 - 40 seconds waiting without return to shell> >> > >> > mount: /mnt: filesystem mounted, but mount(8) failedOperation timed out >> > // <-- this is weird. >> > # >> >> works here fine >> since you have local modifications i'd check those first >> >> i doubt that latest musl has any related bug >> >> but you could easily prove me wrong with a strace >> that shows bad flags passed to some syscall >> >> > [-- Attachment #2: Type: text/html, Size: 3443 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-06-01 23:14 ` plan9assembler 2013-06-01 23:16 ` plan9assembler @ 2013-06-02 1:50 ` John Spencer 2013-06-02 10:55 ` plan9assembler 1 sibling, 1 reply; 25+ messages in thread From: John Spencer @ 2013-06-02 1:50 UTC (permalink / raw) To: musl On 06/02/2013 01:14 AM, plan9assembler wrote: > > i compile strace-4.7 to trace the bug, but get some build error: use the version and patches from sabotage. even if the version used there is one release behind, it works. ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-06-02 1:50 ` John Spencer @ 2013-06-02 10:55 ` plan9assembler 2013-06-02 13:00 ` Szabolcs Nagy 0 siblings, 1 reply; 25+ messages in thread From: plan9assembler @ 2013-06-02 10:55 UTC (permalink / raw) To: musl [-- Attachment #1.1: Type: text/plain, Size: 892 bytes --] Hi, i have fixed build error of strace 4.7 vi strace-4.7/defs.h + #define sys_getdents64 sys_getdents + #define sys_truncate64 sys_truncate + #define sys_ftruncate64 sys_ftruncate and Szabolcs Nagy was right, sscanf malloc patch fixed umount segfault. but mount/umount timed out operation didn't fixed. strace -o mount.log mount /dev/sda1 /mnt strace -o umount.log umount /mnt attached strace log archive. mount.log : mount log without patch umount.log : umount log without patch mount_m.log : mount log with patch umount_m.log : umount log with patch TIA On Sun, Jun 2, 2013 at 10:50 AM, John Spencer <maillist-musl@barfooze.de>wrote: > On 06/02/2013 01:14 AM, plan9assembler wrote: > >> >> i compile strace-4.7 to trace the bug, but get some build error: >> > > use the version and patches from sabotage. > even if the version used there is one release behind, it works. > [-- Attachment #1.2: Type: text/html, Size: 1788 bytes --] [-- Attachment #2: util-linux_strace_log.tar.bz2 --] [-- Type: application/x-bzip2, Size: 121178 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-06-02 10:55 ` plan9assembler @ 2013-06-02 13:00 ` Szabolcs Nagy 2013-06-02 22:02 ` plan9assembler 0 siblings, 1 reply; 25+ messages in thread From: Szabolcs Nagy @ 2013-06-02 13:00 UTC (permalink / raw) To: musl * plan9assembler <plan9assembler@gmail.com> [2013-06-02 19:55:49 +0900]: > and Szabolcs Nagy was right, sscanf malloc patch fixed umount segfault. > but mount/umount timed out operation didn't fixed. > as you can see in the strace log mount waits in a loop for /etc/mtab~ to disappear so it can link /etc/mtab~.PID there, but it never disappears so mount fails remove that file and mount will work ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: util-linux-2.23 mount segmentation fault error 2013-06-02 13:00 ` Szabolcs Nagy @ 2013-06-02 22:02 ` plan9assembler 0 siblings, 0 replies; 25+ messages in thread From: plan9assembler @ 2013-06-02 22:02 UTC (permalink / raw) To: musl [-- Attachment #1: Type: text/plain, Size: 522 bytes --] Thanks! it works now. ;-) On Sun, Jun 2, 2013 at 10:00 PM, Szabolcs Nagy <nsz@port70.net> wrote: > * plan9assembler <plan9assembler@gmail.com> [2013-06-02 19:55:49 +0900]: > > and Szabolcs Nagy was right, sscanf malloc patch fixed umount segfault. > > but mount/umount timed out operation didn't fixed. > > > > as you can see in the strace log mount waits in a loop > for /etc/mtab~ to disappear so it can link /etc/mtab~.PID > there, but it never disappears so mount fails > > remove that file and mount will work > [-- Attachment #2: Type: text/html, Size: 945 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2013-06-02 22:02 UTC | newest] Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2013-05-25 15:46 util-linux-2.23 mount segmentation fault error plan9assembler 2013-05-25 16:26 ` Rich Felker 2013-05-25 21:34 ` plan9assembler 2013-05-26 9:14 ` Szabolcs Nagy 2013-05-26 11:22 ` plan9assembler 2013-05-27 14:05 ` plan9assembler 2013-05-27 14:29 ` Szabolcs Nagy 2013-05-27 21:40 ` plan9assembler 2013-05-29 13:46 ` plan9assembler 2013-05-29 14:11 ` Luca Barbato 2013-05-29 14:32 ` plan9assembler 2013-05-29 14:41 ` plan9assembler 2013-05-29 20:04 ` Szabolcs Nagy 2013-05-29 22:07 ` plan9assembler 2013-05-29 22:17 ` plan9assembler 2013-05-30 6:11 ` plan9assembler 2013-05-30 6:43 ` Szabolcs Nagy 2013-05-30 7:26 ` plan9assembler 2013-05-30 8:37 ` Szabolcs Nagy 2013-06-01 23:14 ` plan9assembler 2013-06-01 23:16 ` plan9assembler 2013-06-02 1:50 ` John Spencer 2013-06-02 10:55 ` plan9assembler 2013-06-02 13:00 ` Szabolcs Nagy 2013-06-02 22:02 ` plan9assembler
Code repositories for project(s) associated with this public inbox https://git.vuxu.org/mirror/musl/ This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).