Taskwarrior: Assertion '__pos <= size()' failed.

Created on 14 May 2018  Β·  7Comments  Β·  Source: GothenburgBitFactory/taskwarrior

To report a bug...

  • What command(s) did you run?
    $ task completed
  • What did you expect to happen?
    Te result of completed task should be in the output.

  • What actually happened?

$ task completed
/usr/include/c++/8/bits/basic_string.h:1029: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference = const char&; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]: Assertion '__pos <= size()' failed.
fish: β€œtask completed” terminated by signal SIGABRT (Abort)
  • Paste the output of the task diag command.
$ task diag

task 2.5.1
   Platform: Linux

Compiler
    Version: 8.0.1 20180207 (Red Hat 8.0.1-0.12)
       Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
 Compliance: C++11

Build Features
      Built: Feb 10 2018 00:36:43
      CMake: 3.10.1
    libuuid: libuuid + uuid_unparse_lower
  libgnutls: 3.6.1
 Build type: 

Configuration
       File: /home/gour/.taskrc (found), 2532 bytes, mode 100644
       Data: /home/gour/task (found), dir, mode 40755
    Locking: Enabled
         GC: Enabled
  rc.editor: /usr/bin/nvim
     Server: atmarama.ddns.net:53589
         CA: /home/gour/task/ca.cert.pem, readable, 3714 bytes
      Trust: strict
Certificate: /home/gour/task/gour.cert.pem, readable, 3710 bytes
        Key: /home/gour/task/gour.key.pem, readable, 24745 bytes
    Ciphers: NORMAL
      Creds: users/gour/************************************

Hooks
     System: Enabled
   Location: /home/gour/task/hooks
             (-none-)

Tests
      $TERM: xterm-256color (151x64)
       Dups: Scanned 5703 tasks for duplicate UUIDs:
             No duplicates found
 Broken ref: Scanned 5703 tasks for broken references:
             No broken references found
bug

All 7 comments

This is not reproducible here, as-is. I think this is data-related, so this will require either your data, or for you to bisect the data until it is found.

completed.data.zip
Here I'm including minimal sample which shows the problem as result of bisecting my original complete.data.

I have the same issue on Fedora 28. Here is the script to reproduce the error.

#!/bin/sh
export TASKRC=/tmp/.taskrc
export TASKDATA=/tmp/.task
set -x
rm -rf $TASKRC $TASKDATA
echo yes | task add 'Π‘ΡƒΠΏΠ΅Ρ€ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚ΠΈΠ½Π³'
task
task 1 annotate 'dontcare'
task
task diag

The output:

+ rm -rf /tmp/.taskrc /tmp/.task
+ echo yes
+ task add Π‘ΡƒΠΏΠ΅Ρ€ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚ΠΈΠ½Π³
A configuration file could not be found in 

Would you like a sample /tmp/.taskrc created, so Taskwarrior can proceed? (yes/no) TASKRC override: /tmp/.taskrc
TASKDATA override: /tmp/.task
Created task 1.
+ task
TASKRC override: /tmp/.taskrc
TASKDATA override: /tmp/.task
[task next]

ID Age Description     Urg
-- --- --------------- ----
 1 -   Π‘ΡƒΠΏΠ΅Ρ€ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚ΠΈΠ½Π³    0

1 task
+ task 1 annotate dontcare
Annotating task 1 'Π‘ΡƒΠΏΠ΅Ρ€ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚ΠΈΠ½Π³'.
Annotated 1 task.
TASKRC override: /tmp/.taskrc
TASKDATA override: /tmp/.task
+ task
/usr/include/c++/8/bits/basic_string.h:1029: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference = const char&; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]: Assertion '__pos <= size()' failed.
./task.sh: строка 9: 17196 Aborted                 (стСк памяти ΡΠ±Ρ€ΠΎΡˆΠ΅Π½ Π½Π° диск) task
+ task diag
TASKRC override: /tmp/.taskrc
TASKDATA override: /tmp/.task

task 2.5.1
   Platform: Linux

Compiler
    Version: 8.0.1 20180207 (Red Hat 8.0.1-0.12)
       Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
 Compliance: C++11

Build Features
      Built: Feb 10 2018 00:36:43
      CMake: 3.10.1
    libuuid: libuuid + uuid_unparse_lower
  libgnutls: 3.6.1
 Build type: 

Configuration
       File: /tmp/.taskrc (found), 1356 bytes, mode 100644
       Data: /tmp/.task (found), dir, mode 40755
     TASKRC: /tmp/.taskrc
   TASKDATA: /tmp/.task
    Locking: Enabled
         GC: Enabled
    $EDITOR: vim
     Server: 
      Trust: strict
Certificate: , not readable, 0 bytes
        Key: , not readable, 0 bytes
    Ciphers: NORMAL
      Creds: 

Hooks
     System: Enabled
   Location: /tmp/.task/hooks
             (-none-)

Tests
      $TERM: st-256color (120x30)
       Dups: Scanned 1 tasks for duplicate UUIDs:
             No duplicates found
 Broken ref: Scanned 1 tasks for broken references:
             No broken references found

The error occurs when you try to annotate a task which description contains certain Russian words. For example, if you replace 'Π‘ΡƒΠΏΠ΅Ρ€ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚ΠΈΠ½Π³' with 'Π‘ΡƒΠΏΠ΅Ρ€ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚Π΅Ρ€', the script will succeed but the word will be truncated to 'Π‘ΡƒΠΏΠ΅Ρ€ΠΊΠΎ'.

Here is the output for 'Π‘ΡƒΠΏΠ΅Ρ€ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚Π΅Ρ€':

+ rm -rf /tmp/.taskrc /tmp/.task
+ echo yes
+ task add Π‘ΡƒΠΏΠ΅Ρ€ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚Π΅Ρ€
A configuration file could not be found in 

Would you like a sample /tmp/.taskrc created, so Taskwarrior can proceed? (yes/no) TASKRC override: /tmp/.taskrc
TASKDATA override: /tmp/.task
Created task 1.
+ task
TASKRC override: /tmp/.taskrc
TASKDATA override: /tmp/.task
[task next]

ID Age Description    Urg
-- --- -------------- ----
 1 -   Π‘ΡƒΠΏΠ΅Ρ€ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚Π΅Ρ€    0

1 task
+ task 1 annotate dontcare
Annotating task 1 'Π‘ΡƒΠΏΠ΅Ρ€ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚Π΅Ρ€'.
Annotated 1 task.
TASKRC override: /tmp/.taskrc
TASKDATA override: /tmp/.task
+ task
TASKRC override: /tmp/.taskrc
TASKDATA override: /tmp/.task
[task next]

ID Age Description           Urg
-- --- --------------------- ----
 1 -   Π‘ΡƒΠΏΠ΅Ρ€ΠΊΠΎ                0.8
         2018-06-29 dontcare

1 task
+ task diag
TASKRC override: /tmp/.taskrc
TASKDATA override: /tmp/.task

task 2.5.1
   Platform: Linux

Compiler
    Version: 8.0.1 20180207 (Red Hat 8.0.1-0.12)
       Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
 Compliance: C++11

Build Features
      Built: Feb 10 2018 00:36:43
      CMake: 3.10.1
    libuuid: libuuid + uuid_unparse_lower
  libgnutls: 3.6.1
 Build type: 

Configuration
       File: /tmp/.taskrc (found), 1356 bytes, mode 100644
       Data: /tmp/.task (found), dir, mode 40755
     TASKRC: /tmp/.taskrc
   TASKDATA: /tmp/.task
    Locking: Enabled
         GC: Enabled
    $EDITOR: vim
     Server: 
      Trust: strict
Certificate: , not readable, 0 bytes
        Key: , not readable, 0 bytes
    Ciphers: NORMAL
      Creds: 

Hooks
     System: Enabled
   Location: /tmp/.task/hooks
             (-none-)

Tests
      $TERM: st-256color (120x30)
       Dups: Scanned 1 tasks for duplicate UUIDs:
             No duplicates found
 Broken ref: Scanned 1 tasks for broken references:
             No broken references found

Here is the stack trace from GDB:

Program received signal SIGABRT, Aborted.
0x00007ffff6ba7f4b in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff6ba7f4b in raise () from /lib64/libc.so.6
#1  0x00007ffff6b92591 in abort () from /lib64/libc.so.6
#2  0x00005555555ca808 in std::__replacement_assert(char const*, int, char const*, char const*) ()
#3  0x0000555555626010 in utf8_next_char(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long&) ()
#4  0x0000555555626493 in utf8_text_width(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#5  0x0000555555622ddf in leftJustify(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int) ()
#6  0x00005555556c8517 in Column::renderStringLeft(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, int, Color&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    ()
#7  0x00005555556cd849 in ColumnDescription::render(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, Task&, int, Color&) ()
#8  0x00005555556e7381 in ViewTask::render[abi:cxx11](std::vector<Task, std::allocator<Task> >&, std::vector<int, std::allocator<int> >&) ()
#9  0x0000555555670b9b in CmdCustom::execute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) ()
#10 0x00005555555be0eb in Context::dispatch(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) ()
#11 0x00005555555bed02 in Context::run() ()
#12 0x00005555555ba5b2 in main ()

This issue appears to have been fixed in d025f3deb6349f56a7fc49551e819cfe13f97917. I can no longer reproduce it with the following commands:

task add Test
task 1 ann Δ‡
task 1 ann x
task 1

Please check if the issue still occurs when building the 2.6.0 branch from source.

In taskwarrior 2.5.1 on Fedora 31 this is also reproducible when running task information, but not when running task completed:

# task information
/usr/include/c++/9/bits/basic_string.h:1048: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference = const char&; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]: Assertion '__pos <= size()' failed.

I run into this seg fault on Fedora 31 (task-2.5.1-12.fc31.x86_64.rpm) today too.

The seg fault was the same as provided by @igankevich already.

My tasks were imported by bugwarrior with Redmine configured. Not all tasks are affected. It happened only on a small percentage.

I compiled taskwarrior cad8bec8b630c3a257f6b876bb21f30a84321d06 (branch 2.6.0) today and the affected tasks display now fine. No more seg faults are thrown so far.

Fixed in 2.5.2 (now released!).

Was this page helpful?
0 / 5 - 0 ratings