Bug 82894 - journalctl: Assertion caused by journalctl --list-boots
Summary: journalctl: Assertion caused by journalctl --list-boots
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: PowerPC Linux (All)
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-21 07:33 UTC by Chris Tillman
Modified: 2014-08-28 01:07 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Chris Tillman 2014-08-21 07:33:45 UTC
As reported in Debian bug #758392

> Package: systemd
> Version: 208-6
> Severity: normal
>
> Dear Maintainer,
>
>    * What led up to the situation? journalctl --list-boots
>    * What was the outcome of this action?
>
> Assertion 'size > 0' failed at ../src/journal/mmap-cache.c:543, function mmap_cache_get(). Aborting.
>
>    * What outcome did you expect instead? listing of boots as documented
>

- Is this problem reproducible (after a reboot
Yes 
- Did you run the command as root or regular user?
As root. I haven't been able to boot into the graphic environment as yet, I've been booting single-user. If that's important, I'll disable X so I can get on another console. 

- Do you have a /var/log/journal directory? If so, what does it contain
(ls -Rla /var/log/journal/)?
I did create one after reading another bug about multiple session journalctl. In that bug, you thought all that should be necessary was to create the dir. That did work, and here is ls -Rla. The journal file is being appended on each boot, so the backup files are the same size as the main file.
/var/log/journal:
total 12
drwxr-sr-x  3 root systemd-journal 4096 Aug 17 16:39 .
drwxr-xr-x 11 root root            4096 Aug 21 17:00 ..
drwxr-sr-x  2 root systemd-journal 4096 Aug 21 16:59 42bc3423441b4065acbfbf085d5741df

/var/log/journal/42bc3423441b4065acbfbf085d5741df:
total 24596
drwxr-sr-x 2 root systemd-journal    4096 Aug 21 16:59 .
drwxr-sr-x 3 root systemd-journal    4096 Aug 17 16:39 ..
-rwxr-xr-x 1 root systemd-journal 8388608 Aug 18 19:36 system@000500e26f9ab124-86721527ee2de970.journal~
-rwxr-xr-x 1 root systemd-journal 8388608 Aug 21 16:59 system@0005011c967a9cb6-f1afda7b33407034.journal~
-rw-r----- 1 root systemd-journal 8388608 Aug 21 17:04 system.journal
 
- If you move the journal directory away and create a new one, is the
problem gone?
After moving it out of the way, it returns No journal files found. Same after re-creating /var/log/journal. After moving the directory back, the assertion returns.
- Can you install systemd-dbg and create a backtrace using gdb, please.

Output:
 Script started on Thu 21 Aug 2014 17:29:51 NZST
root@debian:~# gdb --args journalctl --list-boots
GNU gdb (GDB) 7.6.2 (Debian 7.6.2-1.1+b1)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /bin/journalctl...Reading symbols from /usr/lib/debug/.build-id/5a/b4971c9db1d4f7674ee6c7b37a6e160f89796c.debug...done.
done.
(gdb) run
Starting program: /bin/journalctl --list-boots
Can't read symbols from system-supplied DSO at 0x100000: File truncated
warning: Could not load shared library symbols for linux-vdso32.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/powerpc-linux-gnu/libthread_db.so.1".

Assertion 'size > 0' failed at ../src/journal/mmap-cache.c:543, function mmap_cache_get(). Aborting.

Program received signal SIGABRT, Aborted.
0x0fd5a168 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x0fd5a168 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x0fd5bd50 in __GI_abort () at abort.c:89
#2  0x1000f1bc in log_assert (text=text@entry=0x1003965c "size > 0", file=file@entry=0x100394a0 "../src/journal/mmap-cache.c", 
    line=line@entry=543, func=func@entry=0x10039450 <__PRETTY_FUNCTION__.8083> "mmap_cache_get", 
    format=format@entry=0x10035b8c "Assertion '%s' failed at %s:%u, function %s(). Aborting.") at ../src/shared/log.c:702
#3  0x1000f798 in log_assert_failed (text=text@entry=0x1003965c "size > 0", 
    file=file@entry=0x100394a0 "../src/journal/mmap-cache.c", line=line@entry=543, 
    func=func@entry=0x10039450 <__PRETTY_FUNCTION__.8083> "mmap_cache_get") at ../src/shared/log.c:707
#4  0x10026d54 in mmap_cache_get (m=0x1004f918, fd=9, prot=<optimized out>, context=context@entry=1, 
    keep_always=keep_always@entry=true, offset=<optimized out>, size=0, st=0x10060a90, ret=ret@entry=0x0)
    at ../src/journal/mmap-cache.c:543
#5  0x10018c74 in journal_file_object_keep (offset=<optimized out>, o=<optimized out>, f=<optimized out>)
    at ../src/journal/journal-file.h:215
#6  sd_journal_enumerate_unique (j=j@entry=0x1004e850, data=data@entry=0xbffff96c, l=l@entry=0xbffff970)
    at ../src/journal/sd-journal.c:2593
#7  0x100039c8 in list_boots (j=0x1004e850) at ../src/journal/journalctl.c:781
#8  main (argc=<optimized out>, argv=<optimized out>) at ../src/journal/journalctl.c:1520
(gdb) quit
A debugging session is active.

    Inferior 1 [process 1339] will be killed.

Quit anyway? (y or n) y
root@debian:~# less typescript 
root@debian:~# gdb --args journalctl --list-boots ^C
root@debian:~# exit
Script done on Thu 21 Aug 2014 17:31:15 NZST
Comment 1 Zbigniew Jedrzejewski-Szmek 2014-08-22 03:46:19 UTC
Unfortunately the backtrace doesn't tell us much.

Any chance you could upload the log files (xzipped)? Or send them privately?
Comment 2 Zbigniew Jedrzejewski-Szmek 2014-08-28 01:07:24 UTC
Fixed in http://cgit.freedesktop.org/systemd/systemd/commit/?id=57cd09acf2.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.