You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue A compiler warning namhyung/uftrace#936
문제설명: uftrace를 특정 gcc 구버전(5,6) 에서 빌드를 시도하면 warning: dereferencing type-punned pointer will break strict-aliasing rules 메세지가 출력되는 문제가 있음.
대응방안: union 공용체를 사용하여 문제 해결.
Fix commit: No commit. Currently communicating.
1번 패치 ( 코드 리팩토링)
설명: uftrace가 의존하고 있는 libtraceevent 소스코드에서 조건문의 논리적인 버그를 찾아냄. 이에 libtraceevent 메인테이너에게 문제를 보고하고 패치파일을 전달함.
메일링: https://lkml.org/lkml/2019/10/18/1252
Seems that the value returned by eval_type_str() were always unsigned, and
never signed extended. Luckily, looking at all the trace events that
actually have a signed value seldom (if ever) are negative, so this bug
never showed its face, and if it has, nobody noticed it.
Converted the sign variable to boolean while at it.
Link: http://lkml.kernel.org/r/[email protected]
Fixes: f7d82350e597d ("tools/events: Add files to create libtraceevent.a")
Reported-by: GwanYeong Kim <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
---
tools/lib/traceevent/event-parse.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index d948475585ce..2b20063813ac 100644
--- a/tools/lib/traceevent/event-parse.c+++ b/tools/lib/traceevent/event-parse.c@@ -2217,7 +2217,7 @@ static char *arg_eval (struct tep_print_arg *arg);
static unsigned long long
eval_type_str(unsigned long long val, const char *type, int pointer)
{
- int sign = 0;+ bool sign = true;
char *ref;
int len;
@@ -2277,7 +2277,7 @@ eval_type_str(unsigned long long val, const char *type, int pointer)
return (unsigned long long)(int)val & 0xffffffff;
if (strncmp(type, "unsigned ", 9) == 0) {
- sign = 0;+ sign = false;
type += 9;
}
--
2.20.1
작년에도 컨트리뷰톤을 통해 많은것들을 배울 수 있었다. 그래서 올해 컨트리뷰톤에 동일한 프로젝트에 참가하였고 작년과 다른 관점에서 코드레벨 버그 패치뿐만 아니라 기능추가, 문서번역, 버그레포팅, 의견제시, 커널기여 등 다양한 영역에서 활동하여 많은 것들을 배울 수 있었다.
특히나 이번 기회를 통해 처음으로 커널에도 컨트리뷰션을 할 수 있었고 매우 값진 경험이었다.
The text was updated successfully, but these errors were encountered:
학습내용
활동내역
1. 기능추가
문제설명: uftrace report 기능에서 csv 형태의 출력을 지원하지 않음.
대응방안: csv 형태로 출력할 수 있게 함수 생성
Fix commit:
namhyung@7517bff
namhyung@b84fa39
Fix issue: Support CSV format report command output namhyung/uftrace#874
2. 버그수정
Memory leak
PR uftrace : fix memory leak namhyung/uftrace#859
문제설명: opt_add_string(), asprintf(), copy_info_str() 함수를 사용 후 메모리를 해제하지 않아서 발생한 문제
대응방안: 사용한 메모리에 대해 free를 추가하여 메모리 해제 진행
Fix commit:
namhyung@64bcc30
namhyung@927b057
namhyung@43c9488
Fix issue: memory leak report from lsan namhyung/uftrace#804
PR report: Fix memory leak in print_and_delete() namhyung/uftrace#863
문제설명: find_or_create_node() 함수를 사용 후 메모리를 해제하지 않아서 발생한 문제
대응방안: 사용한 메모리에 대해 free를 추가하여 메모리 해제 진행
Fix commit:
namhyung@8efa01d
Fix issue: Issue no (Direct PR)
Null Pointer Dereference
문제설명: info 파일에 taskinfo:tids가 손상된 경우에 Null Pointer Dereference 문제가 발생함.
대응방안: NULL 체크 로직 코드 추가
Fix commit:
gy741@bee6570
Fix issue: Null Pointer Dereference in setup_task_filter() namhyung/uftrace#882
Code Refactoring / code style
PR plthook: Remove dead code in find_got namhyung/uftrace#942
문제설명: libmcount/plthook.c:246 소스코드에 존재하는 조건문은 항상 참으로 조건문이 재기능을 하지 못하는 문제임.
대응방안: 문제를 해결하기 위해서 불필요한 조건문을 삭제함.
Fix commit:
namhyung@23a79c3
PR uftrace: Fix fread() error handling namhyung/uftrace#966
문제설명: fread() 함수를 사용할 떄, 잘못된 조건문식을 사용하여 조건식이 항상 실패하는 케이스를 발견함
대응방안: 조건문을 변경하여 실제 사이즈가 아닌경우 에러 처리하도록 변경
Fix commit:
namhyung@e5ec126
Fix issue: incorrectly checks fread() retval namhyung/uftrace#952
추가문제: 병합된 commit 에서 크리티컬한 이슈(uftrace 정상 동작 불가능)한 영향을 끼침. 다른 컨트리뷰터가 이 문제를 찾아 다시 재 패치를 진행함.
교훈: 코드 수정 -> 테스트 -> 테스트를 통해 혹시나 변경된 코드가 전체적인 프로그램에 문제가 가지 않도록 확인해야 한다는 교훈을 얻었음.
PR replay: Fix white space namhyung/uftrace#962 , PR uftrace: Fix white space namhyung/uftrace#971
문제설명: uftrace는 커널 코드 스타일을 따르고 있음. 이에 맞게 공백들을 탭으로 전환할 필요가 있음.
대응방안: 공백으로 되어 있는 부분을 찾아 탭으로 수정
Fix commit:
namhyung@980e92b
namhyung@d798a67
compiler error
문제설명: uftrace를 특정 gcc 구버전(5,6) 에서 빌드를 시도하면
warning: dereferencing type-punned pointer will break strict-aliasing rules
메세지가 출력되는 문제가 있음.대응방안: union 공용체를 사용하여 문제 해결.
Fix commit: No commit. Currently communicating.
3. 버그 레포팅
Memory leak
문제설명: tui 명령어를 실행한 이후 q 옵션을 이용해서 종료하면 메모리 누출이 발생함.
Overflow
Issue stack-buffer overflow in read_task_txt_file() namhyung/uftrace#903
문제설명: sscanf() 함수를 사용할 떄 크기를 제한하지 않아 스택 오버플로우 문제가 발생함.
Issue heap-buffer overflow in read_taskinfo() namhyung/uftrace#938
문제설명: info 파일에 있는 "taskinfo:tids " 필드에 "," 문자를 다량으로 주입할 경우 힙오버플로우 문제가 발생함.
Issue heap buffer overflow in fstack_account_time() namhyung/uftrace#997
문제설명: number.dat 파일을 무작위하게 변경하여
uftrace dump
명령어를 실행할 경우 힙오버플로우 문제가 발생함.4. 오타수정
PR uftrace: Fix a typo in comment namhyung/uftrace#872
문제설명: 소스코드 주석에서 오타 발견함.
대응방안: 오타수정
Fix commit:
namhyung@5f051a4
Fix issue: Issue no (Direct PR)
PR mcount: Fix a typo in comment namhyung/uftrace#916
문제설명: 소스코드 주석에서 오타 발견함.
대응방안: 오타수정
Fix commit:
namhyung@091f63f
Fix issue: Issue no (Direct PR)
5. 문서 번역
PR doc: Add Korean language translation for recv namhyung/uftrace#917
설명: uftrace recv 명령에 대한 한국 매뉴얼 생성
Fix commit:
namhyung@48f56f2
PR doc: Add Korean language translation for graph namhyung/uftrace#969
설명: uftrace graph 명령에 대한 한국 매뉴얼 생성
Fix commit:
namhyung@4c08ca9
6. 위키 (사용자 케이스 추가)
yara : https://github.com/namhyung/uftrace/wiki/uftrace-for-yara
cURL: https://github.com/namhyung/uftrace/wiki/uftrace-for-cURL
Apache HTTP Server: https://github.com/namhyung/uftrace/wiki/uftrace-for-Apache-HTTP-Server
Squid: https://github.com/namhyung/uftrace/wiki/uftrace-for-Squid
TCPDUMP: https://github.com/namhyung/uftrace/wiki/uftrace-for-TCPDUMP
Libav: https://github.com/namhyung/uftrace/wiki/uftrace-for-Libav
Wireshark: https://github.com/namhyung/uftrace/wiki/uftrace-for-Wireshark
7. 커널패치
설명: uftrace가 의존하고 있는 libtraceevent 소스코드에서 조건문의 논리적인 버그를 찾아냄. 이에 libtraceevent 메인테이너에게 문제를 보고하고 패치파일을 전달함.
메일링: https://lkml.org/lkml/2019/10/18/1252
설명: uftrace에서 발견된 fread() 함수 사용 문제를 커널 소스코드에서 똑같이 발견함. 커널패치를 생성하여 담당자에게 커널패치 전달
메일링: https://www.spinics.net/lists/linux-usb/msg186609.html
7. 의견
설명: uftrace 활성화 및 홍보를 위하여 10월 한달간 hacktoberfest 라벨을 추가하도록 의견을 제시함.
: hacktoberfest : hacktoberfest는 10월간 오픈소스 컨트리뷰션 활성화를 위해 매년 10월에 열리는 대표적인 글로벌 오픈소스 컨트리뷰션 행사임.
설명: uftrace는 현재 정적 라이브러리 형태로 빌드를 지원하지 않아, 이를 지원할 수 있도록 의견을 제시함
8. 시도중이던 내용
uftrace에서 효과적으로 버그를 찾기 위하여, libfuzzer를 이용하여 테스트 케이스를 제작하였음.
이러한 시도가 성공적으로 완료될 경우 google ossfuzz에 병합시켜 google 인프라를 사용하여 버그를 효과적으로 찾을 수 있음.
9. 후기
작년에도 컨트리뷰톤을 통해 많은것들을 배울 수 있었다. 그래서 올해 컨트리뷰톤에 동일한 프로젝트에 참가하였고 작년과 다른 관점에서 코드레벨 버그 패치뿐만 아니라 기능추가, 문서번역, 버그레포팅, 의견제시, 커널기여 등 다양한 영역에서 활동하여 많은 것들을 배울 수 있었다.
특히나 이번 기회를 통해 처음으로 커널에도 컨트리뷰션을 할 수 있었고 매우 값진 경험이었다.
The text was updated successfully, but these errors were encountered: