segmentation fault

../images/Emo188.gifsegmentation fault../images/Emo188.gif

מה זה בדיוק segmentation fault. ראיתי כמה הגדרות באינטרנט אבל א הבנתי מה זה בדיוק ומתי זה קורה. אשמח אם תוכלו לעזור לי.
 

ahab

New member
ישירות מגוגל...

A segmentation fault occurs when your program tries to access memory locations that haven't been allocated for the program's use. An error in which a running program attempts to access memory not allocated to it and core dumps with a segmentation violation error. This is often caused by improper usage of pointers in the source code, dereferencing a null pointer, or (in C) inadvertently using a non-pointer variable as a pointer.​
או בקיצור, נסיון גישה לזכרון שלא הוקצה עבור התוכנית ע"י מערכת ההפעלה.
 
../images/Emo136.gif...core dumps with a

ראשית, תודה על העזרה. את הטקסט הזה כבר מצאתי בגוגל בעצמי אבל אני לא מבין למה הכוונה ב: core dumps with a segmentation violation למה הכוונה בcore dumps?
 

melatonin

New member
ושוב, גוגל

A core dump is a file containing the contents of memory at the time a program or computer crashed. It can be loaded into a debugger to get some idea of what the program was trying to do when it crashed.​
 

voguemaster

New member
הסבר קצרצר

כשתוכנית מנסה לגשת לזיכרון לא שלה או שלא ממופה לה היא מקבלת segmentation fault, או בשמו המוכר SIGSEGV. זה סיגנל שהקרנל שולח לתוכנית ממש לפני שהוא סוגר אותה. כשתוכנית לא מתנהגת יפה כמו במצב כזה המערכת סוגרת אותה וזה הסיגנל שהיא מקבלת לפני הסגירה. אי אפשר לבצע MASK לסיגנל הזה ובמקסימום אפשר לבצע פעולות של לפני סגירה. עכשיו, כל עוד למשתמש שהריץ את התוכנית מוגדר שהוא יכול לקבל core dumps המערכת לא רק תסגור את התוכנית אלא גם תיצור core dump. זהו קובץ שמכיל את תמונת הזיכרון והריצה של התוכנית בזמן שהיא ביצעה את הפעולה הבלתי חוקית שגרמה לה להיסגר. בד"כ אפשר אח"כ לנתח את המידע עם debugger כמו gdb ולראות מה גרם לזה.
 
למעלה