Project

General

Profile

Actions

Bug #1528

open

ktrace does not show proper return values for pipe(2)

Added by corecode over 15 years ago. Updated over 3 years ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
Kernel
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

When ktracing a pipe syscall, the output is:

57705 a.out CALL pipe
57705 a.out RET pipe 3

However, the return value of pipe is 0, and the returned value for the
file descs is {3, 4}.

Actions #1

Updated by Anonymous about 15 years ago

I've added a kprintf in ktrsysret() and here is what printed:

1126 a.out CALL pipe
1126 a.out RET ret=3 error=0 code=42 pipe 3

Question is why `ret' contains the first file descriptor of the pair at all.
(and not zero as ought to)

Stathis

Actions #2

Updated by corecode about 15 years ago

Stathis Kamperis (via DragonFly issue tracker) wrote:

Stathis Kamperis <> added the comment:

I've added a kprintf in ktrsysret() and here is what printed:

1126 a.out CALL pipe
1126 a.out RET ret=3 error=0 code=42 pipe 3

Question is why `ret' contains the first file descriptor of the pair at all.
(and not zero as ought to)

This is because sys_pipe returns both fds as return value, namely
sysmsg_fds0 and sysmsg_fds1. However ktrsysret is only called with
sysmsg_result, which covers only the first fd.

I guess the pipe libc glue code copies this result into the array.

cheers
simon

Actions #3

Updated by tuxillo almost 11 years ago

  • Description updated (diff)
  • Category set to Kernel
  • Status changed from New to In Progress
  • Assignee changed from 0 to tuxillo
  • Target version set to 3.8

Grab.

Actions #4

Updated by tuxillo over 3 years ago

  • Target version changed from 3.8 to 6.0
Actions

Also available in: Atom PDF