Questions tagged [segfault]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
16 views

Segmentation fault with overwriting chars

I tried overwriting cipupperalphabet[j] from a A to a B, but it has caused a segmentation fault. string upperalphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string cipupperalphabet = upperalphabet; int j = ...
0
votes
1answer
50 views

PSET 5 Unload Segmentation Fault

I've been stuck on this problem set for a while now. Valgrind is telling me I have a problem in my unload function, which is "Conditional jump or move depends on uninitialised value(s)". I can't find ...
0
votes
1answer
22 views

Pset5 Seg fault speller

I´ve been stuck in pset5 for a little while. I was wondering if someone would be able to take a loot at it? Fow now all my hash function does is look at the first letter of a word. I will of course ...
0
votes
0answers
37 views

Pset4 Recover segmentation error

Help needed with recover part of pset4. Please find my code below. It compiles but produces a seg fault. Any comments are welcome. Thanks in advance. #include <stdio.h> #include <stdlib.h&...
1
vote
2answers
109 views

CS50 PSET4 RECOVER.C SEGMENTATION FAULT PLEASE HELP!

I'm seriously struggling with this assignment and I can't seem to find the problem in my code. I'm supposed to create a program that reads a raw card one block at a time with each block containing ...
5
votes
0answers
267 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 you, then ...
0
votes
1answer
82 views

Pset 5 Speller Segmentation Fault

Seg-faults seem to be the bane of my existence. I've tried running valgrind and using printf functions to find the line(s) of code that are causing the seg-fault in my implementation of speller, but ...
0
votes
1answer
28 views

Pset5 Trie Segmentation fault

Have been trying to debug this for days and eventually came down to the following problem: When running an example test(lalaland.txt) the misspelled words are fine up until the program abruptly stops(...
0
votes
2answers
118 views

Cant create linked list node

For speller (hash table implementation) i keep getting a segfault that is coming from the line in this code where i set node->next = NULL struct node* createNode(char word[]) { node *node = ...
0
votes
1answer
32 views

Segfault error in initials program

//when ever it calls the hasLast function with only one name entered as an input it crashes with a seg fault for the initials more problem #include <stdio.h> #include <string.h> #include &...
0
votes
1answer
72 views

PSET5: load fails with large dictionary, but works with small dictionary - trie

I'm trying to use a trie structure to implement the load function in speller. I get a segmentation fault with the large dictionary, but not the small one. Text file size does not seem to matter, (I ...
0
votes
1answer
78 views

Pset5: load hashtable - constantly giving seg fault

I'm trying to load my dictionary into memory in order to program my spellchecker. While compiling "speller.c" works fine, my execution ./speller returns a seg fault and I just can't seem to get the ...
0
votes
1answer
375 views

SEGMENTATION FAULT : Week 4- shorts-Recursion - Collatz conjecture

I can't understand why my program is facing a segmentation fault. I decided to make my own program which counts the number of steps used in Collatz Conjecture(as discussed in week 4). The picture ...
0
votes
1answer
30 views

No errors while loading small dict, but segfault when loading large one. Pset5 Speller

Getting a segfault after about 75 words added to the dictionary. #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include "dictionary.h" typedef struct node { ...
0
votes
1answer
87 views

PSET5: Hash function and code not handling possessives and substrings

I am having a lot of problems with pset5. I have identified more than one issue with the code but I don’t know how to fix the issues. The first is from my hash function, which is featured below and I ...
1
vote
2answers
129 views

Crack: Segfault on CS50 appliance/ IDE/ CS50.io but fine on my computer

I'm trying to make PSET2 crack, however in online IDE I got segmentation fault. I tried same thing on my local computer and it works fine. What's wrong? Pls ignore the fact that code is ugly etc. ...
0
votes
1answer
55 views

PSET6 Load - Check50 Server2 Errors

Check50 Server2 failed multiple tests, and someone pointed out that these issues can stem from load(). I've looked over my load code and I've looked at other questions on SE but I can't find anything ...
0
votes
1answer
150 views

CS50 pset5 unload trie segmentation fault

I am having problems with implementing unload. load works perfectly and I can use the check function. I have tried many ways of changing my code but it only creates an infinite loop and I have no idea ...
2
votes
1answer
85 views

PSET5 Speller / Dictionary - Seg Fault and Incorrect Check

"debug50 ./speller texts/alice.txt" doesn't return a segfault. It runs to completion. But "./speller texts/alice.txt" returns a segfault. Can I PM someone my code to take a look at? Why would running ...
0
votes
1answer
95 views

Segmentation fault..Please Help

can anyone have a look at my code, find the problem and suggest improvements. im getting segmentation fault after calling 'check' function. typedef struct trie { bool word; struct trie* link[27];...
0
votes
0answers
29 views

I am blind. Can't find my error :(

I am trying to setup a server that can save some messages sent from a client. I took apart some code given in an example i found here. This is where I am now. Ive tried to change some stuff here ...
0
votes
1answer
60 views

Pset6 Server seg fault in load and main (because of parse)

Server is functional and gives the correct output using the curl requests individually. However, using gdb, if I use curl to request hello.html after I've requested cat.html (specifically), I get a ...
0
votes
1answer
128 views

Pset4, Recover, GDB on fread gives an “Coud not open file” error and segfault

I have been getting segmentation fault on my code, when i try to debug it, it gives me this error: Error opening file Could not open file: /build/buildd/eglibc-2.19/libio/iofread.c The file could not ...
0
votes
1answer
344 views

pset5 Segmentation fault

I've been getting a seg fault in load on this line: buckets[hash_num] = buffer_node;. I have read most if not all the posts on seg faults in load, and can't seem to figure mine out. At first I ...
0
votes
1answer
77 views

Help with seg fault in pset5 speller

My speller seg faults at the space following the first word in whatever input text I use. Here is the gdb output for austinpowers.txt with the segfault just after reading the word AUSTIN: 107 ...
0
votes
1answer
105 views

My code will only print 23 jpg's which are unreadable, I have been stuck a long time already, xxd'd the jpg's and everything seems to be fine

/** * recover.c * * Computer Science 50 * Problem Set 4 * * Recovers JPEGs from a forensic image. */ #include <stdio.h> #include <stdint.h> #include <cs50.h> typedef uint8_t ...
0
votes
1answer
230 views

pset5 segfault in unload

FINAL EDIT My function that frees the memory works properly; the problem lies in node creation. I now have a separate problem where the program segfaults when run normally, but it cannot be ...
0
votes
2answers
155 views

Segfault in pset5 in load

My implementation of load uses a trie and when I attempt to access the bool is_word I get a segfault. Can you guys help me out? Any suggestions on how to improve my code would be amazing. Thanks ...
0
votes
1answer
80 views

pset6 server giving segfault

When I add the below two blocks I get a segfault when I submit a request from telnet. Actually, I can add just the first and things run fine but upon the second (or even moving the first up above ...
1
vote
1answer
212 views

pset5 load function segfault do not show in gdb

I cannot figure what's wrong with the code, it gives me a segfault, but runs in valgrind and in gdb. So far, i only wrote the load function, so anything else is still empty. #include <stdbool....
0
votes
2answers
1k views

Pset5 Speller - segmentation fault is driving me crazy!

Hey guys! I have been working on pset5 for a while and I keep on obtaining a seg fault. I have alreay run valgrind but it gives me no error. I cannot really see where is the problem. Any help will be ...
1
vote
1answer
629 views

pset5 speller.c with hashtable errors and seg fault

this is my code so far for pset5. I would appreciate giving me hints about my erros. I also get a segmentation fault. thanks. when I implemented load and check only, it seemed to load the text and ...
0
votes
1answer
109 views

pset4 recover.c sge fault cant find first jpg signature

Here is my code. I keep getting a segmentation fault while iterating over beginning of bufferArray[512] looking for the first jpg signature. Please help! I cant see what i've done wrong. Im trying to ...
0
votes
2answers
89 views

Vigenere code has Segmentation error

I've been working on the vigenere.c problem from pset2 and am struggling to find the error in my code currently because whenever I try to run it my code crashes. Clearly there is something wrong but I ...
0
votes
1answer
452 views

pset4 recover segfault: no such file/directory

My code seems to have trouble making the .jpg files in which to place the blocks of data. #include <stdio.h> #include <stdlib.h> #include <stdint.h> uint8_t buffer[512]; uint8_t ...
0
votes
1answer
6k views

How to iterate through an array using pointers

I managed to "solve this issue", but I don't know why I get the problem I get. Right after the last line I also got a segmentation fault, which I failed to include in the above screenshot. My ...
0
votes
1answer
69 views

segfaults and delayed printf commands while using GWindow in loop

printf("%c.\n", (getText(precrmo_menu[3]))[0]); char input[3]; input[0] = (getText(precrmo_menu[3]))[0]; printf("we lived"); if (strcmp(input, "") != 0 && !isblank(input) && ...
0
votes
1answer
80 views

Why does server.c's error function not malloc “phrase”?

The error function defines phrase as follows: const char* phrase = NULL; switch (code) { case 400: phrase = "Bad Request"; break; case 403: phrase = "Forbidden"; break; case 404: phrase = ...
5
votes
1answer
687 views

Is something wrong with getType(object)?

For pset4, in this code(in main, to check collision of ball and anything else): GObject object = detectCollision(window, ball); if (strcmp(getType(object), "GRect") == 0) { ...
0
votes
1answer
3k views

Speller Unload Trie with Recursion

node* root; bool unload(void) { freenodes(root); return true; } freenodes function(node* path) { loop over all nodes { if node is not null (path -> children[i]) ...
0
votes
1answer
225 views

Segfault Pset6 Check()

I receive a segfault at this line of code if (pathCheck -> children[charVal] == NULL) { return false; } pseudocode buildup: initialise pathCheck to NULL while character is ...
0
votes
1answer
2k views

Why do I get a segmentation fault when writing to a string?

The following code receives seg fault on line 2: char *str = "string"; str[0] = 'z'; printf("%s", str); While this works perfectly well: char str[] = "string"; str[0] = 'z'; printf("%s", str); ...
1
vote
2answers
2k views

GetString() giving me a segfault in C

I am running a program in C using a GetString function (not from the CS50 library). When I run the program I get a segmentation fault error. In GDB, when I backtrace it tells me: Program received ...