bug report - umount segfault >= 1.22.0 MIPS/uClibc - fix [PATCHES] attached

Richard Moore rich at richud.com
Wed Mar 12 09:16:00 UTC 2014


Hi,

Pretty sure this logic is now correct, ( __GLIBC__ is set by uClibc 
according to comment in scripts/trylink, which seems to fit my experience).

Please find patches attached.



Regards

Rich


On 11/03/14 21:40, Richard Moore wrote:
> Hi,
>
> The fault in libbb/xreadlink.c (using my situation as an example) is 
> that when both are defined
>
> __GLIBC__ =2
> __UCLIBC__ =1
>
> originally this would equate false but with the change, it always 
> evaluates true as __GLIBC__ is set - (I hadn't realised on previous 
> post as assumed __GLIBC__ would be unset if __UCLIBC__ was set.)
>
> I presume therefore +#if defined(__GLIBC__) ||
> should be +#if defined(__GLIBC__) &&
>
>
>
> I also think I noticed a similar logic mistake in 
> networking/ether-wake.c ,it cant be undefined yet have a version.
>
> -#if !defined(__UCLIBC_MAJOR__) \
> - || __UCLIBC_MAJOR__ > 0 \
> - || __UCLIBC_MINOR__ > 9 \
> - || (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ >= 30)
> +#if !defined(__UCLIBC__) || UCLIBC_VERSION >= KERNEL_VERSION(0, 9, 30)
>
> Think this should be
> +#if defined(__UCLIBC__) && UCLIBC_VERSION >= KERNEL_VERSION(0, 9, 30)
>
>
> I haven't submitted a patch as it may be worth another pair of eyes 
> looking at it and the other UCLIBC changes !
>
>
> Cheers
>
> Rich
>
>
>
>
> On 11/03/14 19:26, Richard Moore wrote:
>> Hi,
>>
>> Ok solved it myself - segfaulting on line 147 of umount.c
>>
>> path = xmalloc_realpath(zapit);
>>
>>
>> Looking back through the changes, this commit is breaking it, 
>> (reversing it fixes)
>>
>> -#if defined(__GLIBC__) && !defined(__UCLIBC__)
>> +#if defined(__GLIBC__) || \
>> + (defined(__UCLIBC__) && UCLIBC_VERSION >= KERNEL_VERSION(0, 9, 31))
>>
>>
>> I am using uClibc 0.9.29 , which seems to make the logic the same, as 
>> both eval false (I changed 0, 9, 31 to lower but no different)?
>>
>>
>> Cheers
>>
>> Rich
>>
>>
>> On 09/03/14 12:44, Richard Moore wrote:
>>> Hi,
>>>
>>> umount has started segfaulting since >= 1.22.0 ,  (1.21.1 and 
>>> earlier all ok).
>>>
>>> Mount and everything else is fine. I am cross compiling with MIPS 
>>> (uClibc) , this is the (not very helpful) strace.
>>>
>>>
>>> open("/proc/mounts", O_RDONLY)          = 3
>>> ioctl(3, TIOCNXCL, 0x7fd96b68)          = -1 ENOTTY (Inappropriate 
>>> ioctl for device)
>>> brk(0x4c9000)                           = 0x4c9000
>>> read(3, "rootfs / rootfs rw 0 0\n/dev/root / squashfs ro 0 0\nproc 
>>> /proc proc rw 0 0\nsysfs /sys sysfs rw 0 0\ntmpfs /tmp tmpfs rw 0 
>>> 0\ntmpfs /media tmpfs rw 0 0\ntmpfs /dev tmpfs rw 0 0\nnone 
>>> /proc/bus/usb usbfs rw 0 0\n/dev/mtdblock18 /tmp/mnt/storage jffs2 
>>> rw 0 0\n/dev/sda1 /media/500GB ext3 rw,data=ordered 0 0\n", 4096) = 298
>>> read(3, "", 4096)                       = 0
>>> close(3)                                = 0
>>> readlink("/dev", 0x7fd94c18, 4095)      = -1 EINVAL (Invalid argument)
>>> readlink("/dev/sda1", 0x7fd94c18, 4095) = -1 EINVAL (Invalid argument)
>>> --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
>>> +++ killed by SIGSEGV +++
>>> Segmentation fault
>>>
>>>
>>> Cheers!
>>>
>>>
>>>
>>> Regards
>>>
>>> Rich
>>> _______________________________________________
>>> busybox mailing list
>>> busybox at busybox.net
>>> http://lists.busybox.net/mailman/listinfo/busybox
>>
>>
>>
>> _______________________________________________
>> busybox mailing list
>> busybox at busybox.net
>> http://lists.busybox.net/mailman/listinfo/busybox
>
>
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20140312/6b4d6ad3/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox_etherwake.c.patch
Type: text/x-patch
Size: 597 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20140312/6b4d6ad3/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox_xreadlink.c.patch
Type: text/x-patch
Size: 570 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20140312/6b4d6ad3/attachment-0003.bin>


More information about the busybox mailing list