Questions tagged [segmentation]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

Segmentation Fault Is Ruining My Friday

I have been working on PS3 Runoff for quite sometime, and after troubleshooting gazillion errors, segmentation fault came up to rain on my parade. Here's my code as I have no clue what's causing it. ...
0 votes
1 answer
44 views

pset5 speller all words are spelled wrong

new error: most words are seen as spelling error Here's my full code: (UPDATED) // Implements a dictionary's functionality #include <stdbool.h> #include <string.h> #include <stdio.h>...
1 vote
3 answers
74 views

Segmentation error on pset2 substitution

I'm trying to work on "substitution" problem set, but I'm getting an error of "Segmentation Fault" when I run the program below: In this part of the program I just want to check if ...
0 votes
1 answer
28 views

pset4 recover Segmentation Fault jpg000

Please can someone explain why I get a segmentation fault? The code below works for check50 but ideally I'd like to use the function write_header to write the first file. #include <stdio.h> #...
8 votes
3 answers
2k views

Do YOU know how to find a seg fault?? Advice to new programmers

I have noticed a rash of questions lately that are essentially this: "My code has a segmentation fault. The code compiles, many tests pass, but I can't figure out the problem!" If this is ...
  • 66.7k
0 votes
1 answer
169 views

Pset4 Recover conceptually struggling

Pset4 Recover is different since it uses files; fopen, fcloser, fprintf, and fread. It adds a whole new dimension to the coding. Its change from just formatting conceptions to making sure all the ...
0 votes
1 answer
600 views

Segmentation fault in caesar

I am returning a segmentation fault with this code. The argc portion of the code is function correctly if i enter too many arguments returning "1". If the correct number of arguments are entered I ...
0 votes
1 answer
52 views

Speller seg faults in unload function

I've tried to fiddle around with my unload function for a while and don't understand why I'm getting a seg fault. It seems that the unload function is running through completely at least once, but ...
0 votes
1 answer
84 views

cs50 Recover -- Segmentation fault and too many jpegs

I'm stuck with the debugging the below code. I keep getting way too many jpg files written and a segmentation fault. Thanks in advance for the help. I'm new to programming and this one is kicking ...
  • 3
0 votes
1 answer
107 views

pset3/resize - segmentation fault

I'm getting a segmentation fault and tbh have no idea why. I run valgrind and it all seems good, no memory leak. If I run debug50 the code just switches off halfway through execution on line 43 giving ...
  • 3
0 votes
1 answer
468 views

Pset2 (Caesar). Runtime error: load of null pointer of type 'char'

Problem with segmentation. I can compile the program, but can't run. Questions about segmentation fault were asked many times, but I still don't know. I think problem with command-line argument — I ...
0 votes
2 answers
122 views

Segmentation fault in recover pset4

I am working on recover in problem set 4. However, after trying out different stuff, the code itself compiles but I get a segmentation fault and the outcome is only one jpg file called 000.jpg. I am ...
0 votes
1 answer
233 views

segmentation fault in pset3, don't understand why

here's the code: // Helper functions for music #include <cs50.h> #include <stdlib.h> #include<stdio.h> #include<string.h> #include "helpers.h" #include <math.h> #...
  • 7
0 votes
1 answer
21 views

Segmentation Fault in Vigenere

Goodmorning, My program compiles, but when I try to run it with only the name of the program 'vigenere', I get this. "vigenere.c:12:23: runtime error: load of null pointer of type 'char' ...
  • 1
0 votes
1 answer
52 views

[Pset 5 Speller][Load] Segmentation Error

I posted this to the CS50 Subreddit with no help, so i thought i'd post here and try to get some help. My load function is not working, and keeps producing a segmentation error at (hashtable[index]->...
0 votes
1 answer
78 views

pset5 can't figure out what's wrong! segmentation fault

I have no idea what I am doing wrong in this pset! I feel very lost. Anybody have any pointers on where to even begin with what I'm doing wrong? Some specifics -- I am getting a segmentation fault ...
0 votes
1 answer
136 views

cs50 pset 5 SPELLER load help segmentation fault

Hi all I was wonder if anyone can give me some advice on fixing my segmentation fault? I'm not sure why it is giving me a segmentation fault could it be I malloced my char* word with too much memory? ...
0 votes
2 answers
109 views

Problem with incrementing recover.c

The variable count stops incrementing at 1 and I don't know why. #include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int main(int argc, char* argv[]) ...
0 votes
1 answer
17 views

Segmentation fault and correct answer being returned (pset.2)

this question has been asked in different ways, but hasn't been answered I think for the way I wrote my code. #include <cs50.h> #include <stdio.h> #include <string.h> #include <...
0 votes
2 answers
64 views

Segmentation fault in pset2 initials

Why I am getting like this when i run my code ~/workspace/ $ make initials clang -fsanitize=integer -fsanitize=undefined -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wshadow ...
  • 264
0 votes
1 answer
61 views

Writing a word puzzle solver and having a problem with freeing heap memory. Would really appreciate some help!

I am having some trouble with heap memory. I am writing some code to solve word puzzles - (from a game called Countdown here in the UK). The game is that you are given 9 letters and the goal is to ...