Segment fault related to strlen.S


 
Thread Tools Search this Thread
Top Forums Programming Segment fault related to strlen.S
# 8  
Old 03-19-2016
Quote:
However, I'd like to know your way to debug I would find which loop indexes the program crashes for you! Thanks a lot!
That's just how I would do the debugging. Once I knew the index where the program crashed , you could use a debugger to trace forward at the beginning of the loop(s) to find what caused the crash ( this way you can eliminate a lot of code as the problem - as long as something in the prior code did not cause the problem in the first place, in which case you could go backward in the indexes to find what the problem is ).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Segment fault for C++ program when return vector

I am trying to reverse complement DNA sequence (string) with a short c++ code using boost library. Code was compiled without any warning/error, but ran into Segmentation fault. My guess is the function to return a vector, but not sure. #include <iostream> #include <fstream> #include <string>... (14 Replies)
Discussion started by: yifangt
14 Replies

2. Programming

Segment-fault handling for pthreads

Hi I have struggling a week to fix a program , in the begining i got SIGBUS , but after many attempts still the program gets SIGSEGV segment fault , In bellow i post the seg fault log + source codes. would really appreciate if experts help me to fix this segment fault error. any advice is... (2 Replies)
Discussion started by: pooyair
2 Replies

3. Programming

why segment fault,

I always get segment fault, why? can sb help me and modify it, I have spend on much time on #include <pthread.h> #include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include <string.h> #define MAX 10 pthread_t thread; void *thread1() { int *a; int i, n; ... (1 Reply)
Discussion started by: yanglei_fage
1 Replies

4. Programming

Data segment or Text segment

Hi, Whether the following piece of code is placed in the read-only memory of code (text) segment or data segment? char *a = "Hello"; I am getting two different answers while searching in google :( that's why the confusion is (7 Replies)
Discussion started by: royalibrahim
7 Replies

5. Programming

strlen for UTF-8

My OS (Debian) and gcc use the UTF-8 locale. This code says that the char size is 1 byte but the size of 'a' is really 4 bytes. int main(void) { setlocale(LC_ALL, "en_US.UTF-8"); printf("Char size: %i\nSize of char 'a': %i\nSize of Euro sign '€': %i\nLength of Euro sign: %i\n",... (8 Replies)
Discussion started by: cyler
8 Replies

6. Programming

a strange segment fault about ltp-posix test

Hi all In the ltp-posix test,there is a case in open_posix_testsuite\conformance\interfaces\timer_gettime\speculative/6-1.c I run the above code,it will has a segment fault, if I modify it to below,it works well Anybody can tell me why? (1 Reply)
Discussion started by: yanglei_fage
1 Replies

7. Programming

'strlen' of a constant string

In a declaration, I have: const char comment_begin = "<!--"; const char comment_end = "-->"; const int comment_begin_len = strlen(comment_begin); const int comment_end_len = strlen(comment_end); When I compile, I get the warnings: emhttpc.c:64: warning: initializer element is not... (10 Replies)
Discussion started by: cleopard
10 Replies

8. Programming

Segment Fault

When run it, segment fault. What is wrong? #include <stdio.h> #include <stdlib.h> const int max =20; //**************************************************** // Input Matrix //**************************************************** void inMatrixAA(int *AA, int row, int col)... (9 Replies)
Discussion started by: zhshqzyc
9 Replies

9. Shell Programming and Scripting

Problem with the strlen function in ksh

Hello, Just a little problem with the ksh function : strlen I want to use this function in this little ksh program : while read line ; do TOTO=$line TOTONB=strlen($TOTO) echo $TOTONB (3 Replies)
Discussion started by: steiner
3 Replies

10. Programming

Problems with Strlen

hello, i have a problem with strlen. I have written this: for(y=13,z=0; cInBuf!=' ';y++) { cBuf=cInBuf; z++; } len = strlen(cBuf); out=len/2; fprintf(outfile,"F%i",out); If strlen is e.g. 22, it write F22. I want to write F2F2. How can i do this?... (5 Replies)
Discussion started by: ACeD
5 Replies
Login or Register to Ask a Question
FTFF(1) 						      General Commands Manual							   FTFF(1)

NAME
ftff - fault tolerant file find utility SYNOPSIS
ftff [-#fFhIpq][-t#][start_directory] file_to_find DESCRIPTION
ftff recursively descends the directory hierarchy and reports all objects in the file system with a name that approximately matches the given filename. ftff achieves fault tolerance by calculating the so called Weighted Levenshtein Distance. The Levenshtein Distance is defined as the minimum number of character insertions, deletions and replacements that transform a string A into a string B. ftff behaves like 'find start_directory -name file_to_find -print' with the following differences: - ftff is fault tolerant - ftff is NOT case sensitive - the level of fault tolerance can be adjusted by specifying the optional parameter tolerance. A tolerance of 0 specifies exact match. OPTIONS
-h Prints a little help/usage information. -f Follow symbolic links on directories. Note: a symbolic link like "somewhere -> .." causes naturally an endless loop. By default ftff does not follow symbolic links to directories. -F Classify the file type by appending a character to each file name. This character is: '*' for regular files that are executable '/' for directories '@' for symbolic links '|' for FIFOs '=' for sockets -p print the actual distance value in front of the filename. This value is equal to the number of insertions, deletions and replace- ments necessary to transform the file that was found into the search key (the file_to_find). -q keep quiet and do not print any warning about non readable directories. -# or -t# Set the fault tolerance level to #. The fault tolerance level is an integer in the range 0-255. It specifies the maximum number of errors permitted in finding the approximate match. The default tolerance is (strlen(searchpattern) - number of wildcards)/6 + 1 -I Do case sensitive search (default is case in-sensitive) file_to_find The filename to search for. '*' and '?' can be used as wildcards. '?' denotes one single character. '*' denotes an arbitrary number of characters. start_directory The directory to start the search. The current directory is the default. The last argument to ftff is not parsed for options as the program needs at least one file-name argument. This means that ftff -x will not complain about a wrong option but search for the file named -x. EXAMPLE
ftff samething This will e.g. find a file called something or sameting or sum-thing or ... To find all files that start with any prefix, have something like IOComm in between and end on a two letter suffix: ftff '*iocomm.??' To find all files that exactly start with the prefix DuPeg: ftff -0 'dupeg*' BUGS
The wildcards '?' and '*' can not be escaped. These characters function always as wildcards. This is however not a big problem since there is normally hardly any file that has these characters in its name. AUTHOR
Guido Socher (guido@linuxfocus.org) SEE ALSO
whichman(1), find(1) Search utilities August 1998 FTFF(1)