Questions tagged [segmentation-fault]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
11 views

pset5 - seg fault when using large dictionaries or texts

I've been stuck on speller for a few days now, and recently I've gotten the program to completely pass check50. However, when I try to run it manually on my own, I find that the program works fine ...
Edward's user avatar
  • 3
-1 votes
1 answer
65 views

CS50 Pset 4 edges: Why do I keep getting segmentation fault?

Please help me figure out what's wrong! I've been doing this pset for so long now, and I feel like everthing should work, But I just get a seg fault! The code looks like... void edges(int height, int ...
Harr's user avatar
  • 35
0 votes
0 answers
25 views

Merge Sort segmentation fault

I am trying to learn how to implement Merge Sort. With the code below, I keep getting a Segmentation Fault. Does anyone know why? Thanks! // 6/30/23: Segmentation fault (core dumped)?!?! #include <...
Joseph J Filoramo's user avatar
0 votes
1 answer
53 views

Speller Segmentation Fault Even After Freeing Malloc'd Nodes

The following is my code and, subsequently, the message Valgrind returns when I run it on ./speller texts/lalaland.txt. I explored similar issues previously posted on Stack exchange, and added lines ...
Hamster1303's user avatar
0 votes
1 answer
56 views

Pset 5: Speller - Double free or corruption (fasttop) error

Having to post a new question as the I reworked my code and space restrictions won't allow me to post it in the original thread. I changed my code based on @CliffB 's suggestion. However, now I am ...
Soumik's user avatar
  • 15
0 votes
1 answer
105 views

Pset 5: Segmentation fault in load function

I am not able to figure out what is causing the segmentation fault in my load function. Valgrind is pointing to fread and the lines where I have 'malloc'-ed memory, but more importantly to the line ...
Soumik's user avatar
  • 15
0 votes
1 answer
23 views

pset5 segmentation faoult

Good morning, I have segmentation fault on my dictionary.c code, I was trying to find a Typ0 mistake or variable declaration mistake but I can not find anyone. Also I can not find logic errors, so I ...
Victor Araya's user avatar
0 votes
1 answer
20 views

Pset5 Speller - trying to understand more about segmentation fault

I tested a piece of code to figure out what's causing the segmentation fault with the 'load' function. The code below opens the large dictionary. Then it scans and prints each string inside the ...
Soumik's user avatar
  • 15
0 votes
1 answer
23 views

PSET4 Recover - Why do I get Segmentation Error from Check50

my recover program compiles fine. When I run the program, I do not get any errors. When I look at the 50 outfiles, I can see the pictures with the image preview. Valgrind indicates that there are no ...
Zach's user avatar
  • 1
0 votes
1 answer
34 views

Pset5 speller segmentation fault when loading

When I run speller, I get a segmentation fault. I have played around with the code a little bit and nothing so far has changed. Using help50, this is the result I got: Looks like you're trying to ...
Team's user avatar
  • 5
0 votes
1 answer
52 views

Segfault while declaring 2d array in filter-more's edges function. Probably a lack of memory?

At the very start of the edges function i try to declare an array to hold the image with black borders (now the first comment), but as i've discovered using printfs, it causes a segfault. I searched ...
Decowry's user avatar
0 votes
1 answer
133 views

CS50 pset4 recover Segmentation fault (core dumped) problem

I have already solved 2 errors from valgrind but cant solve the last 2 segmentation fault. Also how can i read the valgrind output efficiently. I just got lost between the text. Thanks beforehand! #...
Follang's user avatar
0 votes
0 answers
32 views

(pset5)I get a segmentation foult, even though check50 says that everything is allright

as per the title — I get a segfoult and can't check my times, even though check50 claims that the code is practically ready to submit. Here's my code, followed by valgrind results: // Implements a ...
Two-FaceFIL's user avatar
0 votes
1 answer
49 views

PSET4 Recover segmentation fault

Good afternoon/morning, I'm having problem with Problem set 4 Recover, My code can compile but Segmentation fault (core dumped) keeps going out, I checked on debug50 and it seems the segfault occurs ...
Eva Chen's user avatar
0 votes
1 answer
18 views

Segmentation fault in pset4 recover when reading file

I tried solving recover.c. But when I tried to run it (without valgrind), I got segmentation fault. When I ran it again with valgrind, it told me that the culprit is in line 40, where I read the file ...
IgorArnaut's user avatar
0 votes
1 answer
74 views

Getting segmentation fault when running speller.c

I am trying to solve speller and I always get segmentation fault every time I run it. I checked the error on valgrind and it told me that the culprit is in line 108, where I allocate a new node. How ...
IgorArnaut's user avatar
0 votes
1 answer
46 views

pset2 substitution, segmentation fault

So my code for pset2 Substitution works about 99% correctly. When I ran check50, I realized that there is still an issue if the user does not type the key right after the program name at the command ...
Joseph J Filoramo's user avatar
0 votes
1 answer
39 views

segmentation fault from pointers

i keep getting segmentation fault when running this code. using printf i can see its from loading ala and the hashtable to store this is set to nil. other words when the hashtable to store them is nil ...
yosef's user avatar
  • 5
0 votes
1 answer
42 views

segmentation fault with node pointers on speller

I know which line has the segmentation fault , if (table[hashn]->next == NULL) In this case hashn is 0 so its not exceeding the array Any ideas why its happening?
Leo8479500282664829200's user avatar
0 votes
1 answer
169 views

filter-less, reflection, segmentation fault, core dumped, PSET4

dear Friends of CS50X, I have been working on pset4, filter-less, reflection for several hours now. I think my code does what it is supposed to do. Also, in my solution I tried to use the concepts ...
Alvaro Barboza's user avatar
0 votes
1 answer
102 views

CS50 PSET 4 RECOVER WORKING BUT NOT PASSING CS50 - SEGMENTATION FAULT

This is for CS50 PSET 4 recover. I am struggling with identifying the segmentation fault that check50 shows. Upon running, it seems to generate the 50 images correctly without error, and valgrind does ...
jgoteam's user avatar
0 votes
1 answer
24 views

PSet3 Plurality - Segmentation Fault when exiting main

My code seems to function properly until I try to exit main. At this point it reports a segmentation fault. This only occurs when there is a tie. Here is my code: #include <stdio.h> #include <...
Thomas Gallaher's user avatar
0 votes
1 answer
125 views

readability, cs50 segmentation fault, core dump

Hi, I'm having trouble with this. Is there something wrong with my code line or should i just redo everything? #include <cs50.h> #include <stdio.h> #include <ctype.h> #include <...
Phạm Tú's user avatar
0 votes
1 answer
102 views

pset4 recover error segmentation fault

Can i please get some help with my recover code? i have rewritten it so many times but i still get a segmentation fault i even unmalloc'd a few things but to no avail // recovers deleted images #...
jeddah's user avatar
  • 5
0 votes
1 answer
216 views

pset 2 Segmentation fault (core dumped)

Here is my program caesar, pset 2. I don't know where it is going wrong. whenever I run it with input, Segmentation fault (core dumped) error appears on terminal. how to fix this? #include <stdio.h&...
user35553's user avatar
0 votes
1 answer
42 views

CS50 pset2 substitution: Segmentation fault in some of "This is CS50" tests

I'm doing Substitution in pset2. My checking result shows that my program has segmentation fault for the last two "This is CS50" tests, as is shown in the pic: Can somebody tell me why, and ...
Astrophel's user avatar
0 votes
2 answers
274 views

Segmentation Fault on lab5 Inheritance

I'm trying to do lab5 inheritance. The code compiles and prints the correct output but ends with "Segmentation fault (core dumped)" debug50 shows a segfault on line 86: free_family(p->...
Tybirk's user avatar
  • 1
0 votes
1 answer
24 views

substitution question segmentation fault issue

I am doing the substitution question and I keep running into this segmentation fault issue but i do not understand what exactly is causing the memory access issue. once j=4, the memory fails to be ...
Damien Lim's user avatar
0 votes
1 answer
117 views

Pset 5 speller: segmentation fault for large dictionary

I can't figure out what I am doing wrong, have gone through many questions and walkthroughs of this problem and it still looks like it should be correct. It obviously is not! With a small and medium ...
пaean's user avatar
  • 5
0 votes
1 answer
23 views

I have a segmentation fault in Lab5, about free_family function

// Free `p` and all ancestors of `p`. void free_family(person *p) { while (p != NULL) { free_family(p->parents[0]); free_family(p->parents[1]); free(p); } ...
fried fish's user avatar
0 votes
1 answer
89 views

Caesar problem. Keep getting error of segmentation

The follow part of code worked perfectly, while I declared variables key_num and plaintext within if{}, but since I declared them outside (cause I need to use these vars later) I get the "...
Igor Roytman's user avatar
0 votes
2 answers
44 views

Caeser Pset2: Segmentation Fault

#include <stdio.h> #include <math.h> #include <string.h> #include <ctype.h> #include <cs50.h> #include <stdlib.h> int main(int argc, char **argv) { if ((int)...
aksharrastogi's user avatar
0 votes
1 answer
95 views

CS50 PSET4 recover Segmentation Fault

Can someone point out why this code is resulting in segmentation fault? It's a code for the 'recover' question in pset4, cs50. #include <stdio.h> #include <stdlib.h> #include <stdint.h&...
Eyvie's user avatar
  • 3
0 votes
1 answer
40 views

Speller still isn't running correctly

I rectified the earlier error in my code (putting dictionary within inverted commas). I also corrected my error in unload where the function would always return false instead of true. However, I ...
Hamster1303's user avatar
0 votes
1 answer
109 views

Segmentation Fault for PSet1 Credit in CS50

first time posting. I swear I looked for answers in other segmentation fault questions already, but I am new to programming and to troubleshooting/researching effectively. My PSet1 program "...
oms_CS50's user avatar
1 vote
1 answer
57 views

Recover - segmentation fault and other general problems

Hey guys so I've hit a bit of a wall with Recover, when I run my program I get segmentation fault but I also don't know how to end off one jpeg when another header pops up? In essence, I'm not sure ...
PrimeBeat's user avatar
  • 137
0 votes
1 answer
1k views

Inserting node in linked list

I'm attempting to create a linked list in C to practice the concepts of pointers and data structures. I keep running into a segmentation fault and I've narrowed down the issue to my insertNode() ...
docnocturnal's user avatar
0 votes
2 answers
133 views

PSET5 speller segmentation fault

Can anyone help with segmentation fault. I have tried running debug50 and aparently the fault hits at line "if (head -> next != NULL)" in the load function. Aparently "table" is ...
Steven George's user avatar
1 vote
2 answers
2k views

Segmentation Fault on Inheritance, Lab 5

I tried lab4 but I was having issues so I watched Brian's solution walkthrough. The code compiles and all goes well but when I run the program it shows a segmentation fault. debug50 shows a segfault ...
ehsansth's user avatar
0 votes
1 answer
44 views

pset 4 Recover: Segmentation Fault in If-else-statement

I am trying to solve why I get a segmentation fault in my code "recover". It's right at the end of the file. I solved the pset4 by trying different solutions. However, I don't understand why ...
user avatar
1 vote
3 answers
1k views

Pset4 recover segmentation fault when running

Finished the problem but when running check50 gets segmentantion faultand running ./recover card.raw . The error code is the following: :) recover.c exists. :) recover.c compiles. :) handles lack of ...
João Victor Schiavon's user avatar
0 votes
1 answer
331 views

Segmentation fault in blur filter

This is my code for the blur filter in the pset 4. First I used the average for the corner pixels, then I used a loop for the average of the first and last row and columns and then a nested loop for ...
guillermofd's user avatar
0 votes
2 answers
149 views

Caesar segmentation fault

I prematurely submitted my code without including the if() statements that check if the second command line argument was a digit (if not it would produce an error message). My code was running ...
laurens_noone's user avatar
0 votes
1 answer
111 views

pset2 substitution Cant figure out the segmentation fault

I've been trying to break it down into parts but I can't figure out why I keep having a segmentation fault. I've watched the lecture but I can't figure out where to put the breakpoint to find it. Im ...
frostyf33t's user avatar
0 votes
1 answer
343 views

PS4 Recover Segmentation Fault (Core Dumped)

Hope you got into the new year well and healthy! I get a segmentation fault (core dumped) if I want to run ./recover card.raw Anyone got any tips because I have checked it 100 times already. Valgrind ...
SirenLu's user avatar
  • 17
0 votes
1 answer
46 views

PSET2 Getting segmentation error

Hello so I am doing PSET 2 Caesar and I tried to write a function to tell me if argv[1] is not a integer I want it to print the error message from the assignment. The problem is I'm very new with ...
Dre Johnson's user avatar
0 votes
1 answer
42 views

Segmentation fault: Pset 2 Caeser isdigit

The log is telling me: "Segmentation fault", and after looking into it, I figured out the problem was in the "isdigit", but i don't know how to fix it, i'm here for about 2 hours ...
Raphael Schneider's user avatar
0 votes
1 answer
27 views

Program compiles and produces required output in caesar from CS50 but segmentation fault due to lack of memory. What to do next?

My program compiles and produces the required ciphertext in caesar problem but when the input has too many characters, I get a segmentation fault after a specific number of ciphertext characters are ...
Sanidhya Vijay's user avatar
0 votes
1 answer
110 views

:( handles lack of key failed to execute program due to segmentation fault

The following piece of code I've written for pset2/caesar produces a "segmentation error" when there is a lack of key (when no command-line argument is provided). I don't know which line or ...
Upanshu Lakhani's user avatar
0 votes
1 answer
29 views

Why is it that I keep getting segmentation fault? (Problem set 2 - Caesar)

#include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> #include <stdlib.h> int main(int argc, string argv[]) { if (argc != 2) { ...
Lim Yee Wee's user avatar

1
2 3 4 5
8