Sponsored Content
Top Forums Programming Segment fault related to strlen.S Post 302969201 by cman on Saturday 19th of March 2016 02:36:36 PM
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 ).
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
apport-cli(1)						      General Commands Manual						     apport-cli(1)

NAME
apport-cli, apport-gtk, apport-kde - Apport user interfaces for reporting problems SYNOPSIS
apport-cli apport-cli [ --save file ] symptom | pid | package | program path | .apport/.crash file apport-cli -f apport-cli -f -p package -P pid apport-cli -u report-number Same options/arguments for apport-gtk and apport-kde. DESCRIPTION
apport automatically collects data from crashed processes and compiles a problem report in /var/crash/. This is a command line frontend for reporting those crashes to the developers. It can also be used to report bugs about packages or running processes. If symptom scripts are available, it can also be given the name of a symptom, or be called with just -f to display a list of known symp- toms. When being called without any options, it processes the pending crash reports and offers to report them one by one. You can also display the entire report to see what is sent to the software developers. When being called with exactly one argument and no option, apport-cli uses some heuristics to find out "what you mean" and reports a bug against the given symptom name, package name, program path, or PID. If the argument is a .crash or .apport file, it uploads the stored problem report to the bug tracking system. For desktop systems with a graphical user interface, you should consider installing the GTK or KDE user interface (apport-gtk or apport- kde). They accept the very same options and arguments. apport-cli is mainly intended to be used on servers. OPTIONS
-f, --file-bug Report a (non-crash) problem. If neither --package, --symptom, or --pid are specified, then it displays a list of available symp- toms. If none are available, it aborts with an error. This will automatically attach information about your operating system and the package version etc. to the bug report, so that the developers have some important context. -s symptom, --symptom=symptom When being used in --file-bug mode, specify the symptom to report the problem about. -p package, --package=package When being used in --file-bug mode, specify the package to report the problem against. -P pid, --pid=pid When being used in --file-bug mode, specify the PID (process ID) of a running program to report the problem against. This can be determined with e. g. ps -ux. -c report, --crash-file=report Upload a previously processed stored report in an arbitrary file location. This is useful for copying a crash report to a machine with internet connection and reporting it from there. Files must end in .crash or .apport. -u report-number, --update-report report-number Run apport information collection on an already existing problem report. The affected package is taken from the report by default, but you can explicitly specify one with --package to collect information for a different package (this is useful if the report is assigned to the wrong package). --save filename In --file-bug mode, save the collected information into a file instead of reporting it. This file can then be reported with --crash- file later on. -w, --window Point and click at the application window against which you wish to report the bug. Apport will automatically find the package name and generate a report for you. This option can be specially useful in situations when you do not know the name of the package, or if the application window has stopped responding and you cannot report the problem from the "Help" menu of the application. ENVIRONMENT
APPORT_IGNORE_OBSOLETE_PACKAGES Apport refuses to create bug reports if the package or any dependency is not current. If this environment variable is set, this check is waived. Experts who will thoroughly check the situation before filing a bug report can define this in their ~/.bashrc or temporarily when calling the apport frontend (-cli, -gtk, or -kde). FILES
/usr/share/apport/symptoms/*.py Symptom scripts. These ask a set of interactive questions to determine the package which is responsible for a particular problem. (For some problems like sound or storage device related bugs there are many places where things can go wrong, and it's not immedi- ately obvious for a bug reporter where the problem is.) AUTHOR
apport and the accompanying tools are developed by Martin Pitt <martin.pitt@ubuntu.com>. Martin Pitt August 01, 2007 apport-cli(1)
All times are GMT -4. The time now is 08:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy