Skip to content

probe symbols JSON: "name" field returns return TYPE, not function name #578

Description

@buger

Bug

probe symbols --format json returns the return type in the name field instead of the function name.

Reproduction

probe symbols --format json io.c | python3 -c "
import sys,json
for f in json.load(sys.stdin):
    if f.get('kind')=='function':
        print(f'name={f[\"name\"]:12s}  signature={f[\"signature\"][:60]}')
" | head -5

Expected

name=check_timeout    signature=static void check_timeout(BOOL allow_keepalive, ...
name=whine_about_eof  signature=static NORETURN void whine_about_eof(BOOL ...
name=safe_read        signature=static size_t safe_read(int fd, char *buf, ...

Actual

name=void             signature=static void check_timeout(BOOL allow_keepalive, ...
name=NORETURN         signature=static NORETURN void whine_about_eof(BOOL ...
name=size_t           signature=static size_t safe_read(int fd, char *buf, ...

The name field contains the return type (void, NORETURN, size_t, char), not the function identifier. The actual function name is only recoverable by regex-parsing the signature field.

Impact

Breaks any consumer that relies on name for function identification — including proof's proptest-coverage check (which needs to enumerate functions by name and cross-reference with annotations).

Environment

  • probe-code 0.6.0
  • macOS darwin (arm64)
  • Tested on C source files (rsync 3.5.0 codebase)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions