Barfing on a NULL pointer is actually the desired behavior.
Merely having a zero length string won't be a problem for strcmp. The mian cause for this is that you are missing the "trailing" nul character in a string.
If the strcmp occurs in the function where a and b are declared otherwise pass in sizoef(a) and sizeof(b) as arguments:
I have the following set up on a Sun server running solaris 5.8 for core dump generation
coreadm
global core file pattern: /var/core
init core file pattern: /var/core
global core dumps: enabled
per-process core dumps: enabled
global setid core dumps:... (4 Replies)
Hi,
Can we modify the GDB source code so as to analyze core dumps from different targets? From my analysis, I think we need to build our section table statically for each target. i.e., including the various address boundaries in build_section_table() function. If this is the case, then the GDB... (2 Replies)
My program is not dumping core when hitting a segmentation violation inside a thread.
However, it dumps core when the segv occurs within main.
Any ideas on how to diagnose this?
AIX 5.3 (4 Replies)
i had a situation where a process was defunct. preap would not reap the process and gcore would not work properly (not sure why). therefore, the suggestion was to force a panic and collect the core dump. obviously you could do a savecore -L and capture the dump without bringing down the system.... (3 Replies)
Hello,
I am debugging a program which works as daemon. It sigfaults, unfortunately I'm unable to generate core dump file. Here is what I am doing:
tsurko@bastila:~$ ulimit -c unlimited
tsurko@bastila:~$ ulimit -c
unlimited
tsurko@bastila:~$ cat /etc/sysctl.conf | grep 'core_pattern'... (1 Reply)
Hi
I have a Fedora installed and I try to generate my application's core dump file.
My system has no coredump limit:
$ ulimit
core file size (blocks, -c) unlimited
But when my application crashes no core dumps generated. I can generate dump file using gcore but it is not appropraite... (1 Reply)
I'm working on a program in Linux with a group of people scattered around the country. When we have a crash, I like to send a core dump to the appropriate person so that they can understand the problem better. The problem is that our application uses several gigabytes worth of data and these... (4 Replies)
kill -SEGV <pid> gives me the core file for that process but also terminates the process.
Can I not get the core dump without terminating the process ? (2 Replies)
Discussion started by: mohtashims
2 Replies
LEARN ABOUT MOJAVE
strncmp
STRCMP(3) BSD Library Functions Manual STRCMP(3)NAME
strcmp, strncmp -- compare strings
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <string.h>
int
strcmp(const char *s1, const char *s2);
int
strncmp(const char *s1, const char *s2, size_t n);
DESCRIPTION
The strcmp() and strncmp() functions lexicographically compare the null-terminated strings s1 and s2.
The strncmp() function compares not more than n characters. Because strncmp() is designed for comparing strings rather than binary data,
characters that appear after a '