How can I deal with the error of "Memory fault(core dum

I wrote a helloworld program and compiled it with qcc on my host machine.
After I send the compiled file to the target with FTP and then ran it, the error “Memory fault(core dump)” always was appeared.
I am very confused on that. :confused: Please tell me what can I do if you know it.
Thanks very much!

It means your program is doing something illegal, can you post your source code and the compile option you used with qcc.

Note that with ftp you loose the +x flag (executable), are you sure you are running right executable.

If I got this right your program works fine on the build machine, right?

One reason for this could be that the ftp is using ASCII mode to transfer the binary (some ftp server are actually using ASCII mode by default for whatever reason). So make sure your ftp transfer is done in BINARY mode. (For console ftp client just type in ‘bin’).

Another thing to check is where your program crashes exactly: compile with -g option and use gdb.

//edit: I just tried this myself with a ‘Hello World’ binary and it SIGSEGVed as well after ASCII transfer…

When tried to debug the program I got a couple of errors and gdb says ‘no debuging symbols found’ although I compiled with -g option.

I have solved my problem.I changed the type of ftp from ascii mode to binary mode and the program can execute exactly!
Thank you very much!
You are so great!:slight_smile:

That sucks. I though ELF format had some sort of checksum.