Skip to content

Conversation

@Shounak-Ghosh
Copy link
Contributor

@Shounak-Ghosh Shounak-Ghosh commented Oct 14, 2025

This PR creates unit tests for vmmap.rs and closes #400. Documentation of the unit tests and the key findings have been added as part of the cage lib README.

These are the results when running the tests:

failures:
memory::vmmap::tests::test_change_prot_end_of_region
memory::vmmap::tests::test_change_prot_exact_boundaries
memory::vmmap::tests::test_change_prot_middle_of_region
memory::vmmap::tests::test_change_prot_multiple_times
memory::vmmap::tests::test_change_prot_spanning_multiple_regions
memory::vmmap::tests::test_change_prot_to_none
memory::vmmap::tests::test_change_prot_to_same_value
memory::vmmap::tests::test_find_map_space_with_hint_alignment_in_pages

test result: FAILED. 14 passed; 8 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

@github-actions
Copy link
Contributor

End-to-End Test Report

Test Preview

Test Report

Deterministic Tests

Summary

MetricCount
Total Test Cases33
Number of Successes33
Number of Failures0
Number of Compilation Failure Native0
Number of Runtime Failure Native0
Number of Segmentation Fault Native0
Number of Timeout During Native0
Number of Lind Wasm Compile Failure0
Number of Lind Wasm Runtime Failure0
Number of Lind Wasm Segmentation Failure0
Number of Timeout During Lind Wasm run0
Number of Unknown Failure0
Number of GCC and Wasm Output mismatch0

Test Results by Category

Test CaseStatusError TypeOutput
Config Tests
dnstest.cSuccessNone
is sockfd valid? yes
37 is the length sent
53 is the length recieved
the dns lookup yields the ip address: 35.172.89.115
File Tests
doubleclose.cSuccessNone
dupwrite.cSuccessNone
write succeeded
ioctl.cSuccessNone
[For 0 = False and  = True]
[The answers should be F, T, F]

(0) Is the socket set for non-blocking I/O?: 0
[Setting socket for non_blocking I/O]
(1) Is the socket set for non-blocking I/O?: 2048
[Clearing socket for non-blocking I/O]
(2) Is the socket set for non-blocking I/O?: 0

printf.cSuccessNone
Hello, World!
write.cSuccessNone
Hello world from Coulson's WASM
writeloop.cSuccessNone
write succeeded
writepartial.cSuccessNone
write
Memory Tests
brk.cSuccessNone
PASS
malloc.cSuccessNone
memcpy.cSuccessNone
Hello, World!
mmap_shared.cSuccessNone
parent value: 1234, 4321
parent value after fork: 1234, 4321
child value after fork: 1234, 4321
parent value after modification: 2333, 3332
child value after modification: 2333, 4321
mprotect.cSuccessNone
Mprotect write test text
sbrk.cSuccessNone
Content in allocated memory: Hello, sbrk memory!
shmtest.cSuccessNone
Networking Tests
makepipe.cSuccessNone
poll.cSuccessNone
stdout is ready for writing.
recvfrom-sendto.cSuccessNone
Client sent: Hello recvfrom!
simple_epoll.cSuccessNone
waiting for epoll event...
got data: hello epoll!

socket.cSuccessNone
Socket opened succesfully.
socket_cloexec.cSuccessNone
SOCK_CLOEXEC is set.
socketpair.cSuccessNone
-->In Xanadu, did Kublai Khan . . .
-->A stately pleasure dome decree . . .
tcp_connect_single.cSuccessNone
Process Tests
chain_thread.cSuccessNone
Outer thread running...
Inner thread running...
Inner thread done.
Outer thread done.
Main thread done.
exit.cSuccessNone
Exiting...

function-ptr.cSuccessNone
Hello, World!
hello.cSuccessNone
wark
noforkfiles.cSuccessNone
signal-fork.cSuccessNone
Successfully changed the signal handler for Signal 12
Killing Child
Signal Handler Test!
Exiting Child
thread-test.cSuccessNone
Hello from the thread!
Thread has finished execution
thread.cSuccessNone
Hello from thread
wait.cSuccessNone
Parent detected child finished.
Child exited with status 0
waitpid_wnohang.cSuccessNone
Non Deterministic Tests

Summary

MetricCount
Total Test Cases20
Number of Successes20
Number of Failures0
Number of Compilation Failure Native0
Number of Runtime Failure Native0
Number of Segmentation Fault Native0
Number of Timeout During Native0
Number of Lind Wasm Compile Failure0
Number of Lind Wasm Runtime Failure0
Number of Lind Wasm Segmentation Failure0
Number of Timeout During Lind Wasm run0
Number of Unknown Failure0
Number of GCC and Wasm Output mismatch0

Test Results by Category

Test CaseStatusError TypeOutput
Config Tests
gethostname.cSuccessNone
Hostname: buildkitsandbox
sysconf.cSuccessNone
calling sysconf(sysconf())
File Tests
chdir_getcwd.cSuccessNone
getcwd() error: Success
getcwd() error: Success
clock_gettime_highlevel.cSuccessNone
Running 1,000,000 iterations...

Start time: 4465 clock ticks
End time: 6713 clock ticks
Elapsed CPU time: 0.002248 seconds

clock_gettime_simple.cSuccessNone
Current time: 1760457206 seconds and 796969046 nanoseconds
dup.cSuccessNone
duped fd: 3
attempting to write to dup() fd

write to dup() fd succeeded
write to old fd succeeded

fchdir.cSuccessNone
getcwd() error: Success
fstatfs.cSuccessNone
Error in open()
: No such file or directory
getcwd.cSuccessNone
getcwd() error: Success
read.cSuccessNone
open(): No such file or directory
statfs.cSuccessNone
Error in statfs
: No such file or directory
Memory Tests
mmap_complicated.cSuccessNone
Parent: Waiting for child to write.
Child: Writing to shared memory.
Parent: Reading from shared memory: 'Hello from the child process!'
Child: Reading from shared memory: 'Hello from the parent process!'
Child: Exiting.
Parent: Reading modified shared memory: 'Hello from the parent process!'
Parent: Exiting.
shm.cSuccessNone
Shared memory segment created with id: 1
Parent attached to shared memory at 0xffffe000
Parent wrote: 'Hello from parent'
Child attached to shared memory at 0xffffe000
Child reads: 'Hello from parent'
Child detached from shared memory
Parent reads: 'Hello from child'
Parent detached from shared memory
Shared memory segment removed
Networking Tests
pipe.cSuccessNone
pipe() ret: [3, 4]
write() ret: 3
read() ret: 3
hi
pipe2.cSuccessNone
pipe2() ret: [3, 4]
write() ret: 3
read() ret: 3
hi
pipewrite.cSuccessNone
Made pipe with write end 3 and read end 4
wrote 16
write 16
wrote 16
wrote three messages to the pipe
msg 0, length 16: hello, world #1
msg 1, length 16: hello, world #2
msg 2, length 16: hello, world #3
simple-select.cSuccessNone
[child] waiting for data...
[parent] writing message
[child] got data: hello select!

[child] waiting for data...
[child] pipe closed

Process Tests
getpid.cSuccessNone
printing pidSuccess
Signal Tests
signal.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
parent in loop, pid=1
Terminated
signal_int_thread.cSuccessNone
main starts!
Hello from thread
thread sleep
thread sleep
child ready to kill
child done kill
child in loop, pid=2
Terminated
Terminated
child in loop, pid=2
child in loop, pid=2
child in loop, pid=2
child in loop, pid=2

@github-actions
Copy link
Contributor

End-to-End Test Report

Test Preview

Test Report

Deterministic Tests

Summary

MetricCount
Total Test Cases33
Number of Successes33
Number of Failures0
Number of Compilation Failure Native0
Number of Runtime Failure Native0
Number of Segmentation Fault Native0
Number of Timeout During Native0
Number of Lind Wasm Compile Failure0
Number of Lind Wasm Runtime Failure0
Number of Lind Wasm Segmentation Failure0
Number of Timeout During Lind Wasm run0
Number of Unknown Failure0
Number of GCC and Wasm Output mismatch0

Test Results by Category

Test CaseStatusError TypeOutput
Config Tests
dnstest.cSuccessNone
is sockfd valid? yes
37 is the length sent
53 is the length recieved
the dns lookup yields the ip address: 35.172.89.115
File Tests
doubleclose.cSuccessNone
dupwrite.cSuccessNone
write succeeded
ioctl.cSuccessNone
[For 0 = False and  = True]
[The answers should be F, T, F]

(0) Is the socket set for non-blocking I/O?: 0
[Setting socket for non_blocking I/O]
(1) Is the socket set for non-blocking I/O?: 2048
[Clearing socket for non-blocking I/O]
(2) Is the socket set for non-blocking I/O?: 0

printf.cSuccessNone
Hello, World!
write.cSuccessNone
Hello world from Coulson's WASM
writeloop.cSuccessNone
write succeeded
writepartial.cSuccessNone
write
Memory Tests
brk.cSuccessNone
PASS
malloc.cSuccessNone
memcpy.cSuccessNone
Hello, World!
mmap_shared.cSuccessNone
parent value: 1234, 4321
parent value after fork: 1234, 4321
child value after fork: 1234, 4321
parent value after modification: 2333, 3332
child value after modification: 2333, 4321
mprotect.cSuccessNone
Mprotect write test text
sbrk.cSuccessNone
Content in allocated memory: Hello, sbrk memory!
shmtest.cSuccessNone
Networking Tests
makepipe.cSuccessNone
poll.cSuccessNone
stdout is ready for writing.
recvfrom-sendto.cSuccessNone
Client sent: Hello recvfrom!
simple_epoll.cSuccessNone
waiting for epoll event...
got data: hello epoll!

socket.cSuccessNone
Socket opened succesfully.
socket_cloexec.cSuccessNone
SOCK_CLOEXEC is set.
socketpair.cSuccessNone
-->In Xanadu, did Kublai Khan . . .
-->A stately pleasure dome decree . . .
tcp_connect_single.cSuccessNone
Process Tests
chain_thread.cSuccessNone
Outer thread running...
Inner thread running...
Inner thread done.
Outer thread done.
Main thread done.
exit.cSuccessNone
Exiting...

function-ptr.cSuccessNone
Hello, World!
hello.cSuccessNone
wark
noforkfiles.cSuccessNone
signal-fork.cSuccessNone
Successfully changed the signal handler for Signal 12
Killing Child
Signal Handler Test!
Exiting Child
thread-test.cSuccessNone
Hello from the thread!
Thread has finished execution
thread.cSuccessNone
Hello from thread
wait.cSuccessNone
Parent detected child finished.
Child exited with status 0
waitpid_wnohang.cSuccessNone
Non Deterministic Tests

Summary

MetricCount
Total Test Cases20
Number of Successes20
Number of Failures0
Number of Compilation Failure Native0
Number of Runtime Failure Native0
Number of Segmentation Fault Native0
Number of Timeout During Native0
Number of Lind Wasm Compile Failure0
Number of Lind Wasm Runtime Failure0
Number of Lind Wasm Segmentation Failure0
Number of Timeout During Lind Wasm run0
Number of Unknown Failure0
Number of GCC and Wasm Output mismatch0

Test Results by Category

Test CaseStatusError TypeOutput
Config Tests
gethostname.cSuccessNone
Hostname: buildkitsandbox
sysconf.cSuccessNone
calling sysconf(sysconf())
File Tests
chdir_getcwd.cSuccessNone
getcwd() error: Success
getcwd() error: Success
clock_gettime_highlevel.cSuccessNone
Running 1,000,000 iterations...

Start time: 4371 clock ticks
End time: 6646 clock ticks
Elapsed CPU time: 0.002275 seconds

clock_gettime_simple.cSuccessNone
Current time: 1760458555 seconds and 716958867 nanoseconds
dup.cSuccessNone
duped fd: 3
attempting to write to dup() fd

write to dup() fd succeeded
write to old fd succeeded

fchdir.cSuccessNone
getcwd() error: Success
fstatfs.cSuccessNone
Error in open()
: No such file or directory
getcwd.cSuccessNone
getcwd() error: Success
read.cSuccessNone
open(): No such file or directory
statfs.cSuccessNone
Error in statfs
: No such file or directory
Memory Tests
mmap_complicated.cSuccessNone
Parent: Waiting for child to write.
Child: Writing to shared memory.
Parent: Reading from shared memory: 'Hello from the child process!'
Child: Reading from shared memory: 'Hello from the parent process!'
Child: Exiting.
Parent: Reading modified shared memory: 'Hello from the parent process!'
Parent: Exiting.
shm.cSuccessNone
Shared memory segment created with id: 1
Parent attached to shared memory at 0xffffe000
Parent wrote: 'Hello from parent'
Child attached to shared memory at 0xffffe000
Child reads: 'Hello from parent'
Child detached from shared memory
Parent reads: 'Hello from child'
Parent detached from shared memory
Shared memory segment removed
Networking Tests
pipe.cSuccessNone
pipe() ret: [3, 4]
write() ret: 3
read() ret: 3
hi
pipe2.cSuccessNone
pipe2() ret: [3, 4]
write() ret: 3
read() ret: 3
hi
pipewrite.cSuccessNone
Made pipe with write end 3 and read end 4
wrote 16
write 16
wrote 16
wrote three messages to the pipe
msg 0, length 16: hello, world #1
msg 1, length 16: hello, world #2
msg 2, length 16: hello, world #3
simple-select.cSuccessNone
[child] waiting for data...
[parent] writing message
[child] got data: hello select!

[child] waiting for data...
[child] pipe closed

Process Tests
getpid.cSuccessNone
printing pidSuccess
Signal Tests
signal.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
parent in loop, pid=1
Terminated
signal_int_thread.cSuccessNone
main starts!
Hello from thread
thread sleep
thread sleep
child ready to kill
child done kill
child in loop, pid=2
Terminated
Terminated
child in loop, pid=2
child in loop, pid=2
child in loop, pid=2
child in loop, pid=2

@rennergade rennergade requested a review from Yaxuan-w October 14, 2025 16:22
Copy link
Member

@Yaxuan-w Yaxuan-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this! Left a minor suggestion, and one place I'm a bit confused, would love to get more clarification:

I ran cargo test --lib memory::vmmap and met:

running 22 tests
test memory::vmmap::tests::test_add_entry_strict_no_overlap ... ok
test memory::vmmap::tests::test_add_entry_with_overwrite_partial_overlap ... ok
test memory::vmmap::tests::test_add_entry_with_overwrite_replaces_existing_full_overlap ... ok
test memory::vmmap::tests::test_change_prot_beginning_of_region ... ok
test memory::vmmap::tests::test_change_prot_end_of_region ... FAILED
test memory::vmmap::tests::test_change_prot_exact_boundaries ... FAILED
test memory::vmmap::tests::test_add_entry_with_overwrite_exact_boundaries ... ok
test memory::vmmap::tests::test_change_prot_entire_region ... ok
test memory::vmmap::tests::test_change_prot_multiple_times ... FAILED
test memory::vmmap::tests::test_change_prot_preserves_backing_type ... ok
test memory::vmmap::tests::test_change_prot_preserves_maxprot ... ok
test memory::vmmap::tests::test_change_prot_spanning_multiple_regions ... FAILED
test memory::vmmap::tests::test_change_prot_to_none ... FAILED
test memory::vmmap::tests::test_change_prot_middle_of_region ... FAILED
test memory::vmmap::tests::test_change_prot_to_same_value ... ok
test memory::vmmap::tests::test_find_map_space_with_hint_alignment_in_pages ... FAILED
test memory::vmmap::tests::test_find_map_space_with_hint_large_page_number ... ok
test memory::vmmap::tests::test_find_map_space_with_hint_searches_from_hint_page ... ok
test memory::vmmap::tests::test_find_map_space_with_hint_uses_page_number ... ok
test memory::vmmap::tests::test_find_map_space_with_hint_zero_hint ... ok
test memory::vmmap::tests::test_find_space_returns_none_when_full ... ok
test memory::vmmap::tests::test_add_entry_with_overwrite_removes_completely_covered_entries ... ok

We only consider adding tests in this PR, and bug fixes will be included in another PR, right?

Comment on lines 24 to 87
## Test Categories

### 1. Memory Protection Change Tests (`change_prot`)

These tests verify that the `change_prot` function correctly modifies memory protection flags while preserving other entry attributes.

#### Key Tests:
- **`test_change_prot_entire_region`** - Verifies that changing protection on an entire region doesn't fragment it
- **`test_change_prot_middle_of_region`** - Confirms proper splitting into 3 parts when modifying middle pages
- **`test_change_prot_beginning_of_region`** - Tests splitting into 2 parts when modifying start pages
- **`test_change_prot_end_of_region`** - Tests splitting into 2 parts when modifying end pages
- **`test_change_prot_spanning_multiple_regions`** - Verifies correct handling across multiple non-contiguous regions
- **`test_change_prot_to_same_value`** - Ensures no fragmentation when protection doesn't actually change
- **`test_change_prot_exact_boundaries`** - Tests single-page modifications and precise boundary handling
- **`test_change_prot_multiple_times`** - Verifies correct state after successive protection changes
- **`test_change_prot_to_none`** - Tests setting protection to `PROT_NONE`
- **`test_change_prot_preserves_backing_type`** - Confirms backing type (Anonymous, SharedMemory, etc.) is preserved
- **`test_change_prot_preserves_maxprot`** - Ensures `maxprot` field remains unchanged

**Key Insight**: `change_prot` only modifies the `prot` field while preserving all other entry attributes including `maxprot`, `backing`, `flags`, etc.

### 2. Entry Overwrite Behavior Tests (`add_entry_with_overwrite`)

These tests clarify what "overwrite" actually means in the context of adding memory entries.

#### Key Tests:
- **`test_add_entry_with_overwrite_replaces_existing_full_overlap`** - Demonstrates that overlapping entries are completely replaced, not merged
- **`test_add_entry_with_overwrite_partial_overlap`** - Shows how partial overlaps cause existing entries to be split
- **`test_add_entry_with_overwrite_removes_completely_covered_entries`** - Verifies that entries fully covered by new entry are removed
- **`test_add_entry_with_overwrite_exact_boundaries`** - Tests behavior at exact boundaries (adjacent but non-overlapping)

**Key Insight**: "Overwrite" means existing overlapping entries are replaced or split, not merged. The new entry's attributes completely replace the old entry's attributes in the overlapping region.

### 3. Address Space Allocation Tests (`find_map_space_with_hint`)

These tests clarify parameter expectations and search behavior for finding available address space.

#### Key Tests:
- **`test_find_map_space_with_hint_uses_page_number`** - **CRITICAL**: Confirms hint parameter is a PAGE NUMBER, not a byte address
- **`test_find_map_space_with_hint_searches_from_hint_page`** - Verifies search begins at the hint page
- **`test_find_map_space_with_hint_zero_hint`** - Shows that hint=0 searches from the beginning
- **`test_find_map_space_with_hint_large_page_number`** - Confirms page-based behavior with large page numbers
- **`test_find_map_space_with_hint_alignment_in_pages`** - Verifies alignment (`pages_per_map`) is also in pages

**Key Insight**: All parameters to `find_map_space_with_hint` are in PAGE UNITS, not byte addresses. This includes:
- `hint`: starting page number for search
- `npages`: number of pages needed
- `pages_per_map`: alignment requirement in pages
- Return value: interval of page numbers

### 4. Additional Function Behavior Tests

#### Key Tests:
- **`test_add_entry_strict_no_overlap`** - Demonstrates that `add_entry` (without overwrite) uses strict insertion and rejects overlaps
- **`test_find_space_returns_none_when_full`** - Verifies proper `None` return when no space is available

## Important Clarifications from Tests

1. **Page Numbers vs Addresses**: All vmmap operations use page numbers internally, not byte addresses
2. **Entry Splitting**: Operations that modify part of an entry create new entries for unchanged portions
3. **Attribute Preservation**: Protection changes preserve maxprot, backing type, and other metadata
4. **Overwrite Semantics**: "Overwrite" means replace, not merge - new entry attributes completely override old ones
5. **Strict vs Overwrite**: `add_entry` rejects overlaps; `add_entry_with_overwrite` handles them by splitting/replacing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we put these into vmmap.rs? (after implementation, before tests)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i think this probably needs to be paired down a bunch though, a lot of this is overwhelming/unescessary

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i think this probably needs to be paired down a bunch though, a lot of this is overwhelming/unescessary

The tests themselves look good. Do you mean there shouldn't be such an extensive (and seemingly AI generated) README addition? I agree, that the doc here could be summarized in a few sentences.

However, a brief comment before each test about its purpose, etc. seems reasonable, so maybe those comments should move there.

@github-actions
Copy link
Contributor

End-to-End Test Report

Test Preview

Test Report

Deterministic Tests

Summary

MetricCount
Total Test Cases45
Number of Successes45
Number of Failures0
Number of Compilation Failure Native0
Number of Runtime Failure Native0
Number of Segmentation Fault Native0
Number of Timeout During Native0
Number of Lind Wasm Compile Failure0
Number of Lind Wasm Runtime Failure0
Number of Lind Wasm Segmentation Failure0
Number of Timeout During Lind Wasm run0
Number of Unknown Failure0
Number of GCC and Wasm Output mismatch0

Test Results by Category

Test CaseStatusError TypeOutput
File Tests
doubleclose.cSuccessNone
dupwrite.cSuccessNone
write succeeded
filetest.cSuccessNone
filetest1000.cSuccessNone
ioctl.cSuccessNone
[For 0 = False and  = True]
[The answers should be F, T, F]

(0) Is the socket set for non-blocking I/O?: 0
[Setting socket for non_blocking I/O]
(1) Is the socket set for non-blocking I/O?: 2048
[Clearing socket for non-blocking I/O]
(2) Is the socket set for non-blocking I/O?: 0

printf.cSuccessNone
Hello, World!
write.cSuccessNone
Hello world from Coulson's WASM
writeloop.cSuccessNone
write succeeded
writepartial.cSuccessNone
write
Memory Tests
brk.cSuccessNone
PASS
malloc.cSuccessNone
memcpy.cSuccessNone
Hello, World!
mmap.cSuccessNone
mmap test: PASS
mprotect.cSuccessNone
Mprotect write test text
sbrk.cSuccessNone
Content in allocated memory: Hello, sbrk memory!
shmtest.cSuccessNone
Networking Tests
gethostname.cSuccessNone
Hostname: buildkitsandbox
makepipe.cSuccessNone
pipepong.cSuccessNone
Parent sending 1
Child received 1
Child sends 2
Parent received 2
Parent sending 3
Child received 3
Child sends 4
Parent received 4
Parent sending 5
Child received 5
Child sends 6
Parent received 6
Parent sending 7
Child received 7
Child sends 8
Parent received 8
Parent sending 9
Child received 9
Child sends 10
Parent received 10
Parent sending 11
Child received 11
Child sends 12
Parent received 12
Parent sending 13
Child received 13
Child sends 14
Parent received 14
Parent sending 15
Child received 15
Child sends 16
Parent received 16
Parent sending 17
Child received 17
Child sends 18
Parent received 18
Parent sending 19
Child received 19
Child sends 20
Parent received 20
Parent sending 21
Child received 21
Child sends 22
Parent received 22
Parent sending 23
Child received 23
Child sends 24
Parent received 24
Parent sending 25
Child received 25
Child sends 26
Parent received 26
Parent sending 27
Child received 27
Child sends 28
Parent received 28
Parent sending 29
Child received 29
Child sends 30
Parent received 30
Parent sending 31
Child received 31
Child sends 32
Parent received 32
Parent sending 33
Child received 33
Child sends 34
Parent received 34
Parent sending 35
Child received 35
Child sends 36
Parent received 36
Parent sending 37
Child received 37
Child sends 38
Parent received 38
Parent sending 39
Child received 39
Child sends 40
Parent received 40
Parent sending 41
Child received 41
Child sends 42
Parent received 42
Parent sending 43
Child received 43
Child sends 44
Parent received 44
Parent sending 45
Child received 45
Child sends 46
Parent received 46
Parent sending 47
Child received 47
Child sends 48
Parent received 48
Parent sending 49
Child received 49
Child sends 50
Parent received 50
Parent sending 51
Child received 51
Child sends 52
Parent received 52
Parent sending 53
Child received 53
Child sends 54
Parent received 54
Parent sending 55
Child received 55
Child sends 56
Parent received 56
Parent sending 57
Child received 57
Child sends 58
Parent received 58
Parent sending 59
Child received 59
Child sends 60
Parent received 60
Parent sending 61
Child received 61
Child sends 62
Parent received 62
Parent sending 63
Child received 63
Child sends 64
Parent received 64
Parent sending 65
Child received 65
Child sends 66
Parent received 66
Parent sending 67
Child received 67
Child sends 68
Parent received 68
Parent sending 69
Child received 69
Child sends 70
Parent received 70
Parent sending 71
Child received 71
Child sends 72
Parent received 72
Parent sending 73
Child received 73
Child sends 74
Parent received 74
Parent sending 75
Child received 75
Child sends 76
Parent received 76
Parent sending 77
Child received 77
Child sends 78
Parent received 78
Parent sending 79
Child received 79
Child sends 80
Parent received 80
Parent sending 81
Child received 81
Child sends 82
Parent received 82
Parent sending 83
Child received 83
Child sends 84
Parent received 84
Parent sending 85
Child received 85
Child sends 86
Parent received 86
Parent sending 87
Child received 87
Child sends 88
Parent received 88
Parent sending 89
Child received 89
Child sends 90
Parent received 90
Parent sending 91
Child received 91
Child sends 92
Parent received 92
Parent sending 93
Child received 93
Child sends 94
Parent received 94
Parent sending 95
Child received 95
Child sends 96
Parent received 96
Parent sending 97
Child received 97
Child sends 98
Parent received 98
Parent sending 99
Child received 99
Child sends 100
Parent received 100
Pipe Pong complete.
Final value: 100
poll.cSuccessNone
stdout is ready for writing.
recvfrom-sendto.cSuccessNone
Client sent: Hello recvfrom!
simple_epoll.cSuccessNone
waiting for epoll event...
got data: hello epoll!

socket.cSuccessNone
Socket opened succesfully.
socket_cloexec.cSuccessNone
SOCK_CLOEXEC is set.
socketpair.cSuccessNone
-->In Xanadu, did Kublai Khan . . .
-->A stately pleasure dome decree . . .
tcp_connect_single.cSuccessNone
Process Tests
chain_thread.cSuccessNone
Outer thread running...
Inner thread running...
Inner thread done.
Outer thread done.
Main thread done.
exit.cSuccessNone
Exiting...

forkexecv.cSuccessNone
function-ptr.cSuccessNone
Hello, World!
getppid.cSuccessNone
getppid() succeeded
hello.cSuccessNone
wark
longjmp.cSuccessNone
In main: Calling first_function...
In first_function: Calling second_function...
In second_function: Performing a long jump...
Back in main: long jump returned with value = 42
noforkfiles.cSuccessNone
sem_forks.cSuccessNone
sigalrm.cSuccessNone
SIGALRM signals blocked
Alarm Handled. Exiting
sigchld.cSuccessNone
Signal Child Test!
signal-fork.cSuccessNone
Successfully changed the signal handler for Signal 12
Killing Child
Signal Handler Test!
Exiting Child
signal-simple.cSuccessNone
Successfully changed the signal handler for Signal 12
Signal Handler Test!
thread-test.cSuccessNone
Hello from the thread!
Thread has finished execution
thread.cSuccessNone
Hello from thread
wait.cSuccessNone
Parent detected child finished.
Child exited with status 0
waitpid_wnohang.cSuccessNone
Signal Tests
alarm.cSuccessNone
Setting an alarm to trigger in 1 seconds...
Alarm triggered! Signal received: 14
Alarm triggered! Signal received: 14
Alarm triggered! Signal received: 14
setitimer.cSuccessNone
Timer started! SIGALRM will fire every 3 seconds.
Timer expired! Signal received: 14
Timer expired! Signal received: 14
Timer expired! Signal received: 14
Non Deterministic Tests

Summary

MetricCount
Total Test Cases41
Number of Successes41
Number of Failures0
Number of Compilation Failure Native0
Number of Runtime Failure Native0
Number of Segmentation Fault Native0
Number of Timeout During Native0
Number of Lind Wasm Compile Failure0
Number of Lind Wasm Runtime Failure0
Number of Lind Wasm Segmentation Failure0
Number of Timeout During Lind Wasm run0
Number of Unknown Failure0
Number of GCC and Wasm Output mismatch0

Test Results by Category

Test CaseStatusError TypeOutput
File Tests
chdir_getcwd.cSuccessNone
getcwd() error: Success
getcwd() error: Success
clock_gettime_highlevel.cSuccessNone
Running 1,000,000 iterations...

Start time: 6502 clock ticks
End time: 8802 clock ticks
Elapsed CPU time: 0.0023 seconds

clock_gettime_simple.cSuccessNone
Current time: 1760831228 seconds and 524398281 nanoseconds
dup.cSuccessNone
duped fd: 3
attempting to write to dup() fd

write to dup() fd succeeded
write to old fd succeeded

fchdir.cSuccessNone
getcwd() error: Success
fstatfs.cSuccessNone
Error in open()
: No such file or directory
getcwd.cSuccessNone
getcwd() error: Success
read.cSuccessNone
open(): No such file or directory
statfs.cSuccessNone
Error in statfs
: No such file or directory
Memory Tests
malloc_large.cSuccessNone
0xefffe010: 42
mmap_complicated.cSuccessNone
Parent: Waiting for child to write.
Child: Writing to shared memory.
Parent: Reading from shared memory: 'Hello from the child process!'
Child: Reading from shared memory: 'Hello from the parent process!'
Child: Exiting.
Parent: Reading modified shared memory: 'Hello from the parent process!'
Parent: Exiting.
mmap_shared.cSuccessNone
parent value: 1234, 4321
parent value after fork: 1234, 4321
child value after fork: 1234, 4321
parent value after modification: 2333, 3332
child value after modification: 2333, 4321
segfault.cSuccessNone
pipe() ret: [3, 4]
read() ret: 3
hi
shm.cSuccessNone
Shared memory segment created with id: 1
Parent attached to shared memory at 0xffffe000
Parent wrote: 'Hello from parent'
Child attached to shared memory at 0xffffe000
Child reads: 'Hello from parent'
Child detached from shared memory
Parent reads: 'Hello from child'
Parent detached from shared memory
Shared memory segment removed
vtable.cSuccessNone
Shape 0 area: 12
Shape 1 area: 19.635
Networking Tests
dnstest.cSuccessNone
is sockfd valid? yes
37 is the length sent
53 is the length recieved
the dns lookup yields the ip address: 35.172.89.115
getifaddrs.cSuccessNone
getifaddrs: Bad address
pipe.cSuccessNone
pipe() ret: [3, 4]
write() ret: 3
read() ret: 3
hi
pipe2.cSuccessNone
pipe2() ret: [3, 4]
write() ret: 3
read() ret: 3
hi
pipeinput.cSuccessNone
about to write to pipe in parent
I'm parent with pid: 2
Hey Nick!

pipeinput2.cSuccessNone
about to write to pipe in parent
I'm parent with pid: 2
Hey Nick!

pipeonestring.cSuccessNone
about to write to pipe in parent
I'm child with pid: 0
I'm parent with pid: 2
Hey Nick!
������
pipewrite.cSuccessNone
Made pipe with write end 3 and read end 4
wrote 16
write 16
wrote 16
wrote three messages to the pipe
msg 0, length 16: hello, world #1
msg 1, length 16: hello, world #2
msg 2, length 16: hello, world #3
shutdown_fork.cSuccessNone
2�1d-05
simple-select.cSuccessNone
[child] waiting for data...
[parent] writing message
[child] got data: hello select!

[child] waiting for data...
[child] pipe closed

socketepoll.cSuccessNone
SERVER: New socket bound and listen
SERVER: NEW CONNECTION
CLIENT: Hello message sent
Hello from client
Message Received
CLIENT: sending followup
Did you get my message?
CLIENT: Closed connection
Closed connection on descriptor 6
read error: Connection reset by peer
Process Tests
fork2malloc.cSuccessNone
first malloc
Address of mptr1 0x30010
Contents of mptr1 deadbeef
pre-fork
in child
Address of mptr1 0x30fc0
done
fork_simple.cSuccessNone
Parent pid = 1
Child pid = 2
forkandopen.cSuccessNone
Parent: Testing open in parent: pid 2!
Child: Testing open in child: pid 0!
Parent: Pid 2 opened fd -1
Child: Pid 0 opened fd -1
forkfiles.cSuccessNone
read -1 chars
forkmalloc.cSuccessNone
in child
pointer address is 0x30010
done
forknodup.cSuccessNone
I'm the child
I'm the PARENT
all done
all done
getpid.cSuccessNone
printing pidSuccess
Signal Tests
signal.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
parent in loop, pid=1
Terminated
signal_SIGCHLD.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 17
Caught signal 10
signal_fork.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 2
after fork inside signal handler, pid=3
after fork inside signal handler, pid=1
parent in loop, pid=1
parent in loop, pid=3
parent in loop, pid=3
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=3
parent in loop, pid=3
parent in loop, pid=1
signal_int_thread.cSuccessNone
main starts!
Hello from thread
thread sleep
thread sleep
child ready to kill
child done kill
child in loop, pid=2
Terminated
Terminated
child in loop, pid=2
child in loop, pid=2
child in loop, pid=2
child in loop, pid=2
signal_longjmp.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
after fork inside signal handler, pid=3
after fork inside signal handler, pid=1
after child longjmp (should only be printed once by parent)
parent in loop, pid=1
back from setjmp: 42! pid=3
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
signal_nodefer.cSuccessNone
main starts!
parent in loop, pid=1
*child ready to kill
*child sent SIGUSR1
Caught signal 10
start of signal handler
*child ready to send SIGUSR1 again
*child done kill
Caught signal 10
start of signal handler
end of signal handler
end of signal handler
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
signal_procmask.cSuccessNone
Parent: Blocking SIGINT...
Signal 2 is BLOCKED
Parent: SIGINT is blocked. Child will send SIGINT soon...
Child: Sending SIGINT to parent (PID: 1)
Parent: Unblocking SIGINT now.
SIGINT received! (Handled in Parent Process)
Signal 2 is UNBLOCKED
Parent: Waiting for SIGINT...
signal_sa_mask.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
signal 10 done
Caught signal 12
signal 12 done
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1

- Return value: interval of page numbers


## Important Clarifications from Unit Tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this section is a bit weirdly phrased. we do want to know how this is structured but its phrased like we just found this out?

perhaps cross-reference the docs that talks about memory and make sure its consistent

@github-actions
Copy link
Contributor

End-to-End Test Report

Test Preview

Test Report

Deterministic Tests

Summary

MetricCount
Total Test Cases46
Number of Successes46
Number of Failures0
Number of Compilation Failure Native0
Number of Runtime Failure Native0
Number of Segmentation Fault Native0
Number of Timeout During Native0
Number of Lind Wasm Compile Failure0
Number of Lind Wasm Runtime Failure0
Number of Lind Wasm Segmentation Failure0
Number of Timeout During Lind Wasm run0
Number of Unknown Failure0
Number of GCC and Wasm Output mismatch0

Test Results by Category

Test CaseStatusError TypeOutput
File Tests
doubleclose.cSuccessNone
dupwrite.cSuccessNone
write succeeded
filetest.cSuccessNone
filetest1000.cSuccessNone
ioctl.cSuccessNone
[For 0 = False and  = True]
[The answers should be F, T, F]

(0) Is the socket set for non-blocking I/O?: 0
[Setting socket for non_blocking I/O]
(1) Is the socket set for non-blocking I/O?: 2048
[Clearing socket for non-blocking I/O]
(2) Is the socket set for non-blocking I/O?: 0

printf.cSuccessNone
Hello, World!
write.cSuccessNone
Hello world from Coulson's WASM
writeloop.cSuccessNone
write succeeded
writepartial.cSuccessNone
write
Memory Tests
brk.cSuccessNone
PASS
malloc.cSuccessNone
memcpy.cSuccessNone
Hello, World!
mmap.cSuccessNone
mmap test: PASS
mprotect.cSuccessNone
Mprotect write test text
sbrk.cSuccessNone
Content in allocated memory: Hello, sbrk memory!
shmtest.cSuccessNone
Networking Tests
gethostname.cSuccessNone
Hostname: buildkitsandbox
makepipe.cSuccessNone
pipepong.cSuccessNone
Parent sending 1
Child received 1
Child sends 2
Parent received 2
Parent sending 3
Child received 3
Child sends 4
Parent received 4
Parent sending 5
Child received 5
Child sends 6
Parent received 6
Parent sending 7
Child received 7
Child sends 8
Parent received 8
Parent sending 9
Child received 9
Child sends 10
Parent received 10
Parent sending 11
Child received 11
Child sends 12
Parent received 12
Parent sending 13
Child received 13
Child sends 14
Parent received 14
Parent sending 15
Child received 15
Child sends 16
Parent received 16
Parent sending 17
Child received 17
Child sends 18
Parent received 18
Parent sending 19
Child received 19
Child sends 20
Parent received 20
Parent sending 21
Child received 21
Child sends 22
Parent received 22
Parent sending 23
Child received 23
Child sends 24
Parent received 24
Parent sending 25
Child received 25
Child sends 26
Parent received 26
Parent sending 27
Child received 27
Child sends 28
Parent received 28
Parent sending 29
Child received 29
Child sends 30
Parent received 30
Parent sending 31
Child received 31
Child sends 32
Parent received 32
Parent sending 33
Child received 33
Child sends 34
Parent received 34
Parent sending 35
Child received 35
Child sends 36
Parent received 36
Parent sending 37
Child received 37
Child sends 38
Parent received 38
Parent sending 39
Child received 39
Child sends 40
Parent received 40
Parent sending 41
Child received 41
Child sends 42
Parent received 42
Parent sending 43
Child received 43
Child sends 44
Parent received 44
Parent sending 45
Child received 45
Child sends 46
Parent received 46
Parent sending 47
Child received 47
Child sends 48
Parent received 48
Parent sending 49
Child received 49
Child sends 50
Parent received 50
Parent sending 51
Child received 51
Child sends 52
Parent received 52
Parent sending 53
Child received 53
Child sends 54
Parent received 54
Parent sending 55
Child received 55
Child sends 56
Parent received 56
Parent sending 57
Child received 57
Child sends 58
Parent received 58
Parent sending 59
Child received 59
Child sends 60
Parent received 60
Parent sending 61
Child received 61
Child sends 62
Parent received 62
Parent sending 63
Child received 63
Child sends 64
Parent received 64
Parent sending 65
Child received 65
Child sends 66
Parent received 66
Parent sending 67
Child received 67
Child sends 68
Parent received 68
Parent sending 69
Child received 69
Child sends 70
Parent received 70
Parent sending 71
Child received 71
Child sends 72
Parent received 72
Parent sending 73
Child received 73
Child sends 74
Parent received 74
Parent sending 75
Child received 75
Child sends 76
Parent received 76
Parent sending 77
Child received 77
Child sends 78
Parent received 78
Parent sending 79
Child received 79
Child sends 80
Parent received 80
Parent sending 81
Child received 81
Child sends 82
Parent received 82
Parent sending 83
Child received 83
Child sends 84
Parent received 84
Parent sending 85
Child received 85
Child sends 86
Parent received 86
Parent sending 87
Child received 87
Child sends 88
Parent received 88
Parent sending 89
Child received 89
Child sends 90
Parent received 90
Parent sending 91
Child received 91
Child sends 92
Parent received 92
Parent sending 93
Child received 93
Child sends 94
Parent received 94
Parent sending 95
Child received 95
Child sends 96
Parent received 96
Parent sending 97
Child received 97
Child sends 98
Parent received 98
Parent sending 99
Child received 99
Child sends 100
Parent received 100
Pipe Pong complete.
Final value: 100
poll.cSuccessNone
stdout is ready for writing.
recvfrom-sendto.cSuccessNone
Client sent: Hello recvfrom!
simple_epoll.cSuccessNone
waiting for epoll event...
got data: hello epoll!

socket.cSuccessNone
Socket opened succesfully.
socket_cloexec.cSuccessNone
SOCK_CLOEXEC is set.
socketpair.cSuccessNone
-->In Xanadu, did Kublai Khan . . .
-->A stately pleasure dome decree . . .
tcp_connect_single.cSuccessNone
Process Tests
chain_thread.cSuccessNone
Outer thread running...
Inner thread running...
Inner thread done.
Outer thread done.
Main thread done.
exit.cSuccessNone
Exiting...

forkexecv.cSuccessNone
function-ptr.cSuccessNone
Hello, World!
getppid.cSuccessNone
getppid() succeeded
hello.cSuccessNone
wark
longjmp.cSuccessNone
In main: Calling first_function...
In first_function: Calling second_function...
In second_function: Performing a long jump...
Back in main: long jump returned with value = 42
noforkfiles.cSuccessNone
sem_forks.cSuccessNone
thread-test.cSuccessNone
Hello from the thread!
Thread has finished execution
thread.cSuccessNone
Hello from thread
wait.cSuccessNone
Parent detected child finished.
Child exited with status 0
waitpid_wnohang.cSuccessNone
Signal Tests
alarm.cSuccessNone
Setting an alarm to trigger in 1 seconds...
Alarm triggered! Signal received: 14
Alarm triggered! Signal received: 14
Alarm triggered! Signal received: 14
setitimer.cSuccessNone
Timer started! SIGALRM will fire every 3 seconds.
Timer expired! Signal received: 14
Timer expired! Signal received: 14
Timer expired! Signal received: 14
sigalrm.cSuccessNone
SIGALRM signals blocked
Alarm Handled. Exiting
sigchld.cSuccessNone
Signal Child Test!
signal-fork.cSuccessNone
Successfully changed the signal handler for Signal 12
Killing Child
Signal Handler Test!
Exiting Child
signal-simple.cSuccessNone
Successfully changed the signal handler for Signal 12
Signal Handler Test!
sigprocmask.cSuccessNone
blocking SIGUSR2
Sending SIGUSR2
Sleeping 1 second
unblocking signal
Signal Handler!
Exiting program
Non Deterministic Tests

Summary

MetricCount
Total Test Cases41
Number of Successes41
Number of Failures0
Number of Compilation Failure Native0
Number of Runtime Failure Native0
Number of Segmentation Fault Native0
Number of Timeout During Native0
Number of Lind Wasm Compile Failure0
Number of Lind Wasm Runtime Failure0
Number of Lind Wasm Segmentation Failure0
Number of Timeout During Lind Wasm run0
Number of Unknown Failure0
Number of GCC and Wasm Output mismatch0

Test Results by Category

Test CaseStatusError TypeOutput
File Tests
chdir_getcwd.cSuccessNone
getcwd() error: Success
getcwd() error: Success
clock_gettime_highlevel.cSuccessNone
Running 1,000,000 iterations...

Start time: 6472 clock ticks
End time: 8729 clock ticks
Elapsed CPU time: 0.002257 seconds

clock_gettime_simple.cSuccessNone
Current time: 1760984995 seconds and 796174175 nanoseconds
dup.cSuccessNone
duped fd: 3
attempting to write to dup() fd

write to dup() fd succeeded
write to old fd succeeded

fchdir.cSuccessNone
getcwd() error: Success
fstatfs.cSuccessNone
Error in open()
: No such file or directory
getcwd.cSuccessNone
getcwd() error: Success
read.cSuccessNone
open(): No such file or directory
statfs.cSuccessNone
Error in statfs
: No such file or directory
Memory Tests
malloc_large.cSuccessNone
0xefffe010: 42
mmap_complicated.cSuccessNone
Parent: Waiting for child to write.
Child: Writing to shared memory.
Parent: Reading from shared memory: 'Hello from the child process!'
Child: Reading from shared memory: 'Hello from the parent process!'
Child: Exiting.
Parent: Reading modified shared memory: 'Hello from the parent process!'
Parent: Exiting.
mmap_shared.cSuccessNone
parent value: 1234, 4321
parent value after fork: 1234, 4321
child value after fork: 1234, 4321
parent value after modification: 2333, 3332
child value after modification: 2333, 4321
segfault.cSuccessNone
pipe() ret: [3, 4]
read() ret: 3
hi
shm.cSuccessNone
Shared memory segment created with id: 1
Parent attached to shared memory at 0xffffe000
Parent wrote: 'Hello from parent'
Child attached to shared memory at 0xffffe000
Child reads: 'Hello from parent'
Child detached from shared memory
Parent reads: 'Hello from child'
Parent detached from shared memory
Shared memory segment removed
vtable.cSuccessNone
Shape 0 area: 12
Shape 1 area: 19.635
Networking Tests
dnstest.cSuccessNone
is sockfd valid? yes
37 is the length sent
53 is the length recieved
the dns lookup yields the ip address: 35.172.89.115
getifaddrs.cSuccessNone
getifaddrs: Bad address
pipe.cSuccessNone
pipe() ret: [3, 4]
write() ret: 3
read() ret: 3
hi
pipe2.cSuccessNone
pipe2() ret: [3, 4]
write() ret: 3
read() ret: 3
hi
pipeinput.cSuccessNone
about to write to pipe in parent
I'm parent with pid: 2
Hey Nick!

pipeinput2.cSuccessNone
about to write to pipe in parent
I'm parent with pid: 2
Hey Nick!

pipeonestring.cSuccessNone
about to write to pipe in parent
I'm child with pid: 0
I'm parent with pid: 2
Hey Nick!
������
pipewrite.cSuccessNone
Made pipe with write end 3 and read end 4
wrote 16
write 16
wrote 16
wrote three messages to the pipe
msg 0, length 16: hello, world #1
msg 1, length 16: hello, world #2
msg 2, length 16: hello, world #3
shutdown_fork.cSuccessNone
2�9d-05
simple-select.cSuccessNone
[child] waiting for data...
[parent] writing message
[child] got data: hello select!

[child] waiting for data...
[child] pipe closed

socketepoll.cSuccessNone
SERVER: New socket bound and listen
SERVER: NEW CONNECTION
CLIENT: Hello message sent
Hello from client
Message Received
CLIENT: sending followup
Did you get my message?
CLIENT: Closed connection
Closed connection on descriptor 6
read error: Connection reset by peer
Process Tests
fork2malloc.cSuccessNone
first malloc
Address of mptr1 0x30010
Contents of mptr1 deadbeef
pre-fork
in child
Address of mptr1 0x30fc0
done
fork_simple.cSuccessNone
Parent pid = 1
Child pid = 2
forkandopen.cSuccessNone
Child: Testing open in child: pid 0!
Parent: Testing open in parent: pid 2!
Parent: Pid 2 opened fd -1
Child: Pid 0 opened fd -1
forkfiles.cSuccessNone
read -1 chars
forkmalloc.cSuccessNone
in child
pointer address is 0x30010
done
forknodup.cSuccessNone
I'm the PARENT
I'm the child
all done
all done
getpid.cSuccessNone
printing pidSuccess
Signal Tests
signal.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
parent in loop, pid=1
Terminated
signal_SIGCHLD.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 17
Caught signal 10
signal_fork.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 2
after fork inside signal handler, pid=1
after fork inside signal handler, pid=3
parent in loop, pid=1
parent in loop, pid=3
parent in loop, pid=1
parent in loop, pid=3
parent in loop, pid=3
parent in loop, pid=1
parent in loop, pid=3
parent in loop, pid=1
signal_int_thread.cSuccessNone
main starts!
Hello from thread
thread sleep
thread sleep
child ready to kill
child done kill
child in loop, pid=2
Terminated
Terminated
child in loop, pid=2
child in loop, pid=2
child in loop, pid=2
child in loop, pid=2
signal_longjmp.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
after fork inside signal handler, pid=1
after fork inside signal handler, pid=3
after child longjmp (should only be printed once by parent)
parent in loop, pid=1
back from setjmp: 42! pid=3
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
signal_nodefer.cSuccessNone
main starts!
parent in loop, pid=1
*child ready to kill
*child sent SIGUSR1
*child ready to send SIGUSR1 again
Caught signal 10
*child done kill
Caught signal 10
start of signal handler
end of signal handler
start of signal handler
end of signal handler
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
signal_procmask.cSuccessNone
Parent: Blocking SIGINT...
Signal 2 is BLOCKED
Parent: SIGINT is blocked. Child will send SIGINT soon...
Child: Sending SIGINT to parent (PID: 1)
Parent: Unblocking SIGINT now.
SIGINT received! (Handled in Parent Process)
Signal 2 is UNBLOCKED
Parent: Waiting for SIGINT...
signal_sa_mask.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
signal 10 done
Caught signal 12
signal 12 done
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1

vmmap.start_address = 0;
vmmap.end_address = 1000;

// Add entries leaving gap at pages 50-99
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the gap is incorrect. Should be: 40-99
pages 10-39 (ends at 40)
pages 100-149 (starts at 100)

ChinmayShringi
ChinmayShringi previously approved these changes Oct 23, 2025
Copy link
Contributor

@ssannkkallpp ssannkkallpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks ok to me, I do see the following tests failing on this branch as of now. Is the idea to fix the test errors in a subsequent PR?

memory::vmmap::tests::test_change_prot_end_of_region memory::vmmap::tests::test_change_prot_exact_boundaries memory::vmmap::tests::test_change_prot_middle_of_region memory::vmmap::tests::test_change_prot_multiple_times memory::vmmap::tests::test_change_prot_spanning_multiple_regions memory::vmmap::tests::test_change_prot_to_none memory::vmmap::tests::test_find_map_space_with_hint_alignment_in_pages

@github-actions
Copy link
Contributor

End-to-End Test Report

Test Preview

Test Report

Deterministic Tests

Summary

MetricCount
Total Test Cases67
Number of Successes67
Number of Failures0
Number of Compilation Failure Native0
Number of Runtime Failure Native0
Number of Segmentation Fault Native0
Number of Timeout During Native0
Number of Lind Wasm Compile Failure0
Number of Lind Wasm Runtime Failure0
Number of Lind Wasm Segmentation Failure0
Number of Timeout During Lind Wasm run0
Number of Unknown Failure0
Number of C Compiler and Wasm Output mismatch0

Test Results by Category

Test CaseStatusError TypeOutput
File Tests
chmod.cSuccessNone
Mode changed successfully
close.cSuccessNone
File opened and closed 2000 times successfully.
doubleclose.cSuccessNone
dupwrite.cSuccessNone
write succeeded
fchmod.cSuccessNone
Mode changed successfully
fcntl.cSuccessNone
Original FD: 3
F_DUPFD duplicated FD: 100
F_DUPFD_CLOEXEC duplicated FD: 101
Original FD flags: FD flags = 0x0
F_DUPFD duplicated FD flags: FD flags = 0x0
F_DUPFD_CLOEXEC duplicated FD flags: FD flags = 0x1
After F_SETFD on F_DUPFD duplicated FD: FD flags = 0x1
Test completed successfully.
fdatasync.cSuccessNone
filetest.cSuccessNone
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
filetest1000.cSuccessNone
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
fstat.cSuccessNone
running fstat("testfiles/fstatfile.txt")
size: 19
fsync.cSuccessNone
ioctl.cSuccessNone
[For 0 = False and  = True]
[The answers should be F, T, F]

(0) Is the socket set for non-blocking I/O?: 0
[Setting socket for non_blocking I/O]
(1) Is the socket set for non-blocking I/O?: 2048
[Clearing socket for non-blocking I/O]
(2) Is the socket set for non-blocking I/O?: 0

mkdir_rmdir.cSuccessNone
Created directory successfully
Removed directory successfully
open.cSuccessNone
File opened successfully with fd = 3
pread_pwrite.cSuccessNone
[file is opened]
[succeeded write(1) process]
[reading(1) data] from pwrite.txt
[Lind is amazing!]
-----------------------------------
[succeeded write(2) process]
[reading(2) data] from pwrite.txt
[NYU is amazing!]
[succeeded in close]
printf.cSuccessNone
Hello, World!
readbytes.cSuccessNone
This is a test of the wonderful fork call in lind.�
readlink.cSuccessNone
=== Test Case 1: Valid symbolic link ===
Symbolic link points to: /src/RawPOSIX/tmp/testfiles/readlinkfile.txt

=== Test Case 2: Path is not a symbolic link ===
Expected failure: Invalid argument

=== Test Case 3: Symbolic link with buffer too small ===
Symbolic link truncated result: /src/

=== Test Case 4: Non-existent path ===
Expected failure: No such file or directory

rename.cSuccessNone
SUCCESS WITH RENAMING
stat.cSuccessNone
running stat("testfiles/statfile.txt")
size: 18
sync_file_range.cSuccessNone
sync_file_range test completed successfully.
truncate.cSuccessNone
Test truncate(const char *, off_t)
Truncating testfiles/truncatefile.txt from 32 to 155
Success
Truncating testfiles/truncatefile.txt from 155 to 32
Success
Test ftruncate(int, off_t)
Truncating testfiles/truncatefile.txt from 32 to 155
Success
Truncating testfiles/truncatefile.txt from 155 to 32
Success
unlinkat.cSuccessNone
=== Test Case 1: Remove valid file ===
Test Case 1: Successfully removed testfiles/unlinkatfile.txt

=== Test Case 2: Remove non-existent file ===
Test Case 2: Expected failure: No such file or directory

=== Test Case 3: Remove file in a subdirectory ===
Test Case 3: Successfully removed file in subdirectory

=== Test Case 4: Remove a directory with AT_REMOVEDIR ===
Test Case 4: Successfully removed directory testfiles/unlinkatsubdir

=== Test Case 5: Remove a directory without AT_REMOVEDIR ===
Test Case 5: Expected failure: Is a directory

write.cSuccessNone
Hello world from Coulson's WASM
writeloop.cSuccessNone
write succeeded
writepartial.cSuccessNone
write
Memory Tests
brk.cSuccessNone
PASS
malloc.cSuccessNone
memcpy.cSuccessNone
Hello, World!
mmap.cSuccessNone
mmap test: PASS
mmap_file.cSuccessNone
Data written to memory-mapped file: Hello, mmap!
Data read back from memory-mapped file: Hello, mmap!
mprotect.cSuccessNone
Mprotect write test text
sbrk.cSuccessNone
Content in allocated memory: Hello, sbrk memory!
shmtest.cSuccessNone
Networking Tests
gethostname.cSuccessNone
Hostname: buildkitsandbox
makepipe.cSuccessNone
pipepong.cSuccessNone
Parent sending 1
Child received 1
Child sends 2
Parent received 2
Parent sending 3
Child received 3
Child sends 4
Parent received 4
Parent sending 5
Child received 5
Child sends 6
Parent received 6
Parent sending 7
Child received 7
Child sends 8
Parent received 8
Parent sending 9
Child received 9
Child sends 10
Parent received 10
Parent sending 11
Child received 11
Child sends 12
Parent received 12
Parent sending 13
Child received 13
Child sends 14
Parent received 14
Parent sending 15
Child received 15
Child sends 16
Parent received 16
Parent sending 17
Child received 17
Child sends 18
Parent received 18
Parent sending 19
Child received 19
Child sends 20
Parent received 20
Parent sending 21
Child received 21
Child sends 22
Parent received 22
Parent sending 23
Child received 23
Child sends 24
Parent received 24
Parent sending 25
Child received 25
Child sends 26
Parent received 26
Parent sending 27
Child received 27
Child sends 28
Parent received 28
Parent sending 29
Child received 29
Child sends 30
Parent received 30
Parent sending 31
Child received 31
Child sends 32
Parent received 32
Parent sending 33
Child received 33
Child sends 34
Parent received 34
Parent sending 35
Child received 35
Child sends 36
Parent received 36
Parent sending 37
Child received 37
Child sends 38
Parent received 38
Parent sending 39
Child received 39
Child sends 40
Parent received 40
Parent sending 41
Child received 41
Child sends 42
Parent received 42
Parent sending 43
Child received 43
Child sends 44
Parent received 44
Parent sending 45
Child received 45
Child sends 46
Parent received 46
Parent sending 47
Child received 47
Child sends 48
Parent received 48
Parent sending 49
Child received 49
Child sends 50
Parent received 50
Parent sending 51
Child received 51
Child sends 52
Parent received 52
Parent sending 53
Child received 53
Child sends 54
Parent received 54
Parent sending 55
Child received 55
Child sends 56
Parent received 56
Parent sending 57
Child received 57
Child sends 58
Parent received 58
Parent sending 59
Child received 59
Child sends 60
Parent received 60
Parent sending 61
Child received 61
Child sends 62
Parent received 62
Parent sending 63
Child received 63
Child sends 64
Parent received 64
Parent sending 65
Child received 65
Child sends 66
Parent received 66
Parent sending 67
Child received 67
Child sends 68
Parent received 68
Parent sending 69
Child received 69
Child sends 70
Parent received 70
Parent sending 71
Child received 71
Child sends 72
Parent received 72
Parent sending 73
Child received 73
Child sends 74
Parent received 74
Parent sending 75
Child received 75
Child sends 76
Parent received 76
Parent sending 77
Child received 77
Child sends 78
Parent received 78
Parent sending 79
Child received 79
Child sends 80
Parent received 80
Parent sending 81
Child received 81
Child sends 82
Parent received 82
Parent sending 83
Child received 83
Child sends 84
Parent received 84
Parent sending 85
Child received 85
Child sends 86
Parent received 86
Parent sending 87
Child received 87
Child sends 88
Parent received 88
Parent sending 89
Child received 89
Child sends 90
Parent received 90
Parent sending 91
Child received 91
Child sends 92
Parent received 92
Parent sending 93
Child received 93
Child sends 94
Parent received 94
Parent sending 95
Child received 95
Child sends 96
Parent received 96
Parent sending 97
Child received 97
Child sends 98
Parent received 98
Parent sending 99
Child received 99
Child sends 100
Parent received 100
Pipe Pong complete.
Final value: 100
poll.cSuccessNone
stdout is ready for writing.
recvfrom-sendto.cSuccessNone
Client sent: Hello recvfrom!
simple_epoll.cSuccessNone
waiting for epoll event...
got data: hello epoll!

socket.cSuccessNone
Socket opened succesfully.
socket_cloexec.cSuccessNone
SOCK_CLOEXEC is set.
socketpair.cSuccessNone
-->In Xanadu, did Kublai Khan . . .
-->A stately pleasure dome decree . . .
tcp_connect_single.cSuccessNone
Process Tests
chain_thread.cSuccessNone
Outer thread running...
Inner thread running...
Inner thread done.
Outer thread done.
Main thread done.
exit.cSuccessNone
Exiting...

forkexecv-arg.cSuccessNone
Received argument: hello-arg
forkexecv.cSuccessNone
wark
function-ptr.cSuccessNone
Hello, World!
getppid.cSuccessNone
getppid() succeeded
hello-arg.cSuccessNone
Received argument: hello-arg
hello.cSuccessNone
wark
longjmp.cSuccessNone
In main: Calling first_function...
In first_function: Calling second_function...
In second_function: Performing a long jump...
Back in main: long jump returned with value = 42
noforkfiles.cSuccessNone
sem_forks.cSuccessNone
setsid.cSuccessNone
setsid() succeeded.
thread-test.cSuccessNone
Hello from the thread!
Thread has finished execution
thread.cSuccessNone
Hello from thread
wait.cSuccessNone
Parent detected child finished.
Child exited with status 0
waitpid_wnohang.cSuccessNone
Signal Tests
alarm.cSuccessNone
Setting an alarm to trigger in 1 seconds...
Alarm triggered! Signal received: 14
Alarm triggered! Signal received: 14
Alarm triggered! Signal received: 14
setitimer.cSuccessNone
Timer started! SIGALRM will fire every 3 seconds.
Timer expired! Signal received: 14
Timer expired! Signal received: 14
Timer expired! Signal received: 14
sigalrm.cSuccessNone
SIGALRM signals blocked
Alarm Handled. Exiting
sigchld.cSuccessNone
Signal Child Test!
signal-fork.cSuccessNone
Successfully changed the signal handler for Signal 12
Killing Child
Signal Handler Test!
Exiting Child
signal-simple.cSuccessNone
Successfully changed the signal handler for Signal 12
Signal Handler Test!
sigprocmask.cSuccessNone
blocking SIGUSR2
Sending SIGUSR2
Sleeping 1 second
unblocking signal
Signal Handler!
Exiting program
Non Deterministic Tests

Summary

MetricCount
Total Test Cases41
Number of Successes40
Number of Failures1
Number of Compilation Failure Native0
Number of Runtime Failure Native0
Number of Segmentation Fault Native0
Number of Timeout During Native0
Number of Lind Wasm Compile Failure0
Number of Lind Wasm Runtime Failure0
Number of Lind Wasm Segmentation Failure0
Number of Timeout During Lind Wasm run1
Number of Unknown Failure0
Number of C Compiler and Wasm Output mismatch0

Test Results by Category

Test CaseStatusError TypeOutput
File Tests
chdir_getcwd.cSuccessNone
getcwd() error: Success
getcwd() error: Success
clock_gettime_highlevel.cSuccessNone
Running 1,000,000 iterations...

Start time: 6536 clock ticks
End time: 8810 clock ticks
Elapsed CPU time: 0.002274 seconds

clock_gettime_simple.cSuccessNone
Current time: 1761609974 seconds and 154135214 nanoseconds
dup.cSuccessNone
duped fd: 3
attempting to write to dup() fd

write to dup() fd succeeded
write to old fd succeeded

fchdir.cSuccessNone
getcwd() error: Success
fstatfs.cSuccessNone
Filesystem type: 794c7630
getcwd.cSuccessNone
getcwd() error: Success
read.cSuccessNone
open(): No such file or directory
statfs.cSuccessNone
Filesystem type: 794c7630
Memory Tests
malloc_large.cSuccessNone
0xefffe010: 42
mmap_complicated.cSuccessNone
Parent: Waiting for child to write.
Child: Writing to shared memory.
Parent: Reading from shared memory: 'Hello from the child process!'
Child: Reading from shared memory: 'Hello from the parent process!'
Child: Exiting.
Parent: Reading modified shared memory: 'Hello from the parent process!'
Parent: Exiting.
mmap_shared.cSuccessNone
parent value: 1234, 4321
parent value after fork: 1234, 4321
child value after fork: 1234, 4321
parent value after modification: 2333, 3332
child value after modification: 2333, 4321
segfault.cSuccessNone
pipe() ret: [3, 4]
read() ret: 3
hi
shm.cSuccessNone
Shared memory segment created with id: 1
Parent attached to shared memory at 0xffffe000
Parent wrote: 'Hello from parent'
Child attached to shared memory at 0xffffe000
Child reads: 'Hello from parent'
Child detached from shared memory
Parent reads: 'Hello from child'
Parent detached from shared memory
Shared memory segment removed
vtable.cSuccessNone
Shape 0 area: 12
Shape 1 area: 19.635
Networking Tests
dnstest.cSuccessNone
is sockfd valid? yes
37 is the length sent
53 is the length recieved
the dns lookup yields the ip address: 35.172.89.115
getifaddrs.cSuccessNone
getifaddrs: Bad address
pipe.cSuccessNone
pipe() ret: [3, 4]
write() ret: 3
read() ret: 3
hi
pipe2.cSuccessNone
pipe2() ret: [3, 4]
write() ret: 3
read() ret: 3
hi
pipeinput.cSuccessNone
about to write to pipe in parent
I'm parent with pid: 2
Hey Nick!

pipeinput2.cSuccessNone
about to write to pipe in parent
I'm parent with pid: 2
Hey Nick!

pipeonestring.cSuccessNone
about to write to pipe in parent
I'm child with pid: 0
I'm parent with pid: 2
Hey Nick!
������
pipewrite.cSuccessNone
Made pipe with write end 3 and read end 4
wrote 16
write 16
wrote 16
wrote three messages to the pipe
msg 0, length 16: hello, world #1
msg 1, length 16: hello, world #2
msg 2, length 16: hello, world #3
shutdown_fork.cSuccessNone
2�7d-05
simple-select.cSuccessNone
[child] waiting for data...
[parent] writing message
[child] got data: hello select!

[child] waiting for data...
[child] pipe closed

socketepoll.cFailureLind_wasm_Timeout
Timed Out (timeout: 10s)
Process Tests
fork2malloc.cSuccessNone
first malloc
Address of mptr1 0x30010
Contents of mptr1 deadbeef
pre-fork
in child
Address of mptr1 0x30fc0
done
fork_simple.cSuccessNone
Parent pid = 1
Child pid = 2
forkandopen.cSuccessNone
Parent: Testing open in parent: pid 2!
Child: Testing open in child: pid 0!
Parent: Pid 2 opened fd 3
Child: Pid 0 opened fd 3
forkfiles.cSuccessNone
This is a test of the wonderful fork call in lind.
read 51 chars
forkmalloc.cSuccessNone
in child
pointer address is 0x30010
done
forknodup.cSuccessNone
I'm the PARENT
I'm the child
all done
all done
getpid.cSuccessNone
printing pidSuccess
Signal Tests
signal.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
parent in loop, pid=1
Terminated
signal_SIGCHLD.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 17
Caught signal 10
signal_fork.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 2
after fork inside signal handler, pid=3
after fork inside signal handler, pid=1
parent in loop, pid=3
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=3
parent in loop, pid=1
parent in loop, pid=3
parent in loop, pid=1
parent in loop, pid=3
signal_int_thread.cSuccessNone
main starts!
Hello from thread
thread sleep
thread sleep
child ready to kill
child done kill
child in loop, pid=2
Terminated
Terminated
child in loop, pid=2
child in loop, pid=2
child in loop, pid=2
child in loop, pid=2
signal_longjmp.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
after fork inside signal handler, pid=1
after fork inside signal handler, pid=3
after child longjmp (should only be printed once by parent)
parent in loop, pid=1
back from setjmp: 42! pid=3
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
signal_nodefer.cSuccessNone
main starts!
parent in loop, pid=1
*child ready to kill
*child sent SIGUSR1
*child ready to send SIGUSR1 again
Caught signal 10
start of signal handler
*child done kill
Caught signal 10
start of signal handler
end of signal handler
end of signal handler
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
signal_procmask.cSuccessNone
Parent: Blocking SIGINT...
Signal 2 is BLOCKED
Parent: SIGINT is blocked. Child will send SIGINT soon...
Child: Sending SIGINT to parent (PID: 1)
Parent: Unblocking SIGINT now.
SIGINT received! (Handled in Parent Process)
Signal 2 is UNBLOCKED
Parent: Waiting for SIGINT...
signal_sa_mask.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
signal 10 done
Caught signal 12
signal 12 done
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1

…md documentation

Addressed the commenting issue with the test_find_map_space_with_hint_searches_from_hint_page function
@github-actions
Copy link
Contributor

End-to-End Test Report

Test Preview

Test Report

Deterministic Tests

Summary

MetricCount
Total Test Cases67
Number of Successes67
Number of Failures0
Number of Compilation Failure Native0
Number of Runtime Failure Native0
Number of Segmentation Fault Native0
Number of Timeout During Native0
Number of Lind Wasm Compile Failure0
Number of Lind Wasm Runtime Failure0
Number of Lind Wasm Segmentation Failure0
Number of Timeout During Lind Wasm run0
Number of Unknown Failure0
Number of C Compiler and Wasm Output mismatch0

Test Results by Category

Test CaseStatusError TypeOutput
File Tests
chmod.cSuccessNone
Mode changed successfully
close.cSuccessNone
File opened and closed 2000 times successfully.
doubleclose.cSuccessNone
dupwrite.cSuccessNone
write succeeded
fchmod.cSuccessNone
Mode changed successfully
fcntl.cSuccessNone
Original FD: 3
F_DUPFD duplicated FD: 100
F_DUPFD_CLOEXEC duplicated FD: 101
Original FD flags: FD flags = 0x0
F_DUPFD duplicated FD flags: FD flags = 0x0
F_DUPFD_CLOEXEC duplicated FD flags: FD flags = 0x1
After F_SETFD on F_DUPFD duplicated FD: FD flags = 0x1
Test completed successfully.
fdatasync.cSuccessNone
filetest.cSuccessNone
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
filetest1000.cSuccessNone
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
fstat.cSuccessNone
running fstat("testfiles/fstatfile.txt")
size: 19
fsync.cSuccessNone
ioctl.cSuccessNone
[For 0 = False and  = True]
[The answers should be F, T, F]

(0) Is the socket set for non-blocking I/O?: 0
[Setting socket for non_blocking I/O]
(1) Is the socket set for non-blocking I/O?: 2048
[Clearing socket for non-blocking I/O]
(2) Is the socket set for non-blocking I/O?: 0

mkdir_rmdir.cSuccessNone
Created directory successfully
Removed directory successfully
open.cSuccessNone
File opened successfully with fd = 3
pread_pwrite.cSuccessNone
[file is opened]
[succeeded write(1) process]
[reading(1) data] from pwrite.txt
[Lind is amazing!]
-----------------------------------
[succeeded write(2) process]
[reading(2) data] from pwrite.txt
[NYU is amazing!]
[succeeded in close]
printf.cSuccessNone
Hello, World!
readbytes.cSuccessNone
This is a test of the wonderful fork call in lind.�
readlink.cSuccessNone
=== Test Case 1: Valid symbolic link ===
Symbolic link points to: /src/RawPOSIX/tmp/testfiles/readlinkfile.txt

=== Test Case 2: Path is not a symbolic link ===
Expected failure: Invalid argument

=== Test Case 3: Symbolic link with buffer too small ===
Symbolic link truncated result: /src/

=== Test Case 4: Non-existent path ===
Expected failure: No such file or directory

rename.cSuccessNone
SUCCESS WITH RENAMING
stat.cSuccessNone
running stat("testfiles/statfile.txt")
size: 18
sync_file_range.cSuccessNone
sync_file_range test completed successfully.
truncate.cSuccessNone
Test truncate(const char *, off_t)
Truncating testfiles/truncatefile.txt from 32 to 155
Success
Truncating testfiles/truncatefile.txt from 155 to 32
Success
Test ftruncate(int, off_t)
Truncating testfiles/truncatefile.txt from 32 to 155
Success
Truncating testfiles/truncatefile.txt from 155 to 32
Success
unlinkat.cSuccessNone
=== Test Case 1: Remove valid file ===
Test Case 1: Successfully removed testfiles/unlinkatfile.txt

=== Test Case 2: Remove non-existent file ===
Test Case 2: Expected failure: No such file or directory

=== Test Case 3: Remove file in a subdirectory ===
Test Case 3: Successfully removed file in subdirectory

=== Test Case 4: Remove a directory with AT_REMOVEDIR ===
Test Case 4: Successfully removed directory testfiles/unlinkatsubdir

=== Test Case 5: Remove a directory without AT_REMOVEDIR ===
Test Case 5: Expected failure: Is a directory

write.cSuccessNone
Hello world from Coulson's WASM
writeloop.cSuccessNone
write succeeded
writepartial.cSuccessNone
write
Memory Tests
brk.cSuccessNone
PASS
malloc.cSuccessNone
memcpy.cSuccessNone
Hello, World!
mmap.cSuccessNone
mmap test: PASS
mmap_file.cSuccessNone
Data written to memory-mapped file: Hello, mmap!
Data read back from memory-mapped file: Hello, mmap!
mprotect.cSuccessNone
Mprotect write test text
sbrk.cSuccessNone
Content in allocated memory: Hello, sbrk memory!
shmtest.cSuccessNone
Networking Tests
gethostname.cSuccessNone
Hostname: buildkitsandbox
makepipe.cSuccessNone
pipepong.cSuccessNone
Parent sending 1
Child received 1
Child sends 2
Parent received 2
Parent sending 3
Child received 3
Child sends 4
Parent received 4
Parent sending 5
Child received 5
Child sends 6
Parent received 6
Parent sending 7
Child received 7
Child sends 8
Parent received 8
Parent sending 9
Child received 9
Child sends 10
Parent received 10
Parent sending 11
Child received 11
Child sends 12
Parent received 12
Parent sending 13
Child received 13
Child sends 14
Parent received 14
Parent sending 15
Child received 15
Child sends 16
Parent received 16
Parent sending 17
Child received 17
Child sends 18
Parent received 18
Parent sending 19
Child received 19
Child sends 20
Parent received 20
Parent sending 21
Child received 21
Child sends 22
Parent received 22
Parent sending 23
Child received 23
Child sends 24
Parent received 24
Parent sending 25
Child received 25
Child sends 26
Parent received 26
Parent sending 27
Child received 27
Child sends 28
Parent received 28
Parent sending 29
Child received 29
Child sends 30
Parent received 30
Parent sending 31
Child received 31
Child sends 32
Parent received 32
Parent sending 33
Child received 33
Child sends 34
Parent received 34
Parent sending 35
Child received 35
Child sends 36
Parent received 36
Parent sending 37
Child received 37
Child sends 38
Parent received 38
Parent sending 39
Child received 39
Child sends 40
Parent received 40
Parent sending 41
Child received 41
Child sends 42
Parent received 42
Parent sending 43
Child received 43
Child sends 44
Parent received 44
Parent sending 45
Child received 45
Child sends 46
Parent received 46
Parent sending 47
Child received 47
Child sends 48
Parent received 48
Parent sending 49
Child received 49
Child sends 50
Parent received 50
Parent sending 51
Child received 51
Child sends 52
Parent received 52
Parent sending 53
Child received 53
Child sends 54
Parent received 54
Parent sending 55
Child received 55
Child sends 56
Parent received 56
Parent sending 57
Child received 57
Child sends 58
Parent received 58
Parent sending 59
Child received 59
Child sends 60
Parent received 60
Parent sending 61
Child received 61
Child sends 62
Parent received 62
Parent sending 63
Child received 63
Child sends 64
Parent received 64
Parent sending 65
Child received 65
Child sends 66
Parent received 66
Parent sending 67
Child received 67
Child sends 68
Parent received 68
Parent sending 69
Child received 69
Child sends 70
Parent received 70
Parent sending 71
Child received 71
Child sends 72
Parent received 72
Parent sending 73
Child received 73
Child sends 74
Parent received 74
Parent sending 75
Child received 75
Child sends 76
Parent received 76
Parent sending 77
Child received 77
Child sends 78
Parent received 78
Parent sending 79
Child received 79
Child sends 80
Parent received 80
Parent sending 81
Child received 81
Child sends 82
Parent received 82
Parent sending 83
Child received 83
Child sends 84
Parent received 84
Parent sending 85
Child received 85
Child sends 86
Parent received 86
Parent sending 87
Child received 87
Child sends 88
Parent received 88
Parent sending 89
Child received 89
Child sends 90
Parent received 90
Parent sending 91
Child received 91
Child sends 92
Parent received 92
Parent sending 93
Child received 93
Child sends 94
Parent received 94
Parent sending 95
Child received 95
Child sends 96
Parent received 96
Parent sending 97
Child received 97
Child sends 98
Parent received 98
Parent sending 99
Child received 99
Child sends 100
Parent received 100
Pipe Pong complete.
Final value: 100
poll.cSuccessNone
stdout is ready for writing.
recvfrom-sendto.cSuccessNone
Client sent: Hello recvfrom!
simple_epoll.cSuccessNone
waiting for epoll event...
got data: hello epoll!

socket.cSuccessNone
Socket opened succesfully.
socket_cloexec.cSuccessNone
SOCK_CLOEXEC is set.
socketpair.cSuccessNone
-->In Xanadu, did Kublai Khan . . .
-->A stately pleasure dome decree . . .
tcp_connect_single.cSuccessNone
Process Tests
chain_thread.cSuccessNone
Outer thread running...
Inner thread running...
Inner thread done.
Outer thread done.
Main thread done.
exit.cSuccessNone
Exiting...

forkexecv-arg.cSuccessNone
Received argument: hello-arg
forkexecv.cSuccessNone
wark
function-ptr.cSuccessNone
Hello, World!
getppid.cSuccessNone
getppid() succeeded
hello-arg.cSuccessNone
Received argument: hello-arg
hello.cSuccessNone
wark
longjmp.cSuccessNone
In main: Calling first_function...
In first_function: Calling second_function...
In second_function: Performing a long jump...
Back in main: long jump returned with value = 42
noforkfiles.cSuccessNone
sem_forks.cSuccessNone
setsid.cSuccessNone
setsid() succeeded.
thread-test.cSuccessNone
Hello from the thread!
Thread has finished execution
thread.cSuccessNone
Hello from thread
wait.cSuccessNone
Parent detected child finished.
Child exited with status 0
waitpid_wnohang.cSuccessNone
Signal Tests
alarm.cSuccessNone
Setting an alarm to trigger in 1 seconds...
Alarm triggered! Signal received: 14
Alarm triggered! Signal received: 14
Alarm triggered! Signal received: 14
setitimer.cSuccessNone
Timer started! SIGALRM will fire every 3 seconds.
Timer expired! Signal received: 14
Timer expired! Signal received: 14
Timer expired! Signal received: 14
sigalrm.cSuccessNone
SIGALRM signals blocked
Alarm Handled. Exiting
sigchld.cSuccessNone
Signal Child Test!
signal-fork.cSuccessNone
Successfully changed the signal handler for Signal 12
Killing Child
Signal Handler Test!
Exiting Child
signal-simple.cSuccessNone
Successfully changed the signal handler for Signal 12
Signal Handler Test!
sigprocmask.cSuccessNone
blocking SIGUSR2
Sending SIGUSR2
Sleeping 1 second
unblocking signal
Signal Handler!
Exiting program
Non Deterministic Tests

Summary

MetricCount
Total Test Cases41
Number of Successes40
Number of Failures1
Number of Compilation Failure Native0
Number of Runtime Failure Native0
Number of Segmentation Fault Native0
Number of Timeout During Native0
Number of Lind Wasm Compile Failure0
Number of Lind Wasm Runtime Failure0
Number of Lind Wasm Segmentation Failure0
Number of Timeout During Lind Wasm run1
Number of Unknown Failure0
Number of C Compiler and Wasm Output mismatch0

Test Results by Category

Test CaseStatusError TypeOutput
File Tests
chdir_getcwd.cSuccessNone
getcwd() error: Success
getcwd() error: Success
clock_gettime_highlevel.cSuccessNone
Running 1,000,000 iterations...

Start time: 6511 clock ticks
End time: 8820 clock ticks
Elapsed CPU time: 0.002309 seconds

clock_gettime_simple.cSuccessNone
Current time: 1761611604 seconds and 774429180 nanoseconds
dup.cSuccessNone
duped fd: 3
attempting to write to dup() fd

write to dup() fd succeeded
write to old fd succeeded

fchdir.cSuccessNone
getcwd() error: Success
fstatfs.cSuccessNone
Filesystem type: 794c7630
getcwd.cSuccessNone
getcwd() error: Success
read.cSuccessNone
open(): No such file or directory
statfs.cSuccessNone
Filesystem type: 794c7630
Memory Tests
malloc_large.cSuccessNone
0xefffe010: 42
mmap_complicated.cSuccessNone
Parent: Waiting for child to write.
Child: Writing to shared memory.
Parent: Reading from shared memory: 'Hello from the child process!'
Child: Reading from shared memory: 'Hello from the parent process!'
Child: Exiting.
Parent: Reading modified shared memory: 'Hello from the parent process!'
Parent: Exiting.
mmap_shared.cSuccessNone
parent value: 1234, 4321
parent value after fork: 1234, 4321
child value after fork: 1234, 4321
parent value after modification: 2333, 3332
child value after modification: 2333, 4321
segfault.cSuccessNone
pipe() ret: [3, 4]
read() ret: 3
hi
shm.cSuccessNone
Shared memory segment created with id: 1
Parent attached to shared memory at 0xffffe000
Parent wrote: 'Hello from parent'
Child attached to shared memory at 0xffffe000
Child reads: 'Hello from parent'
Child detached from shared memory
Parent reads: 'Hello from child'
Parent detached from shared memory
Shared memory segment removed
vtable.cSuccessNone
Shape 0 area: 12
Shape 1 area: 19.635
Networking Tests
dnstest.cSuccessNone
is sockfd valid? yes
37 is the length sent
53 is the length recieved
the dns lookup yields the ip address: 35.172.89.115
getifaddrs.cSuccessNone
getifaddrs: Bad address
pipe.cSuccessNone
pipe() ret: [3, 4]
write() ret: 3
read() ret: 3
hi
pipe2.cSuccessNone
pipe2() ret: [3, 4]
write() ret: 3
read() ret: 3
hi
pipeinput.cSuccessNone
about to write to pipe in parent
I'm parent with pid: 2
Hey Nick!

pipeinput2.cFailureLind_wasm_Timeout
Timed Out (timeout: 10s)
pipeonestring.cSuccessNone
about to write to pipe in parent
I'm child with pid: 0
I'm parent with pid: 2
Hey Nick!
������
pipewrite.cSuccessNone
Made pipe with write end 3 and read end 4
wrote 16
write 16
wrote 16
wrote three messages to the pipe
msg 0, length 16: hello, world #1
msg 1, length 16: hello, world #2
msg 2, length 16: hello, world #3
shutdown_fork.cSuccessNone
3�2d-05
simple-select.cSuccessNone
[child] waiting for data...
[parent] writing message
[child] got data: hello select!

[child] waiting for data...
[child] pipe closed

socketepoll.cSuccessNone
SERVER: New socket bound and listen
SERVER: NEW CONNECTION
CLIENT: Hello message sent
Hello from client
Message Received
CLIENT: sending followup
Did you get my message?
CLIENT: Closed connection
Closed connection on descriptor 6
read error: Connection reset by peer
Process Tests
fork2malloc.cSuccessNone
first malloc
Address of mptr1 0x30010
Contents of mptr1 deadbeef
pre-fork
in child
Address of mptr1 0x30fc0
done
fork_simple.cSuccessNone
Parent pid = 1
Child pid = 2
forkandopen.cSuccessNone
Parent: Testing open in parent: pid 2!
Child: Testing open in child: pid 0!
Parent: Pid 2 opened fd 3
Child: Pid 0 opened fd 3
forkfiles.cSuccessNone
This is a test of the wonderful fork call in lind.
read 51 chars
forkmalloc.cSuccessNone
in child
pointer address is 0x30010
done
forknodup.cSuccessNone
I'm the PARENT
I'm the child
all done
all done
getpid.cSuccessNone
printing pidSuccess
Signal Tests
signal.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
parent in loop, pid=1
Terminated
signal_SIGCHLD.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 17
Caught signal 10
signal_fork.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 2
after fork inside signal handler, pid=3
after fork inside signal handler, pid=1
parent in loop, pid=1
parent in loop, pid=3
parent in loop, pid=1
parent in loop, pid=3
parent in loop, pid=3
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=3
signal_int_thread.cSuccessNone
main starts!
Hello from thread
thread sleep
thread sleep
child ready to kill
child done kill
child in loop, pid=2
Terminated
Terminated
child in loop, pid=2
child in loop, pid=2
child in loop, pid=2
child in loop, pid=2
signal_longjmp.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
after fork inside signal handler, pid=1
after fork inside signal handler, pid=3
after child longjmp (should only be printed once by parent)
parent in loop, pid=1
back from setjmp: 42! pid=3
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
signal_nodefer.cSuccessNone
main starts!
parent in loop, pid=1
*child ready to kill
*child sent SIGUSR1
*child ready to send SIGUSR1 again
*child done kill
Caught signal 10
Caught signal 10
start of signal handler
end of signal handler
start of signal handler
end of signal handler
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
signal_procmask.cSuccessNone
Parent: Blocking SIGINT...
Signal 2 is BLOCKED
Parent: SIGINT is blocked. Child will send SIGINT soon...
Child: Sending SIGINT to parent (PID: 1)
Parent: Unblocking SIGINT now.
SIGINT received! (Handled in Parent Process)
Signal 2 is UNBLOCKED
Parent: Waiting for SIGINT...
signal_sa_mask.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
signal 10 done
Caught signal 12
signal 12 done
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1

.unwrap();

// Change protection to the same value
vmmap.change_prot(100, 10, PROT_READ | PROT_WRITE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you want to test there is no fragmentation when protection doesn't change, I think you should use a smaller region rather than same region?

Changed protection on a smaller subrange and verify fragmentation doesn't occur
@github-actions
Copy link
Contributor

End-to-End Test Report

Test Preview

Test Report

Deterministic Tests

Summary

MetricCount
Total Test Cases67
Number of Successes67
Number of Failures0
Number of Compilation Failure Native0
Number of Runtime Failure Native0
Number of Segmentation Fault Native0
Number of Timeout During Native0
Number of Lind Wasm Compile Failure0
Number of Lind Wasm Runtime Failure0
Number of Lind Wasm Segmentation Failure0
Number of Timeout During Lind Wasm run0
Number of Unknown Failure0
Number of C Compiler and Wasm Output mismatch0

Test Results by Category

Test CaseStatusError TypeOutput
File Tests
chmod.cSuccessNone
Mode changed successfully
close.cSuccessNone
File opened and closed 2000 times successfully.
doubleclose.cSuccessNone
dupwrite.cSuccessNone
write succeeded
fchmod.cSuccessNone
Mode changed successfully
fcntl.cSuccessNone
Original FD: 3
F_DUPFD duplicated FD: 100
F_DUPFD_CLOEXEC duplicated FD: 101
Original FD flags: FD flags = 0x0
F_DUPFD duplicated FD flags: FD flags = 0x0
F_DUPFD_CLOEXEC duplicated FD flags: FD flags = 0x1
After F_SETFD on F_DUPFD duplicated FD: FD flags = 0x1
Test completed successfully.
fdatasync.cSuccessNone
filetest.cSuccessNone
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
filetest1000.cSuccessNone
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
fstat.cSuccessNone
running fstat("testfiles/fstatfile.txt")
size: 19
fsync.cSuccessNone
ioctl.cSuccessNone
[For 0 = False and  = True]
[The answers should be F, T, F]

(0) Is the socket set for non-blocking I/O?: 0
[Setting socket for non_blocking I/O]
(1) Is the socket set for non-blocking I/O?: 2048
[Clearing socket for non-blocking I/O]
(2) Is the socket set for non-blocking I/O?: 0

mkdir_rmdir.cSuccessNone
Created directory successfully
Removed directory successfully
open.cSuccessNone
File opened successfully with fd = 3
pread_pwrite.cSuccessNone
[file is opened]
[succeeded write(1) process]
[reading(1) data] from pwrite.txt
[Lind is amazing!]
-----------------------------------
[succeeded write(2) process]
[reading(2) data] from pwrite.txt
[NYU is amazing!]
[succeeded in close]
printf.cSuccessNone
Hello, World!
readbytes.cSuccessNone
This is a test of the wonderful fork call in lind.�
readlink.cSuccessNone
=== Test Case 1: Valid symbolic link ===
Symbolic link points to: /src/RawPOSIX/tmp/testfiles/readlinkfile.txt

=== Test Case 2: Path is not a symbolic link ===
Expected failure: Invalid argument

=== Test Case 3: Symbolic link with buffer too small ===
Symbolic link truncated result: /src/

=== Test Case 4: Non-existent path ===
Expected failure: No such file or directory

rename.cSuccessNone
SUCCESS WITH RENAMING
stat.cSuccessNone
running stat("testfiles/statfile.txt")
size: 18
sync_file_range.cSuccessNone
sync_file_range test completed successfully.
truncate.cSuccessNone
Test truncate(const char *, off_t)
Truncating testfiles/truncatefile.txt from 32 to 155
Success
Truncating testfiles/truncatefile.txt from 155 to 32
Success
Test ftruncate(int, off_t)
Truncating testfiles/truncatefile.txt from 32 to 155
Success
Truncating testfiles/truncatefile.txt from 155 to 32
Success
unlinkat.cSuccessNone
=== Test Case 1: Remove valid file ===
Test Case 1: Successfully removed testfiles/unlinkatfile.txt

=== Test Case 2: Remove non-existent file ===
Test Case 2: Expected failure: No such file or directory

=== Test Case 3: Remove file in a subdirectory ===
Test Case 3: Successfully removed file in subdirectory

=== Test Case 4: Remove a directory with AT_REMOVEDIR ===
Test Case 4: Successfully removed directory testfiles/unlinkatsubdir

=== Test Case 5: Remove a directory without AT_REMOVEDIR ===
Test Case 5: Expected failure: Is a directory

write.cSuccessNone
Hello world from Coulson's WASM
writeloop.cSuccessNone
write succeeded
writepartial.cSuccessNone
write
Memory Tests
brk.cSuccessNone
PASS
malloc.cSuccessNone
memcpy.cSuccessNone
Hello, World!
mmap.cSuccessNone
mmap test: PASS
mmap_file.cSuccessNone
Data written to memory-mapped file: Hello, mmap!
Data read back from memory-mapped file: Hello, mmap!
mprotect.cSuccessNone
Mprotect write test text
sbrk.cSuccessNone
Content in allocated memory: Hello, sbrk memory!
shmtest.cSuccessNone
Networking Tests
gethostname.cSuccessNone
Hostname: buildkitsandbox
makepipe.cSuccessNone
pipepong.cSuccessNone
Parent sending 1
Child received 1
Child sends 2
Parent received 2
Parent sending 3
Child received 3
Child sends 4
Parent received 4
Parent sending 5
Child received 5
Child sends 6
Parent received 6
Parent sending 7
Child received 7
Child sends 8
Parent received 8
Parent sending 9
Child received 9
Child sends 10
Parent received 10
Parent sending 11
Child received 11
Child sends 12
Parent received 12
Parent sending 13
Child received 13
Child sends 14
Parent received 14
Parent sending 15
Child received 15
Child sends 16
Parent received 16
Parent sending 17
Child received 17
Child sends 18
Parent received 18
Parent sending 19
Child received 19
Child sends 20
Parent received 20
Parent sending 21
Child received 21
Child sends 22
Parent received 22
Parent sending 23
Child received 23
Child sends 24
Parent received 24
Parent sending 25
Child received 25
Child sends 26
Parent received 26
Parent sending 27
Child received 27
Child sends 28
Parent received 28
Parent sending 29
Child received 29
Child sends 30
Parent received 30
Parent sending 31
Child received 31
Child sends 32
Parent received 32
Parent sending 33
Child received 33
Child sends 34
Parent received 34
Parent sending 35
Child received 35
Child sends 36
Parent received 36
Parent sending 37
Child received 37
Child sends 38
Parent received 38
Parent sending 39
Child received 39
Child sends 40
Parent received 40
Parent sending 41
Child received 41
Child sends 42
Parent received 42
Parent sending 43
Child received 43
Child sends 44
Parent received 44
Parent sending 45
Child received 45
Child sends 46
Parent received 46
Parent sending 47
Child received 47
Child sends 48
Parent received 48
Parent sending 49
Child received 49
Child sends 50
Parent received 50
Parent sending 51
Child received 51
Child sends 52
Parent received 52
Parent sending 53
Child received 53
Child sends 54
Parent received 54
Parent sending 55
Child received 55
Child sends 56
Parent received 56
Parent sending 57
Child received 57
Child sends 58
Parent received 58
Parent sending 59
Child received 59
Child sends 60
Parent received 60
Parent sending 61
Child received 61
Child sends 62
Parent received 62
Parent sending 63
Child received 63
Child sends 64
Parent received 64
Parent sending 65
Child received 65
Child sends 66
Parent received 66
Parent sending 67
Child received 67
Child sends 68
Parent received 68
Parent sending 69
Child received 69
Child sends 70
Parent received 70
Parent sending 71
Child received 71
Child sends 72
Parent received 72
Parent sending 73
Child received 73
Child sends 74
Parent received 74
Parent sending 75
Child received 75
Child sends 76
Parent received 76
Parent sending 77
Child received 77
Child sends 78
Parent received 78
Parent sending 79
Child received 79
Child sends 80
Parent received 80
Parent sending 81
Child received 81
Child sends 82
Parent received 82
Parent sending 83
Child received 83
Child sends 84
Parent received 84
Parent sending 85
Child received 85
Child sends 86
Parent received 86
Parent sending 87
Child received 87
Child sends 88
Parent received 88
Parent sending 89
Child received 89
Child sends 90
Parent received 90
Parent sending 91
Child received 91
Child sends 92
Parent received 92
Parent sending 93
Child received 93
Child sends 94
Parent received 94
Parent sending 95
Child received 95
Child sends 96
Parent received 96
Parent sending 97
Child received 97
Child sends 98
Parent received 98
Parent sending 99
Child received 99
Child sends 100
Parent received 100
Pipe Pong complete.
Final value: 100
poll.cSuccessNone
stdout is ready for writing.
recvfrom-sendto.cSuccessNone
Client sent: Hello recvfrom!
simple_epoll.cSuccessNone
waiting for epoll event...
got data: hello epoll!

socket.cSuccessNone
Socket opened succesfully.
socket_cloexec.cSuccessNone
SOCK_CLOEXEC is set.
socketpair.cSuccessNone
-->In Xanadu, did Kublai Khan . . .
-->A stately pleasure dome decree . . .
tcp_connect_single.cSuccessNone
Process Tests
chain_thread.cSuccessNone
Outer thread running...
Inner thread running...
Inner thread done.
Outer thread done.
Main thread done.
exit.cSuccessNone
Exiting...

forkexecv-arg.cSuccessNone
Received argument: hello-arg
forkexecv.cSuccessNone
wark
function-ptr.cSuccessNone
Hello, World!
getppid.cSuccessNone
getppid() succeeded
hello-arg.cSuccessNone
Received argument: hello-arg
hello.cSuccessNone
wark
longjmp.cSuccessNone
In main: Calling first_function...
In first_function: Calling second_function...
In second_function: Performing a long jump...
Back in main: long jump returned with value = 42
noforkfiles.cSuccessNone
sem_forks.cSuccessNone
setsid.cSuccessNone
setsid() succeeded.
thread-test.cSuccessNone
Hello from the thread!
Thread has finished execution
thread.cSuccessNone
Hello from thread
wait.cSuccessNone
Parent detected child finished.
Child exited with status 0
waitpid_wnohang.cSuccessNone
Signal Tests
alarm.cSuccessNone
Setting an alarm to trigger in 1 seconds...
Alarm triggered! Signal received: 14
Alarm triggered! Signal received: 14
Alarm triggered! Signal received: 14
setitimer.cSuccessNone
Timer started! SIGALRM will fire every 3 seconds.
Timer expired! Signal received: 14
Timer expired! Signal received: 14
Timer expired! Signal received: 14
sigalrm.cSuccessNone
SIGALRM signals blocked
Alarm Handled. Exiting
sigchld.cSuccessNone
Signal Child Test!
signal-fork.cSuccessNone
Successfully changed the signal handler for Signal 12
Killing Child
Signal Handler Test!
Exiting Child
signal-simple.cSuccessNone
Successfully changed the signal handler for Signal 12
Signal Handler Test!
sigprocmask.cSuccessNone
blocking SIGUSR2
Sending SIGUSR2
Sleeping 1 second
unblocking signal
Signal Handler!
Exiting program
Non Deterministic Tests

Summary

MetricCount
Total Test Cases41
Number of Successes41
Number of Failures0
Number of Compilation Failure Native0
Number of Runtime Failure Native0
Number of Segmentation Fault Native0
Number of Timeout During Native0
Number of Lind Wasm Compile Failure0
Number of Lind Wasm Runtime Failure0
Number of Lind Wasm Segmentation Failure0
Number of Timeout During Lind Wasm run0
Number of Unknown Failure0
Number of C Compiler and Wasm Output mismatch0

Test Results by Category

Test CaseStatusError TypeOutput
File Tests
chdir_getcwd.cSuccessNone
getcwd() error: Success
getcwd() error: Success
clock_gettime_highlevel.cSuccessNone
Running 1,000,000 iterations...

Start time: 6322 clock ticks
End time: 8595 clock ticks
Elapsed CPU time: 0.002273 seconds

clock_gettime_simple.cSuccessNone
Current time: 1761855662 seconds and 433884307 nanoseconds
dup.cSuccessNone
duped fd: 3
attempting to write to dup() fd

write to dup() fd succeeded
write to old fd succeeded

fchdir.cSuccessNone
getcwd() error: Success
fstatfs.cSuccessNone
Filesystem type: 794c7630
getcwd.cSuccessNone
getcwd() error: Success
read.cSuccessNone
open(): No such file or directory
statfs.cSuccessNone
Filesystem type: 794c7630
Memory Tests
malloc_large.cSuccessNone
0xefffe010: 42
mmap_complicated.cSuccessNone
Parent: Waiting for child to write.
Child: Writing to shared memory.
Parent: Reading from shared memory: 'Hello from the child process!'
Child: Reading from shared memory: 'Hello from the parent process!'
Child: Exiting.
Parent: Reading modified shared memory: 'Hello from the parent process!'
Parent: Exiting.
mmap_shared.cSuccessNone
parent value: 1234, 4321
parent value after fork: 1234, 4321
child value after fork: 1234, 4321
parent value after modification: 2333, 3332
child value after modification: 2333, 4321
segfault.cSuccessNone
pipe() ret: [3, 4]
read() ret: 3
hi
shm.cSuccessNone
Shared memory segment created with id: 1
Parent attached to shared memory at 0xffffe000
Parent wrote: 'Hello from parent'
Child attached to shared memory at 0xffffe000
Child reads: 'Hello from parent'
Child detached from shared memory
Parent reads: 'Hello from child'
Parent detached from shared memory
Shared memory segment removed
vtable.cSuccessNone
Shape 0 area: 12
Shape 1 area: 19.635
Networking Tests
dnstest.cSuccessNone
is sockfd valid? yes
37 is the length sent
53 is the length recieved
the dns lookup yields the ip address: 35.172.89.115
getifaddrs.cSuccessNone
getifaddrs: Bad address
pipe.cSuccessNone
pipe() ret: [3, 4]
write() ret: 3
read() ret: 3
hi
pipe2.cSuccessNone
pipe2() ret: [3, 4]
write() ret: 3
read() ret: 3
hi
pipeinput.cSuccessNone
about to write to pipe in parent
I'm parent with pid: 2
Hey Nick!

pipeinput2.cSuccessNone
about to write to pipe in parent
I'm parent with pid: 2
Hey Nick!

pipeonestring.cSuccessNone
about to write to pipe in parent
I'm child with pid: 0
I'm parent with pid: 2
Hey Nick!
������
pipewrite.cSuccessNone
Made pipe with write end 3 and read end 4
wrote 16
write 16
wrote 16
wrote three messages to the pipe
msg 0, length 16: hello, world #1
msg 1, length 16: hello, world #2
msg 2, length 16: hello, world #3
shutdown_fork.cSuccessNone
2d-05
simple-select.cSuccessNone
[child] waiting for data...
[parent] writing message
[child] got data: hello select!

[child] waiting for data...
[child] pipe closed

socketepoll.cSuccessNone
SERVER: New socket bound and listen
SERVER: NEW CONNECTION
CLIENT: Hello message sent
Hello from client
Message Received
CLIENT: sending followup
Did you get my message?
CLIENT: Closed connection
Closed connection on descriptor 6
read error: Connection reset by peer
Process Tests
fork2malloc.cSuccessNone
first malloc
Address of mptr1 0x30010
Contents of mptr1 deadbeef
pre-fork
in child
Address of mptr1 0x30fc0
done
fork_simple.cSuccessNone
Parent pid = 1
Child pid = 2
forkandopen.cSuccessNone
Parent: Testing open in parent: pid 2!
Child: Testing open in child: pid 0!
Child: Pid 0 opened fd 3
Parent: Pid 2 opened fd 3
forkfiles.cSuccessNone
This is a test of the wonderful fork call in lind.
read 51 chars
forkmalloc.cSuccessNone
in child
pointer address is 0x30010
done
forknodup.cSuccessNone
I'm the PARENT
I'm the child
all done
all done
getpid.cSuccessNone
printing pidSuccess
Signal Tests
signal.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
parent in loop, pid=1
Terminated
signal_SIGCHLD.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 17
Caught signal 10
signal_fork.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 2
after fork inside signal handler, pid=3
parent in loop, pid=3
after fork inside signal handler, pid=1
parent in loop, pid=1
parent in loop, pid=3
parent in loop, pid=1
parent in loop, pid=3
parent in loop, pid=1
parent in loop, pid=3
parent in loop, pid=1
signal_int_thread.cSuccessNone
main starts!
Hello from thread
thread sleep
thread sleep
child ready to kill
child done kill
Terminated
child in loop, pid=2
Terminated
child in loop, pid=2
child in loop, pid=2
child in loop, pid=2
child in loop, pid=2
signal_longjmp.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
after fork inside signal handler, pid=3
after fork inside signal handler, pid=1
after child longjmp (should only be printed once by parent)
parent in loop, pid=1
back from setjmp: 42! pid=3
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
signal_nodefer.cSuccessNone
main starts!
parent in loop, pid=1
*child ready to kill
*child sent SIGUSR1
Caught signal 10
*child ready to send SIGUSR1 again
start of signal handler
*child done kill
Caught signal 10
start of signal handler
end of signal handler
end of signal handler
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
signal_procmask.cSuccessNone
Parent: Blocking SIGINT...
Signal 2 is BLOCKED
Parent: SIGINT is blocked. Child will send SIGINT soon...
Child: Sending SIGINT to parent (PID: 1)
Parent: Unblocking SIGINT now.
SIGINT received! (Handled in Parent Process)
Signal 2 is UNBLOCKED
Parent: Waiting for SIGINT...
signal_sa_mask.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
signal 10 done
Caught signal 12
signal 12 done
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1

@github-actions
Copy link
Contributor

End-to-End Test Report

Test Preview

Test Report

Deterministic Tests

Summary

MetricCount
Total Test Cases67
Number of Successes67
Number of Failures0
Number of Compilation Failure Native0
Number of Runtime Failure Native0
Number of Segmentation Fault Native0
Number of Timeout During Native0
Number of Lind Wasm Compile Failure0
Number of Lind Wasm Runtime Failure0
Number of Lind Wasm Segmentation Failure0
Number of Timeout During Lind Wasm run0
Number of Unknown Failure0
Number of C Compiler and Wasm Output mismatch0

Test Results by Category

Test CaseStatusError TypeOutput
File Tests
chmod.cSuccessNone
Mode changed successfully
close.cSuccessNone
File opened and closed 2000 times successfully.
doubleclose.cSuccessNone
dupwrite.cSuccessNone
write succeeded
fchmod.cSuccessNone
Mode changed successfully
fcntl.cSuccessNone
Original FD: 3
F_DUPFD duplicated FD: 100
F_DUPFD_CLOEXEC duplicated FD: 101
Original FD flags: FD flags = 0x0
F_DUPFD duplicated FD flags: FD flags = 0x0
F_DUPFD_CLOEXEC duplicated FD flags: FD flags = 0x1
After F_SETFD on F_DUPFD duplicated FD: FD flags = 0x1
Test completed successfully.
fdatasync.cSuccessNone
filetest.cSuccessNone
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
filetest1000.cSuccessNone
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
fstat.cSuccessNone
running fstat("testfiles/fstatfile.txt")
size: 19
fsync.cSuccessNone
ioctl.cSuccessNone
[For 0 = False and  = True]
[The answers should be F, T, F]

(0) Is the socket set for non-blocking I/O?: 0
[Setting socket for non_blocking I/O]
(1) Is the socket set for non-blocking I/O?: 2048
[Clearing socket for non-blocking I/O]
(2) Is the socket set for non-blocking I/O?: 0

mkdir_rmdir.cSuccessNone
Created directory successfully
Removed directory successfully
open.cSuccessNone
File opened successfully with fd = 3
pread_pwrite.cSuccessNone
[file is opened]
[succeeded write(1) process]
[reading(1) data] from pwrite.txt
[Lind is amazing!]
-----------------------------------
[succeeded write(2) process]
[reading(2) data] from pwrite.txt
[NYU is amazing!]
[succeeded in close]
printf.cSuccessNone
Hello, World!
readbytes.cSuccessNone
This is a test of the wonderful fork call in lind.�
readlink.cSuccessNone
=== Test Case 1: Valid symbolic link ===
Symbolic link points to: /src/RawPOSIX/tmp/testfiles/readlinkfile.txt

=== Test Case 2: Path is not a symbolic link ===
Expected failure: Invalid argument

=== Test Case 3: Symbolic link with buffer too small ===
Symbolic link truncated result: /src/

=== Test Case 4: Non-existent path ===
Expected failure: No such file or directory

rename.cSuccessNone
SUCCESS WITH RENAMING
stat.cSuccessNone
running stat("testfiles/statfile.txt")
size: 18
sync_file_range.cSuccessNone
sync_file_range test completed successfully.
truncate.cSuccessNone
Test truncate(const char *, off_t)
Truncating testfiles/truncatefile.txt from 32 to 155
Success
Truncating testfiles/truncatefile.txt from 155 to 32
Success
Test ftruncate(int, off_t)
Truncating testfiles/truncatefile.txt from 32 to 155
Success
Truncating testfiles/truncatefile.txt from 155 to 32
Success
unlinkat.cSuccessNone
=== Test Case 1: Remove valid file ===
Test Case 1: Successfully removed testfiles/unlinkatfile.txt

=== Test Case 2: Remove non-existent file ===
Test Case 2: Expected failure: No such file or directory

=== Test Case 3: Remove file in a subdirectory ===
Test Case 3: Successfully removed file in subdirectory

=== Test Case 4: Remove a directory with AT_REMOVEDIR ===
Test Case 4: Successfully removed directory testfiles/unlinkatsubdir

=== Test Case 5: Remove a directory without AT_REMOVEDIR ===
Test Case 5: Expected failure: Is a directory

write.cSuccessNone
Hello world from Coulson's WASM
writeloop.cSuccessNone
write succeeded
writepartial.cSuccessNone
write
Memory Tests
brk.cSuccessNone
PASS
malloc.cSuccessNone
memcpy.cSuccessNone
Hello, World!
mmap.cSuccessNone
mmap test: PASS
mmap_file.cSuccessNone
Data written to memory-mapped file: Hello, mmap!
Data read back from memory-mapped file: Hello, mmap!
mprotect.cSuccessNone
Mprotect write test text
sbrk.cSuccessNone
Content in allocated memory: Hello, sbrk memory!
shmtest.cSuccessNone
Networking Tests
gethostname.cSuccessNone
Hostname: buildkitsandbox
makepipe.cSuccessNone
pipepong.cSuccessNone
Parent sending 1
Child received 1
Child sends 2
Parent received 2
Parent sending 3
Child received 3
Child sends 4
Parent received 4
Parent sending 5
Child received 5
Child sends 6
Parent received 6
Parent sending 7
Child received 7
Child sends 8
Parent received 8
Parent sending 9
Child received 9
Child sends 10
Parent received 10
Parent sending 11
Child received 11
Child sends 12
Parent received 12
Parent sending 13
Child received 13
Child sends 14
Parent received 14
Parent sending 15
Child received 15
Child sends 16
Parent received 16
Parent sending 17
Child received 17
Child sends 18
Parent received 18
Parent sending 19
Child received 19
Child sends 20
Parent received 20
Parent sending 21
Child received 21
Child sends 22
Parent received 22
Parent sending 23
Child received 23
Child sends 24
Parent received 24
Parent sending 25
Child received 25
Child sends 26
Parent received 26
Parent sending 27
Child received 27
Child sends 28
Parent received 28
Parent sending 29
Child received 29
Child sends 30
Parent received 30
Parent sending 31
Child received 31
Child sends 32
Parent received 32
Parent sending 33
Child received 33
Child sends 34
Parent received 34
Parent sending 35
Child received 35
Child sends 36
Parent received 36
Parent sending 37
Child received 37
Child sends 38
Parent received 38
Parent sending 39
Child received 39
Child sends 40
Parent received 40
Parent sending 41
Child received 41
Child sends 42
Parent received 42
Parent sending 43
Child received 43
Child sends 44
Parent received 44
Parent sending 45
Child received 45
Child sends 46
Parent received 46
Parent sending 47
Child received 47
Child sends 48
Parent received 48
Parent sending 49
Child received 49
Child sends 50
Parent received 50
Parent sending 51
Child received 51
Child sends 52
Parent received 52
Parent sending 53
Child received 53
Child sends 54
Parent received 54
Parent sending 55
Child received 55
Child sends 56
Parent received 56
Parent sending 57
Child received 57
Child sends 58
Parent received 58
Parent sending 59
Child received 59
Child sends 60
Parent received 60
Parent sending 61
Child received 61
Child sends 62
Parent received 62
Parent sending 63
Child received 63
Child sends 64
Parent received 64
Parent sending 65
Child received 65
Child sends 66
Parent received 66
Parent sending 67
Child received 67
Child sends 68
Parent received 68
Parent sending 69
Child received 69
Child sends 70
Parent received 70
Parent sending 71
Child received 71
Child sends 72
Parent received 72
Parent sending 73
Child received 73
Child sends 74
Parent received 74
Parent sending 75
Child received 75
Child sends 76
Parent received 76
Parent sending 77
Child received 77
Child sends 78
Parent received 78
Parent sending 79
Child received 79
Child sends 80
Parent received 80
Parent sending 81
Child received 81
Child sends 82
Parent received 82
Parent sending 83
Child received 83
Child sends 84
Parent received 84
Parent sending 85
Child received 85
Child sends 86
Parent received 86
Parent sending 87
Child received 87
Child sends 88
Parent received 88
Parent sending 89
Child received 89
Child sends 90
Parent received 90
Parent sending 91
Child received 91
Child sends 92
Parent received 92
Parent sending 93
Child received 93
Child sends 94
Parent received 94
Parent sending 95
Child received 95
Child sends 96
Parent received 96
Parent sending 97
Child received 97
Child sends 98
Parent received 98
Parent sending 99
Child received 99
Child sends 100
Parent received 100
Pipe Pong complete.
Final value: 100
poll.cSuccessNone
stdout is ready for writing.
recvfrom-sendto.cSuccessNone
Client sent: Hello recvfrom!
simple_epoll.cSuccessNone
waiting for epoll event...
got data: hello epoll!

socket.cSuccessNone
Socket opened succesfully.
socket_cloexec.cSuccessNone
SOCK_CLOEXEC is set.
socketpair.cSuccessNone
-->In Xanadu, did Kublai Khan . . .
-->A stately pleasure dome decree . . .
tcp_connect_single.cSuccessNone
Process Tests
chain_thread.cSuccessNone
Outer thread running...
Inner thread running...
Inner thread done.
Outer thread done.
Main thread done.
exit.cSuccessNone
Exiting...

forkexecv-arg.cSuccessNone
Received argument: hello-arg
forkexecv.cSuccessNone
wark
function-ptr.cSuccessNone
Hello, World!
getppid.cSuccessNone
getppid() succeeded
hello-arg.cSuccessNone
Received argument: hello-arg
hello.cSuccessNone
wark
longjmp.cSuccessNone
In main: Calling first_function...
In first_function: Calling second_function...
In second_function: Performing a long jump...
Back in main: long jump returned with value = 42
noforkfiles.cSuccessNone
sem_forks.cSuccessNone
setsid.cSuccessNone
setsid() succeeded.
thread-test.cSuccessNone
Hello from the thread!
Thread has finished execution
thread.cSuccessNone
Hello from thread
wait.cSuccessNone
Parent detected child finished.
Child exited with status 0
waitpid_wnohang.cSuccessNone
Signal Tests
alarm.cSuccessNone
Setting an alarm to trigger in 1 seconds...
Alarm triggered! Signal received: 14
Alarm triggered! Signal received: 14
Alarm triggered! Signal received: 14
setitimer.cSuccessNone
Timer started! SIGALRM will fire every 3 seconds.
Timer expired! Signal received: 14
Timer expired! Signal received: 14
Timer expired! Signal received: 14
sigalrm.cSuccessNone
SIGALRM signals blocked
Alarm Handled. Exiting
sigchld.cSuccessNone
Signal Child Test!
signal-fork.cSuccessNone
Successfully changed the signal handler for Signal 12
Killing Child
Signal Handler Test!
Exiting Child
signal-simple.cSuccessNone
Successfully changed the signal handler for Signal 12
Signal Handler Test!
sigprocmask.cSuccessNone
blocking SIGUSR2
Sending SIGUSR2
Sleeping 1 second
unblocking signal
Signal Handler!
Exiting program
Non Deterministic Tests

Summary

MetricCount
Total Test Cases41
Number of Successes41
Number of Failures0
Number of Compilation Failure Native0
Number of Runtime Failure Native0
Number of Segmentation Fault Native0
Number of Timeout During Native0
Number of Lind Wasm Compile Failure0
Number of Lind Wasm Runtime Failure0
Number of Lind Wasm Segmentation Failure0
Number of Timeout During Lind Wasm run0
Number of Unknown Failure0
Number of C Compiler and Wasm Output mismatch0

Test Results by Category

Test CaseStatusError TypeOutput
File Tests
chdir_getcwd.cSuccessNone
getcwd() error: Success
getcwd() error: Success
clock_gettime_highlevel.cSuccessNone
Running 1,000,000 iterations...

Start time: 6482 clock ticks
End time: 8816 clock ticks
Elapsed CPU time: 0.002334 seconds

clock_gettime_simple.cSuccessNone
Current time: 1761855804 seconds and 54385119 nanoseconds
dup.cSuccessNone
duped fd: 3
attempting to write to dup() fd

write to dup() fd succeeded
write to old fd succeeded

fchdir.cSuccessNone
getcwd() error: Success
fstatfs.cSuccessNone
Filesystem type: 794c7630
getcwd.cSuccessNone
getcwd() error: Success
read.cSuccessNone
open(): No such file or directory
statfs.cSuccessNone
Filesystem type: 794c7630
Memory Tests
malloc_large.cSuccessNone
0xefffe010: 42
mmap_complicated.cSuccessNone
Parent: Waiting for child to write.
Child: Writing to shared memory.
Parent: Reading from shared memory: 'Hello from the child process!'
Child: Reading from shared memory: 'Hello from the parent process!'
Child: Exiting.
Parent: Reading modified shared memory: 'Hello from the parent process!'
Parent: Exiting.
mmap_shared.cSuccessNone
parent value: 1234, 4321
parent value after fork: 1234, 4321
child value after fork: 1234, 4321
parent value after modification: 2333, 3332
child value after modification: 2333, 4321
segfault.cSuccessNone
pipe() ret: [3, 4]
read() ret: 3
hi
shm.cSuccessNone
Shared memory segment created with id: 1
Parent attached to shared memory at 0xffffe000
Parent wrote: 'Hello from parent'
Child attached to shared memory at 0xffffe000
Child reads: 'Hello from parent'
Child detached from shared memory
Parent reads: 'Hello from child'
Parent detached from shared memory
Shared memory segment removed
vtable.cSuccessNone
Shape 0 area: 12
Shape 1 area: 19.635
Networking Tests
dnstest.cSuccessNone
is sockfd valid? yes
37 is the length sent
53 is the length recieved
the dns lookup yields the ip address: 35.172.89.115
getifaddrs.cSuccessNone
getifaddrs: Bad address
pipe.cSuccessNone
pipe() ret: [3, 4]
write() ret: 3
read() ret: 3
hi
pipe2.cSuccessNone
pipe2() ret: [3, 4]
write() ret: 3
read() ret: 3
hi
pipeinput.cSuccessNone
about to write to pipe in parent
I'm parent with pid: 2
Hey Nick!

pipeinput2.cSuccessNone
about to write to pipe in parent
I'm parent with pid: 2
Hey Nick!

pipeonestring.cSuccessNone
about to write to pipe in parent
I'm child with pid: 0
I'm parent with pid: 2
Hey Nick!
������
pipewrite.cSuccessNone
Made pipe with write end 3 and read end 4
wrote 16
write 16
wrote 16
wrote three messages to the pipe
msg 0, length 16: hello, world #1
msg 1, length 16: hello, world #2
msg 2, length 16: hello, world #3
shutdown_fork.cSuccessNone
2�5d-05
simple-select.cSuccessNone
[child] waiting for data...
[parent] writing message
[child] got data: hello select!

[child] waiting for data...
[child] pipe closed

socketepoll.cSuccessNone
SERVER: New socket bound and listen
SERVER: NEW CONNECTION
CLIENT: Hello message sent
Hello from client
Message Received
CLIENT: sending followup
Did you get my message?
CLIENT: Closed connection
Closed connection on descriptor 6
read error: Connection reset by peer
Process Tests
fork2malloc.cSuccessNone
first malloc
Address of mptr1 0x30010
Contents of mptr1 deadbeef
pre-fork
in child
Address of mptr1 0x30fc0
done
fork_simple.cSuccessNone
Parent pid = 1
Child pid = 2
forkandopen.cSuccessNone
Child: Testing open in child: pid 0!
Parent: Testing open in parent: pid 2!
Parent: Pid 2 opened fd 3
Child: Pid 0 opened fd 3
forkfiles.cSuccessNone
This is a test of the wonderful fork call in lind.
read 51 chars
forkmalloc.cSuccessNone
in child
pointer address is 0x30010
done
forknodup.cSuccessNone
I'm the PARENT
I'm the child
all done
all done
getpid.cSuccessNone
printing pidSuccess
Signal Tests
signal.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
parent in loop, pid=1
Terminated
signal_SIGCHLD.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 17
Caught signal 10
signal_fork.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 2
after fork inside signal handler, pid=3
after fork inside signal handler, pid=1
parent in loop, pid=3
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=3
parent in loop, pid=1
parent in loop, pid=3
parent in loop, pid=1
parent in loop, pid=3
signal_int_thread.cSuccessNone
main starts!
Hello from thread
thread sleep
thread sleep
child ready to kill
child done kill
child in loop, pid=2
Terminated
Terminated
child in loop, pid=2
child in loop, pid=2
child in loop, pid=2
child in loop, pid=2
signal_longjmp.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
after fork inside signal handler, pid=3
after fork inside signal handler, pid=1
after child longjmp (should only be printed once by parent)
parent in loop, pid=1
back from setjmp: 42! pid=3
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
signal_nodefer.cSuccessNone
main starts!
parent in loop, pid=1
*child ready to kill
*child sent SIGUSR1
*child ready to send SIGUSR1 again
Caught signal 10
*child done kill
Caught signal 10
start of signal handler
end of signal handler
start of signal handler
end of signal handler
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
signal_procmask.cSuccessNone
Parent: Blocking SIGINT...
Signal 2 is BLOCKED
Parent: SIGINT is blocked. Child will send SIGINT soon...
Child: Sending SIGINT to parent (PID: 1)
Parent: Unblocking SIGINT now.
SIGINT received! (Handled in Parent Process)
Signal 2 is UNBLOCKED
Parent: Waiting for SIGINT...
signal_sa_mask.cSuccessNone
main starts!
parent in loop, pid=1
child ready to kill
child done kill
Caught signal 10
signal 10 done
Caught signal 12
signal 12 done
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1
parent in loop, pid=1

@rennergade rennergade merged commit 5b436dc into main Oct 30, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add comprehensive unit tests for vmmap

8 participants