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!
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!
FS#28921 - [9base] 9 sha1sum causes 'stack smashing detected'
Attached to Project:
Community Packages
Opened by chris hall (suicideducky) - Thursday, 15 March 2012, 00:56 GMT
Last edited by Chris Brannon (cmb) - Friday, 23 March 2012, 21:02 GMT
Opened by chris hall (suicideducky) - Thursday, 15 March 2012, 00:56 GMT
Last edited by Chris Brannon (cmb) - Friday, 23 March 2012, 21:02 GMT
|
DetailsDescription:
`9 sha1sum <file>` (/opt/plan9/sha1sum) fails for many throws an error whereas sha1sum (/usr/bin/sha1sum) does not, infact `ln /usr/bin/sha1sum /opt/plan9/bin/sha1sum` fixes the errors. Additional info: * Using current 9base from repo, problem also exists in 9base-hg package from aur. Steps to reproduce: Save file http://dl.segfault.net.nz/quotebot as 'quotebot.md' `9 sha1sum quotebot.md` and I get: # /opt/plan9/bin/sha1sum_bkp quotebot.md *** stack smashing detected ***: /opt/plan9/bin/sha1sum_bkp terminated ======= Backtrace: ========= /lib/libc.so.6(__fortify_fail+0x45)[0xb7638055] /lib/libc.so.6(+0x10000a)[0xb763800a] /opt/plan9/bin/sha1sum_bkp[0x8048bd1] /opt/plan9/bin/sha1sum_bkp[0x804a7cf] /opt/plan9/bin/sha1sum_bkp[0x80492f8] /opt/plan9/bin/sha1sum_bkp[0x804ab3f] /opt/plan9/bin/sha1sum_bkp[0x804aa7f] /opt/plan9/bin/sha1sum_bkp[0x8048b27] /opt/plan9/bin/sha1sum_bkp[0x8048cc3] /opt/plan9/bin/sha1sum_bkp[0x804899b] /lib/libc.so.6(__libc_start_main+0xf3)[0xb7551483] /opt/plan9/bin/sha1sum_bkp[0x80489d1] ======= Memory map: ======== 08048000-08051000 r-xp 00000000 ca:00 1368273 /opt/plan9/bin/sha1sum_bkp 08051000-08052000 r--p 00008000 ca:00 1368273 /opt/plan9/bin/sha1sum_bkp 08052000-08053000 rw-p 00009000 ca:00 1368273 /opt/plan9/bin/sha1sum_bkp 085a3000-085c4000 rw-p 00000000 00:00 0 [heap] b7511000-b752d000 r-xp 00000000 ca:00 16721 /usr/lib/libgcc_s.so.1 b752d000-b752e000 rw-p 0001b000 ca:00 16721 /usr/lib/libgcc_s.so.1 b7537000-b7538000 rw-p 00000000 00:00 0 b7538000-b76d4000 r-xp 00000000 ca:00 17443 /lib/libc-2.15.so b76d4000-b76d6000 r--p 0019c000 ca:00 17443 /lib/libc-2.15.so b76d6000-b76d7000 rw-p 0019e000 ca:00 17443 /lib/libc-2.15.so b76d7000-b76da000 rw-p 00000000 00:00 0 b76da000-b7704000 r-xp 00000000 ca:00 17265 /lib/libm-2.15.so b7704000-b7705000 r--p 00029000 ca:00 17265 /lib/libm-2.15.so b7705000-b7706000 rw-p 0002a000 ca:00 17265 /lib/libm-2.15.so b770e000-b7710000 rw-p 00000000 00:00 0 b7710000-b7730000 r-xp 00000000 ca:00 17500 /lib/ld-2.15.so b7730000-b7731000 r--p 0001f000 ca:00 17500 /lib/ld-2.15.so b7731000-b7732000 rw-p 00020000 ca:00 17500 /lib/ld-2.15.so bfdbd000-bfdde000 rw-p 00000000 00:00 0 [stack] f57fe000-f57ff000 r-xp 00000000 00:00 0 [vdso] Aborted Note above that sha1sum_bkp is /opt/plan9/bin/sha1sum from 9base. /usr/binsha1sum quotebot.md 9eafbbff07ffde4d62a340f8bb2c7731df087afc quotebot.md |
This task depends upon
Closed by Chris Brannon (cmb)
Friday, 23 March 2012, 21:02 GMT
Reason for closing: Fixed
Additional comments about closing: All fixed. Thank you for the report!
Friday, 23 March 2012, 21:02 GMT
Reason for closing: Fixed
Additional comments about closing: All fixed. Thank you for the report!
I think I know where the problem lies. It's this call here, at line 15
of sha1sum.c from the 9base source distribution.
sprint(buf+2*i, "%.2ux", p[i]);
Plan9's format string syntax isn't quite the same used by Unix's printf family
of functions. Basically, %.2ux should print the argument as two hex digits.
But it doesn't.
It prints the argument as unsigned decimal, followed by the character 'x'.
If you can manage to get sha1sum to run without crashing, you may be
able to see this in practice.
I looked at the sha1sum source from Plan9port. It's the exact same
source file. Also, the sha1sum program from plan9port behaves perfectly.
So what is going on here? Apparently, the issue is in the lib9 library
from the 9base package.
Have you contacted the upstream developers about this?
I was going to try do some more digging and find the cause when I had spare time, but you beat me to it :)
Cheers.