Summary: | glibc stack-smashing error in staprun on f8 0.6-1 build | ||
---|---|---|---|
Product: | systemtap | Reporter: | Frank Ch. Eigler <fche> |
Component: | runtime | Assignee: | Martin Hunt <hunt> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P1 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Host: | x86-64 | Target: | |
Build: | Last reconfirmed: |
Description
Frank Ch. Eigler
2008-01-12 15:32:12 UTC
Update: am able to reproduce this with CVS systemtap, built with the same compiler options. valgrind and gdb don't produce any additional information with this binary, because the stack-smash-detector runs at the end of the function. Yet another data point: this message in the kernel logs may relate. [451468.657609] Systemtap Error at _stp_sym_read_cmd:301 Supplied buffer too small. count:8192 len:132 Added a "--enable-ssp" configure option to build staprun/stapio in a similar way as fedora does, which in turn evokes the error in this bug. Once this bug is fixed, this flag will be turned on by default. Partial patch committed. staprun now tolerates somewhat longer /proc/kallsyms lines. Took a quick look at this. Yes, the kallsyms parsing code does have a fixed size buffer of 128 bytes, so if someone exports a huge function name in a huge module name, things will get messed up. Ironically, I rewrote this ugly stuff a while ago when adding unwind data ago but did not check in yet because I saw no need. Your hack works for now because /proc/kallsyms truncates function names to 127 bytes, so the maximum line length is around 200. My current code looks like this and has no limits while ((ret = fscanf(kallsyms, "%llx %c %as [%as", &addr, &type, &name, &mod))>0 && dataptr < datamax) { if (ret < 3) continue; if (ret > 3) { /* ignore modules */ free(name); free(mod); continue; } I could check in now if you wish. The rest of the function is totally rewritten too and requires I merge in some changes to other files, after stripping out my uwind code. Please advise whether this bug is intended to be fixed by the new code. Fixed a while ago. |