Questions tagged [segmentation-fault]

Segmentation faults occur when accessing memory which does not belong to your process. Use this tag along with a tag indicating the language and a tag indicating the operating system. Segmentation faults are typically the result of a dereference operation with pointer variables (most often containing an invalid address) or a buffer overflow. The root cause for an invalid pointer value may be far from the location generating the segmentation fault.

segmentation-fault
Filter by
Sorted by
Tagged with
0 votes
0 answers
36 views

Segmentation fault when trying to printf() a char[] from a struct [duplicate]

I am about a week into my C journey so please bear with me if this is a very silly question. I've done a basic course in C but have come up to pointers, so I am trying to write a little something that ...
Stefan L McNamara's user avatar
1 vote
0 answers
320 views

Segmentation Fault in VSCode when Running very simple C++ Program with Vscode's cpptools extension

I decided to ask this question here first, before seeking to open an issue on vscode-cpptools Github repository. Because you know, it's probably on my end either way and may be a very silly issue that ...
Sky345's user avatar
  • 13
1 vote
2 answers
88 views

creating a stack using two queues in c, dequeue is not working

So I am creating a stack using two queues in C. And I am given enqueue, dequeue and printQueue. Unfortunately my dequeue for one of my queues is not working properly, below is what I have written thus ...
shinny.dogma's user avatar
1 vote
1 answer
58 views

Why does it result in a segmentation fault? (A program in C that counts occurrences of a word in the file)

countSH counts the number of occurrences of the word in the file depending on the first character of the line. I also have a function to get the user input. I wrote them separately and when I tested ...
SUPERoya's user avatar
0 votes
1 answer
56 views

Null condition not showing output

struct node *position(int key) { struct node *p1 = head; while (p1->info != key && p1 != NULL) { p1 = p1->link; } if (p1 == NULL) printf("...
Risher322's user avatar
1 vote
1 answer
67 views

When I use fread with a 34 mb .mp4 file I get a segmentation fault, how can I solve it?

I'm trying to write code that can reverse a file to make it unreadable. I did this in Python and I'm trying to do it again in C, but when I use fread to read a large file I get a segmentation fault (...
DEV's user avatar
  • 13
-3 votes
1 answer
64 views

Using strcmp gives me segmentation fault (cs50 runoff problem) [closed]

In the vote function i can't figure out why if i enter a different voter's name, it gives me a segmentation faul instead of returning false. bool vote(int voter, int rank, string name) { if (...
yhoo's user avatar
  • 1
1 vote
1 answer
94 views

Segmentation fault in C++ program that scans a directory

This is my program, but I'm getting "Segmentation fault" messages without any warnings when compiling. #include <string> #include <iostream> #include <dirent.h> #include &...
Борисюк Іван's user avatar
0 votes
0 answers
106 views

Segmentation fault in NASM X86 [duplicate]

assembly section .data playerLives: dd 5 gameOver: dd 0 timesReset: dd 0 playerY: dd 5 playerX: dd 5 playerScore: dd 0 section .text global _start global ...
user avatar
0 votes
1 answer
16 views

searching through a BST for a certain key, getting segmentation fault when that key doesnt exist

I'm searching through a binary search tree for a node with the specified info. Here's my code: void MovieCollection::showMovie(string movieName) { Movie *movie = showMovieHelper(root, movieName); ...
Wofster's user avatar
-1 votes
1 answer
40 views

please solve this error of mine of segmentation fault

I have this code it is compiling but it is giving segmentation fault and I aint able to solve it . my device is macbook air m1preview of my terminal showing error #include <alloca.h> #include &...
NoAppearance's user avatar
1 vote
1 answer
257 views

"Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)" In CLion

While trying to solve a coding problem today, I got tired of OnlineGDB not being able to support large input files, so I decided to pull out CLion and use that instead. However the result that I get ...
zrli's user avatar
  • 85
0 votes
0 answers
137 views

Using gdb gives error "Cannot insert breakpoint 1." "Cannot access memory at address 0x8001779"

I am working on a project in C, and I am running gdb for the first time, and I come into this problem when I try to set a breakpoint and it gives this error. COMMAND: Reading symbols from ./traffic... ...
Cindy_ l's user avatar
1 vote
1 answer
241 views

Flutter app segfault on startup (release mode only)

my app crashes (only in release mode) as soon as I start it. It seems to be a segfault (thanks to logcat, see attached logs) but i haven't touched to any of the native code so I'm not sure where could ...
Tiffaa's user avatar
  • 36
0 votes
0 answers
34 views

NASM Assembly segmentation fault when checking if a number is prime [duplicate]

I'm trying to check if the number that is in the eax register is prime. Unfortunately, I always get information that it is not, and also the error "Segmentation fault". I'm new to assembly ...
souvenir's user avatar
0 votes
1 answer
226 views

Python easyocr crashing python VM (doesn't weem to be related to opencv)

Good morning all!!! I've had trouble with easyocr in raspberry pi 4 running ubuntu 22.04LTS. All installed using pip (pip install torch, torchvision, opencv-python, opencv-contrib-python, easyocr). ...
Casimiro De Almeida Barreto's user avatar
0 votes
0 answers
111 views

Unity ECS: Segmentation fault when creating a large number of entities

I wrote a simple test program that creates 100 entities per frame, each entity has a buffer, as follows: void Execute(Entity projectileEntity, [ChunkIndexInQuery] int chunkIndex, ref LocalTransform ...
Kaihui Gao's user avatar
0 votes
0 answers
58 views

Getting segmentation error while copying mp4 file to shared memory using memcpy()

I am writing a code to share data using shared memory, for txt data my code is working but for mp4 files it is not working sender is not able to send data. EDIT: after changing buffer size as ...
human who is's user avatar
1 vote
0 answers
92 views

I keep getting a segfault anyone know why? In C

The problem seems to occur when qsort is called or if I add more than one monster then try to add a monster I have already added. Header File: #ifndef UTILS_H_ #define UTILS_H_ #define MAX_MONSTERS ...
xxi0's user avatar
  • 19
0 votes
1 answer
605 views

DuckDb - Reading parquet files from S3 - Handling Segmentation Fault Core Dump error

I receive 1000s of parquet files with same schema every day into a S3 bucket. I am using duckdb with python3 extension to read all the parquet files to subset data from them. The following is the ...
Apricot's user avatar
  • 2,991
1 vote
1 answer
91 views

Why capture this in cpp in lambda and get reference to data member cause segfault?

#include <functional> #include <string> #include <iostream> struct Info { std::string a{"abc"}; }; struct Handlers { std::function<const Info&()> ...
Harry Check's user avatar
0 votes
1 answer
80 views

C Seg Fault and Core Dump when trying to free pointer and close file

I am trying to read from a file to make a linked list of movies. At the end of the read file function when I try and free the line pointer and close the file I get a seg fault and core dump. Both the ...
Ahmed Zaidan's user avatar
0 votes
0 answers
74 views

Segmentation Fault on std::cout

I have the same problem as described in this question: Segmentation Fault on Hello World Program. I was using this tutorial: https://code.visualstudio.com/docs/cpp/config-mingw. $ g++ --version g++....
razenkovv's user avatar
-1 votes
1 answer
49 views

Segmentation fault problem with object lists

i'm doing a C++ project, a very simple video game. This game must have infinite levels, and every level has a random number of platforms. I created an object for platform, here the hpp: class platform ...
guerro's user avatar
  • 3
0 votes
1 answer
68 views

Getting the Windows command prompt to report an access violation

In Linux if I run an app from the terminal and there's a seg fault then I see an error message. But in Windows if I run a (command line) app in the command prompt and there's an access violation I get ...
John Rennie's user avatar
1 vote
1 answer
987 views

Flutter app is crashing in production due to a segmentation [duplicate]

When i download my App from my device it works. If I open it in Testflight its works. If someone else tries to start the App, it crashes instantly. The App runs in Flutter without any problems. Here ...
974 RP's user avatar
  • 11
2 votes
0 answers
51 views

How to call shared object function (loaded dynamically) from pointer in Go?

I try to call few shared object functions from Go. I don't want to write a C commented code to build a CGO interface for all functions. I write my shared object like that: #include <stdio.h> ...
MauriceLambert's user avatar
-1 votes
1 answer
55 views

Why Am I getting segmentation fault when my input exceeds 5?

so i've done the Hours practice problem in week 2 butt I'm getting the segmentation fault whenever the number I input(1st prompt) exceeds 5. #include <cs50.h> #include <stdio.h> int N = 0;...
Prince Justine Samson's user avatar
0 votes
0 answers
44 views

Why I am index error while writing a segmentation code using Unet?

Highlighted the part from where I am getting the error.Getting the error from resize_image_with_crop_or_pad class CreateDataset(data.Dataset): def __init__(self, ...
sccomp's user avatar
  • 7
0 votes
0 answers
70 views

Error 3221225477 - Fresh instaltion Visual studio Code

I having a problem with visual studio code, that i cant run C++ prorams. I'm just started studyding programing some weeks ago, and trying some IDE's. I can run C programs normally wit VSC, only C++ ...
Luiz Henrique's user avatar
0 votes
1 answer
78 views

Python3: c-type segfault from multithreaded C shared library

I've looked at other StackOverflow related questions and answers and followed the information given. I am still having trouble. Running Python3 on Linux which accesses a shared C library (.so). The C ...
user2205930's user avatar
  • 1,086
0 votes
1 answer
50 views

strcpy() giving me Segmentation Fault (core dumped) even with (char*, const char*) inputs [duplicate]

this is my very simple code: char thing[256]; char *athing; strcpy(thing, "Hello, "); strcpy(athing, "World!"); printf("%s\n%s\n", thing, athing); return 0; And ...
user avatar
1 vote
2 answers
165 views

recreation of atoi function max long long error

I'm having an issue in the output although I defined the macro for max long long to treat overflow but it still gives me a the wrong output # define LLONG_MAX 9223372036854775807LL as you can see ...
uncharted47's user avatar
0 votes
1 answer
72 views

OpenOnlaod throws segmentation fault

I installed OpenOnload to accelerate networking. I installed OpenOnload from source following the official documentation. $ onload Kernel module: 8.1.1.17 find /lib/modules/`uname -r` -type f -name '...
berkeyvx's user avatar
0 votes
1 answer
75 views

Segmentation fault with Quick sort

I need to implement a quick sort for my university assignment. The following is the implementation for quick sort that I wrote in c++: #include <iostream> #include <algorithm> #include &...
Default's user avatar
  • 85
0 votes
1 answer
99 views

segfault in a c++ program

count_words.h #ifndef _count_words_h_ #define _count_words_h_ #include <string> #include <list> #include <map> class CountWords { std::map<std::string, int> countWords; ...
Juze's user avatar
  • 11
0 votes
1 answer
100 views

Segmentation Fault while calling push_back on std::vector

Below I have provided a minimal working example of the error I am receiving. At a high level, the application segmentation faults at the line where I attempt to push_back a Point object into the ...
singular's user avatar
0 votes
0 answers
217 views

Segmentation fault when initializing a TFLite interpreter on one edge TPU, but no issue initializing it on another device, using the same model

I get a segmentation fault error when trying to initialize a TFLite interpreter on Edge TPU devices. Specifically, I have a Python script that uses the TFLite interpreter to load and execute models. I'...
emizemani's user avatar
2 votes
0 answers
64 views

Segfault when calling weak symbol in static library [duplicate]

For some reason I get a segfault when calling a weak function but only if I put the weak definition in a static library. Here are my source files: // mylib.h #pragma once void hello(const char* name) ...
Timmmm's user avatar
  • 92.5k
1 vote
1 answer
1k views

How to resolve "ffmpeg was killed with signal SIGSEGV" in docker container

I have a Node.js application deployed to a docker container with fluent-ffmpeg, @ffmpeg-installer/ffmpeg, and @ffprobe-installer/ffmprobe. Here is the fluent-ffmpeg init script: import ffmpeg = ...
Gmanicus's user avatar
  • 120
0 votes
0 answers
145 views

NestJs Segmentation fault

I have a segmentation fault randomly happening when working on my nestjs project, the segmentation comes once in a while, there is day where the segmentation fault comes and days where the seg fault ...
Dcrypt's user avatar
  • 1
2 votes
0 answers
82 views

'Segmentation Fault' occurred when Lambda Function in Python recurves over 1e5 times

def count_cond(condition): return lambda x:(((lambda f:(lambda a:f(a(a)))(lambda a:f(lambda *w:a(a)(*w))))(lambda cc: lambda j,m: ((cc(j+1,m+1) if condition(x,m)==True else cc(j,m+1))) if m<=x ...
nik_nul's user avatar
  • 21
0 votes
1 answer
591 views

Segmentation fault during running unit test cases using Vitest

I am on the Windows 10 operating system using Git Bash. I am using the v18.18.0 node version and the 9.8.1 npm version. The project is implemented in the Vue.js framework using the 3.3.4 version. For ...
Péter Szilvási's user avatar
1 vote
1 answer
122 views

Is there a more reasonable way for reading adc values from serial?

I have written a program to read adc values from an atmega2560 in two modes, a single sample mode that prints a sample for each channel selected by user, and a bulk mode that works by filling a buffer ...
beginner's user avatar
0 votes
0 answers
90 views

Segmentation fault when colmap gui

I'm trying to use colmap on ubuntu-18.04, and the cmake and make install went smoothly. Using the command colmap -h also worked fine. However, when I use the colmap gui command, I encounter the ...
Joe's user avatar
  • 21
1 vote
1 answer
64 views

My code works with one compiler but does not with other

linkedList.c: #include <stdio.h> #include <stdlib.h> #include <string.h> struct Node { int data; struct Node *next; }; typedef struct Node *node; node createNode(int val) {...
Ervin Ranjan's user avatar
0 votes
1 answer
71 views

Array of strings causes segmentation fault when first element is not initialized

I have this code block which has an array of 10 strings. Two things stand out to me in this: The first being that when doing char *words[10] = { "anything "}; I was under the impression ...
Salty Sodiums's user avatar
0 votes
1 answer
67 views

Openmp in fortran "Segmentation fault" [duplicate]

My system is on Debian 12 with an Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz. I am trying to parallelize some fortran code with openmp which uses the FFTW library and consists of several modules compiled ...
Marios Giannakou's user avatar
0 votes
0 answers
40 views

Segmentation fault on ubuntu 23.04 scanf [duplicate]

This same code when I compile it using this command: gcc chal.c -fno-pie -no-pie -fno-stack-protector -O0 -g -o chal #include <stdio.h> #include <string.h> int main() { char a[2]; ...
NobinPegasus's user avatar
0 votes
0 answers
10 views

Segmentation fault with ifstream

ifstream fmoa("config/MulticastOutputAdapterConfig.json", ifstream::in); The fault is happening at this line only, with this from gdb: 367 ifstream fmoa("config/...
sushant sharma's user avatar

1
3 4
5
6 7
272