Seg fault on specific Linux machine

Linux specific forum
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 543
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

Seg fault on specific Linux machine

Post by bbanelli »

Greetings to all,

PB 5.42 LTS, compiled software works normally on development machine, however, on CentOS 7 (2.6.32-042stab108.5) it always produces this kind of errors.

Code: Select all

ckzg@ckzg.hr [~/public_html/cgi-bin]# strace ./test.cgi
execve("./test.cgi", ["./test.cgi"], [/* 32 vars */]) = 0
brk(0)                                  = 0xc5e000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f693c5b3000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f693c5b2000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f693c5b1000
arch_prctl(ARCH_SET_FS, 0x7f693c5b2680) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x8} ---
+++ killed by SIGSEGV +++
Segmentation fault
Tried compiling it with various gcc versions (from 4.7 to 5.2), running it as root on CentOS, but no help.

Could it be due to very old kernel? Edit: I have just run files on standard CentOS live distribution and files work properly.

Thanks for any suggestions or hints!

Best regards,

Bruno

Edit: do you want to hear a shameful story? I was transferring files via FTP and transfer mode was set to "Auto" - switching it to "Binary", naturally, settled this insane issue. Sorry for disturbing the forum with such nonsense... ;)
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/