[Bug remote/25111] New: [Zephyr/thread aware debugging] remote: write_ptid returns negative tid.

doubledn94 at gmail dot com sourceware-bugzilla@sourceware.org
Thu Oct 17 07:24:00 GMT 2019


https://sourceware.org/bugzilla/show_bug.cgi?id=25111

            Bug ID: 25111
           Summary: [Zephyr/thread aware debugging] remote: write_ptid
                    returns negative tid.
           Product: gdb
           Version: 8.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: remote
          Assignee: unassigned at sourceware dot org
          Reporter: doubledn94 at gmail dot com
  Target Milestone: ---

In Zephyr the k_thread_create function returns thread ID which is actually
pointer to k_thread structure. See:
https://docs.zephyrproject.org/2.0.0/reference/kernel/threads/index.html?highlight=k_thread_create#_CPPv315k_thread_createP8k_threadP16k_thread_stack_t6size_t16k_thread_entry_tPvPvPvi5u32_t5s32_t
https://elixir.bootlin.com/zephyr/latest/source/include/kernel.h#L592

In ARC case the address space starts from 0x80000000, and passing such big
values(>2147483648) to write_ptid function leads to overflow of "int tid"
variable. Actually process/thread id's are positive and rarely exceeds the
maximum of Int. 

Do we really need this negative tid/pid handling? Maybe moving to uint32_t type
would be better there?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list