Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6694791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:08:34+00:00 2026-05-26T06:08:34+00:00

Im getting this error, what could this be??? Program received signal EXC_BAD_ACCESS, Could not

  • 0

Im getting this error, what could this be???

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x00007fff86703c00 in strlen ()

I RAN THIS IN GDB and its the first thing that appears. It doesnt even tell me on what Line I can find this error…

On the terminal I get this error: Segmentation Fault

Im positive the error is in the AREA “Funcion Busqueda” Im pasting the whole thing so you can tell me if you spot something else.

I need to find what is the cause for this Segmentation Fault!!! What could it beeeee!?

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include "clientes.h"


int ordena(LISTA1 *inicio,LISTA1 *aux,LISTA1 *nodo,LISTA1 *aux2);
int agrega_cliente(LISTA1 *inicio, LISTA1*aux,LISTA1 *nodo,LISTA1 *aux2);
int busca_cliente(LISTA1 *inicio, LISTA1*aux,LISTA1 *nodo,LISTA1 *aux2,LISTA2    *inicioventas,LISTA2 *auxventas,LISTA2 *nodoventas,LISTA2 *aux2ventas);
int main(void)
{
   int menu,pops=0;
LISTA1 *inicio, *aux,*nodo, *aux2;
inicio=NULL;
aux=inicio;
LISTA2 *inicioventas, *auxventas,*nodoventas, *aux2ventas;
inicioventas=NULL;
auxventas=inicioventas;
 system("clear");
  //funcion void carga_datos();
ordena(inicio,aux,nodo,aux2);

  printf("TIENDA DEPARTAMENTAL\n\n\n");
  printf("1. Agregar a un Cliente.\n2. Agregar una venta.\n3. Buscar Cliente. \n4. Borrar Cliente. \n5. Borrar una venta. \n6. Salir.");
  printf("\n\nElige una opcion: "); 
  scanf("%d", &menu);
  switch(menu)
    {
   case 1:
  system("clear");
  printf("opcion1\n");
        agrega_cliente(inicio,aux,nodo,aux2);

  break;
   case 2:
  system("clear");
  printf("opcion2\n");
  break;
    case 3:
  system("clear");
  printf("opcion3\n");

        busca_cliente(inicio,aux,nodo,aux2,inicioventas, auxventas, nodoventas, aux2ventas);
        puts(aux2->nombre);

   break;
  case 4:
  system("clear");
  printf("opcion4\n");
  break;
   case 5:
  system("clear");
  printf("opcion5\n");
  break;
   case 6:
  system("clear");
  printf("opcion6\n");
  break;
  }
 }

////////////////////////////////////////FUNCION BUSQUEDA//////////////////////////
 int busca_cliente(LISTA1 *inicio, LISTA1 *aux,LISTA1 *nodo,LISTA1 *aux2,LISTA2     *inicioventas,LISTA2 *auxventas,LISTA2 *nodoventas,LISTA2 *aux2ventas)
 {
char nombrebusqueda[80];
int numclienteprueba;
printf("Dame el nombre del cliente a buscar\n");
scanf("%s",nombrebusqueda);
aux2=aux; 
while(aux2!=NULL)
{ 
    if((strcmp(nombrebusqueda,aux2->nombre))==0)
    {
        puts(aux2->nombre);
        ////////Buscamos la venta
        aux2ventas=auxventas; 
        while(aux2ventas!=NULL)
        {
            numclienteprueba=aux2ventas->num_clienteventas;
            if(numclienteprueba==aux2ventas->num_clienteventas)
            {
                printf("Wow");
            }
            aux2ventas=aux2ventas->sigvent;
        }
        ////////////
    }
    aux2=aux2->sig;
  }
 }

   ////////////////////////////////////////////Funcion Ordena



 int ordena(LISTA1 *inicio, LISTA1*aux,LISTA1 *nodo,LISTA1 *aux2)
 {
char pruebaman[80],probaman[80];//nombres
char pruebadireccion[150],probadireccion[150];//direccion
int pruebanum_cliente,probanum_cliente;//numero de cliente
aux2=aux;
strcpy(pruebaman,aux2->nombre);
strcpy(pruebadireccion,aux2->direccion);
pruebanum_cliente=aux2->num_cliente;
aux2=aux2->ant;

do
 {

    strcpy(probaman,aux2->nombre);

    if(pruebaman[0]<probaman[0])
    {
        strcpy(pruebaman,aux2->nombre);
        strcpy(pruebadireccion,aux2->direccion);
        pruebanum_cliente=aux2->num_cliente;
        aux2=aux2->sig;
        strcpy(aux2->nombre,probaman); 
        strcpy(aux2->direccion,probadireccion);
        probanum_cliente=aux2->num_cliente;    
    }
    strcpy(pruebaman,aux2->nombre);
    strcpy(pruebadireccion,aux2->direccion);
    pruebanum_cliente=aux2->num_cliente;

    aux2=aux2->ant;


    printf("Ciclo\n\n");

  }
  while(aux2!=NULL);
 aux2=aux;
 strcpy(pruebaman,aux2->nombre);
 aux2=aux2->ant;
 strcpy(probaman,aux2->nombre);
 if(pruebaman[0]<probaman[0])
    ordena(inicio,aux,nodo,aux2);
}


 ///////////////////

  ///////////////////////////////////////////////////////Agrega Cliente
   int agrega_cliente(LISTA1 *inicio, LISTA1*aux,LISTA1 *nodo,LISTA1 *aux2)
 {

FILE *clientes;
clientes=fopen("clientes.txt", "a+");
//fseek(clientes, 0L, SEEK_END);

inicio=NULL;
nodo=malloc(sizeof(LISTA1));
aux=malloc(sizeof(LISTA1));

if(nodo==NULL)
{
    printf("No hay memoria\n");
    exit(1);
}
printf("NOMBRE: ");
gets(nodo->nombre);
printf("DIRECCION: ");
gets(nodo->direccion);
printf("NUMERO DE CLIENTE: ");
scanf("%d", &nodo->num_cliente);

if(inicio==NULL)
{
    inicio=nodo;
    inicio->sig=NULL;
    inicio->ant=NULL;
    aux=inicio;
}
else
{
    aux->sig =nodo;
    nodo->ant=aux;
    aux=nodo;
    nodo->sig=NULL;
}
nodo=malloc(sizeof(LISTA1));

aux2=inicio;

while(aux2!=NULL)
   {
    fprintf(clientes, "%s\n", aux2->nombre);
    fprintf(clientes, "%s\n", aux2->direccion);
    fprintf(clientes, "%d\n", aux2->num_cliente);
    puts(aux2->nombre);
    puts(aux2->direccion);
    aux2=aux2->sig;
   }


aux2=aux;
do
  {
    puts(aux2->nombre);
    aux2=aux2->ant;
  }
    while(aux2!=NULL);
fclose(clientes);
} 

/////////////////////////////////////////////////////
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:08:35+00:00Added an answer on May 26, 2026 at 6:08 am

    It looks like a NULL pointer. When you try to access memory location 0x0000 it means the pointer is pointing to 0x0000 (NULL).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting the following error Program received signal: EXC_BAD_ACCESS. warning: check_safe_call: could not restore
i am getting this error failed to execute request because the app-domain could not
I'm getting this Hibernate error: org.hibernate.MappingException: Could not determine type for: a.b.c.Results$BusinessDate, for columns:
I am getting a Program received signal: EXC_BAD_ACCESS. when using the following code. searchResultFileSize
I'm getting this error when trying to see the contents of a NSMutableArray: Program
I am getting this error in a program that creates several (hundreds of thousands)
Getting this error: 2009-09-03 12:44:02.307 xcodebuild[307:10b] warning: compiler 'com.apple.compilers.llvm.clang.1_0.analyzer' is based on missing compiler
Getting this error with jquery & jquery.form. Site has been live for awhile..upgraded to
Anyone getting this error when using the new free chart controls MS bought from
I´m getting this error while trying to commit to a svn repository: svn: MKACTIVITY

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.