[systemd-devel] SegFaults?!

Sven Anders anders at anduras.de
Thu May 3 12:12:02 PDT 2012


Am 03.05.2012 18:33, schrieb Lennart Poettering:
> On Thu, 03.05.12 18:14, Sven Anders (anders at anduras.de) wrote:
> 
>> Hello!
>>
>> I'm getting some SegFaults, which I can not explain. I think the problem
>> lies somewhere in my configuration or systemd makes some assumptions and
>> my system does not fulfill these requirements.
>>
>> Nevertheless, I think the tools should not SegFault but issue an error
>> instead. By now I have no real idea where the problem lies.
>>
>> If I run the tool in valgrind, they work.
>>
>> Do you have any idea?
> 
> Hmm, I don't see how a system call would result in a SIGSEGV. This is
> really weird...
> 
> The fd[] array passed to pipe() is allocated on the stack. This suggests
> that your stack is getting corrupted somehow.
> 
> Do things work correctly if you run stuff with --no-pager?

Curiously not. Only if I run this in valgrind...

I had another strange SegFault when using systemd-journalctl, but this
is now gone... So I suspected a misconfiguration first...

This is the same compilation and other tools and systemd itself are
running fine. I'm trying this in KVM with Linux kernel 3.2.2.


(gdb) run
Starting program: /usr/bin/systemd-cgls --no-pager
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x000000a2 in ?? ()
(gdb) bt
#0  0x000000a2 in ?? ()
#1  0x40126a86 in access () at ../sysdeps/unix/syscall-template.S:82
#2  0x80004107 in cg_fix_path (path=0x8000c040 "/sys/fs/cgroup/systemd", result=0xbffff960) at src/cgroup-util.c:1065
#3  0x800034cf in show_cgroup_by_path (path=0x8000c040 "/sys/fs/cgroup/systemd", prefix=0x80008784 "", n_columns=162, kernel_threads=false)
    at src/cgroup-show.c:176
#4  0x800037b6 in show_cgroup (controller=0x80007f5e "name=systemd", path=0x80008712 "/", prefix=0x0, n_columns=0, kernel_threads=false) at
src/cgroup-show.c:257
#5  0x80002fbc in main (argc=2, argv=0xbffffae4) at src/cgls.c:148
(gdb) up
#1  0x40126a86 in access () at ../sysdeps/unix/syscall-template.S:82
82	../sysdeps/unix/syscall-template.S: No such file or directory.
	in ../sysdeps/unix/syscall-template.S
(gdb) up
#2  0x80004107 in cg_fix_path (path=0x8000c040 "/sys/fs/cgroup/systemd", result=0xbffff960) at src/cgroup-util.c:1065
1065	            access(path, F_OK) >= 0) {


These are the last lines of a strace:

[...]
830   stat64(".", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
830   stat64("/var/tmp/systemd-44", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
830   open("/proc/1/cgroup", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
830   fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
830   mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4002d000
830   read(3, "5:freezer:/\n4:devices:/\n3:cpuacc"..., 1024) = 74
830   close(3)                          = 0
830   munmap(0x4002d000, 4096)          = 0
830   lstat64("/sys/fs/cgroup", {st_mode=S_IFDIR|0755, st_size=180, ...}) = 0
830   lstat64("/sys/fs", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
830   ioctl(1, TIOCGWINSZ, {ws_row=35, ws_col=162, ws_xpixel=0, ws_ypixel=0}) = 0
830   --- SIGSEGV (Segmentation fault) @ 0 (0) ---
830   +++ killed by SIGSEGV (core dumped) +++


Really strange!

Regards
 Sven Anders

-- 
 Sven Anders <anders at anduras.de>                 () UTF-8 Ribbon Campaign
                                                 /\ Support plain text e-mail
 ANDURAS intranet security AG
 Messestrasse 3 - 94036 Passau - Germany
 Web: www.anduras.de - Tel: +49 (0)851-4 90 50-0 - Fax: +49 (0)851-4 90 50-55

Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety.
  - Benjamin Franklin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: anders.vcf
Type: text/x-vcard
Size: 339 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20120503/c9004502/attachment.vcf>


More information about the systemd-devel mailing list