Sponsored Content
Top Forums Programming Program received signal: “EXC_BAD_ACCESS”? Post 302524114 by mdonova33 on Saturday 21st of May 2011 04:03:18 PM
Old 05-21-2011
Program received signal: “EXC_BAD_ACCESS”?

I am making a command line program in C using XCode. When running the program, it initially does what it is supposed to do (asks me for a file path). However, when I type in a valid and existing file path, it gives me the following error:
Code:
Program received signal:  “EXC_BAD_ACCESS”. sharedlibrary apply-load-rules all (gdb)

I have two warnings in my program, both of which have to do with the function strcat. The warnings are:
Code:
warning: implicit declaration of function 'strcat'

and
Code:
warning: incompatible implicit declaration of built-in function 'strcat'

I am wondering why my program is not executing properly.

Thanks,
Mike

My code is posted below:

Code:
#include 
   #include "stdlib.h"
   int main (void)
   {
       char *string1;
       printf("Type in your file path: ");
       scanf("%s", string1);
       char *string2 = "tar czvf YourNewFile.tar.gz ";
       strcat(string2, string1);
       system(string2);
       
   }


EDIT: Maybe it has to do with allocating the chars?

Last edited by mdonova33; 05-21-2011 at 06:56 PM..
 

10 More Discussions You Might Find Interesting

1. Programming

Program received signal SIGABRT, Aborted.

I ran degugger in C++ and the followings are the message I got: Program received signal SIGABRT, Aborted. 0x002a57a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 (gdb) info s #0 0x002a57a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 #1 0x002e97f5 in raise () from /lib/tls/libc.so.6... (1 Reply)
Discussion started by: napapanbkk
1 Replies

2. Programming

Program received signal SIGSEGV, Segmentation fault.

Dear all, I used debugger from C++ and these are the message I got: Program received signal SIGSEGV, Segmentation fault. 0x00323fc0 in free () from /lib/tls/libc.so.6 (gdb) info s #0 0x00323fc0 in free () from /lib/tls/libc.so.6 #1 0x00794fa1 in operator delete () from... (5 Replies)
Discussion started by: napapanbkk
5 Replies

3. Forum Support Area for Unregistered Users & Account Problems

no email received

I have tried to register and got a message saying an email would be sent but no email has turned up. Could you try again please? (1 Reply)
Discussion started by: lookingfor help
1 Replies

4. AIX

Received signal #11, SIGSEGV [default] on AIX 6.1

Hello, One of our customer is getting segmentation fault when he runs his shell script which invokes our executable on AIX 6.1. On AIX 5.3, there were no issues. Here is the truss output. 811242: __loadx(0x0A040000, 0xF0D3A26C, 0x00000000, 0x00000009, 0x00000000) = 0xF026E884... (0 Replies)
Discussion started by: erra_krishna
0 Replies

5. AIX

nim: error signal number 2 received

Hi to all, i am trying to make mksysb backup of a NIM client machine from NIM master and while i am reading that the backup is done successfully i get an error message below and it doesnt exit the smit screen. also the status of the command appears to be running. is there anybody who knows why... (3 Replies)
Discussion started by: omonoiatis9
3 Replies

6. Programming

Please help:program hang stuck there signal handling on POSIX Message Queue UNIX C programming

in a single main() function,so need signal handling. Use Posix Message Queue IPC mechanism , can ignore the priority and other linked list message,to implement the scenario: client:Knock Knock server:who's there client: Eric Server:Eric,Welcome. client:exit all process terminated ... (1 Reply)
Discussion started by: ouou
1 Replies

7. Programming

Why do I receive Program received signal SIGABRT, Aborted?

Im using gdb and when a user disconnects from my server I receive a message Program received signal SIGABRT, Aborted. 0x7ffe0304 in ?? () I was hoping someone here might have a explination for this message in gdb (26 Replies)
Discussion started by: Errigour
26 Replies

8. Forum Support Area for Unregistered Users & Account Problems

No activation email received

I have tried to register today with the username BatterBits, but have not received the activation email I do not live in any of the restricted countries - unless the UK has suddenly become a threat! I'd be grateful if you would assist. many thanks Ian (2 Replies)
Discussion started by: unregistered
2 Replies

9. UNIX for Beginners Questions & Answers

Error received

I have a program that i need to get done that gets the person's name and his grade then prints it in this order "name-grade-gradeletter" so i wrote this code: #!/bin/bash while :; do read -p "Enter the person's name: " name read -p "Enter the grade of the person: " grade case $grade in )... (3 Replies)
Discussion started by: UniverseCloud
3 Replies

10. Shell Programming and Scripting

Any help gratefully received

Multiple questions coming your way. A little back ground info as to why I am back to basics. A dear friend of mine passed away recently and as a request by him I have promised to keep his project alive. The problem I have it was being handed over when he was in the last weeks of his life and... (1 Reply)
Discussion started by: nobbyall
1 Replies
SSAStringCpy(3SNMP)					      SNMP Library Functions					       SSAStringCpy(3SNMP)

NAME
SSAStringCpy, SSAStringInit, SSAStringToChar, SSAStringZero - Sun Solstice Enterprise Agent string helper functions SYNOPSIS
cc [ flag ... ] file ... -lssasnmp [ library .. ] #include <impl.h> void *SSAStringZero(String *string); int SSAStringInit(String *string, uchar_t *chars, int len, char *error_label); int SSAStringCpy(String *string1, String *string2, char *error_label); char *SSAStringToChar(String string); DESCRIPTION
The SSAStringCpy() function makes a deep copy of string2 to string1. This function assumes that string1 has been processed by the SSAS- tringZero() function. Memory is allocated inside the string1 and the contents of string2, not just the pointer, is copied to the string1. If an error is encountered, an error message is stored in the error_label buffer. The SSAStringInit() function copies the char array from chars to the string instance with the specified length len. This function assumes that the string instance has been processed by the SSAStringZero() function or no memory is allocated inside the string instance. If an error is encountered, an error message is stored in the error_label buffer. The SSAStringToChar() function returns a temporary char array buffer for printing purposes. The SSAStringZero() function frees the memory inside of the String instance, but not the string object itself. RETURN VALUES
The SSAStringInit() and SSAStringCpy() functions return 0 if successful and -1 if error. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) SunOS 5.10 17 Dec 1996 SSAStringCpy(3SNMP)
All times are GMT -4. The time now is 03:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy