[BUG] event_wait_timed can't return false
Maintainer thường phản hồi trong vòng 3 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- c
- Lĩnh vực
- operating-systems
Hướng nghiên cứu
Start in portable/ThirdParty/GCC/Posix/utils/wait_for_event.c, in event_wait_timed, and check what the return value of pthread_cond_timedwait is compared against on the timeout path; the reported symptom is that every reachable branch returns true. Build the reproducer from the issue against that file (gcc -D_GNU_SOURCE ... -pthread) and confirm the first assert fails, then confirm the mutex is released on timeout. Note that an open pull request, #1525, already targets this, so read it before writing anything.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
event_wait_timed returns true in all reachable branches.
Target
All targets using the portable/ThirdParty/GCC/Posix/utils/wait_for_event.c version of event_wait_timed.
Host
- Host OS: Fedora
- Version: 44
To Reproduce
Compile and run this on a Posix target. It will fail:
/* gcc -D_GNU_SOURCE t.c wait_for_event.c -pthread && ./a.out */
#include <assert.h>
#include <pthread.h>
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include "wait_for_event.h"
static void * sig( void * ev )
{
usleep( 50000 );
event_signal( ev );
return NULL;
}
int main( void )
{
struct event * ev = event_create();
pthread_t th;
/* Timeout must report false, and must not leak the mutex. */
assert( event_wait_timed( ev, 100 ) == false );
/* Object still usable after timeout; signal must report true. */
pthread_create( &th, NULL, sig, ev );
assert( event_wait_timed( ev, 5000 ) == true );
pthread_join( th, NULL );
event_delete( ev );
puts( "OK" );
}
Expected behavior
I'm expecting a false return in the first assert signalling a timeout but, even though it times out, the function returns true.
- Ngôn ngữ chính
- C
- Star
- 4.6k
- Fork
- 1.6k
- Merge trung bình
- 2 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của FreeRTOS/FreeRTOS-Kernel
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
FreeRTOS/FreeRTOS-Kernel#1542 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
[BUG] Release asset FreeRTOS-KernelV11.3.2.zip has the files of main, not of the tag V11.3.2Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
FreeRTOS/FreeRTOS-Kernel#1520 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
FreeRTOS/FreeRTOS-Kernel#1494 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
FreeRTOS/FreeRTOS-Kernel#1554 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
FreeRTOS/FreeRTOS-Kernel#1545 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của FreeRTOS/FreeRTOS-Kernel
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 63/100
FreeRTOS/FreeRTOS-Plus-TCP#1395 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
qoretechnologies/qore#8222 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
c easy first-contributor first-contributors good first issue help wanted up-for-grabs
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 96/100
fork-commit-merge/fork-commit-merge#8696 ·
Maintainer thường phản hồi trong vòng 1 ngày