Tuesday, 15 March 2011

c - qrencode - Segmentation fault (core dumped) -


I have created a working program that produces an image given by a certain string. It's completely working on my Slackware 32 bit disto and others have also got 32 beta.

Now I need to implement it on a client machine, which is AECS PowerPC, it is compiled without any problems, and starts working (every other function works and gives the right result ), When I call these 2 functions "QRcode_encodeString" and "QRcode_encodeData" it is giving me segmentation fault

You can assume my main () only function call that:

  #include & lt; Stdio.h & gt; # Include & lt; Qrencode.h & gt; Int main (zero) {QRcode * pQRC = QRcode_encodeString ("abc", 0, QR_ECLEVEL_L, QR_MODE_8, 0); Return 0; }  

I do not have a GDB on the client machine and no root is private. It works with "QRcode_encodeStringMQR ()" which creates a micro QRcode, but this is not a solution for me. It generates a dump file with the name "core" which I can not use because the gdb in that machine No ... and I'm assuming that I can not open it on any other machine because they do not share the same architecture

Again, this code works on my Slackware Distro.

My knowledge about PowerPC and Ax is confined to this experience only, unfortunately.

I forgot to tell, only CC is available and I am compiling it:

  cc qrgen.c -lqrencode -l / usr / local / info For, I was able to compile it on Linux on the power environment and it runs fine without any error splitting machine: POWER8 OS: Ubuntu 15.04  
  Ubuntu @ Ubuntu 1504: ~ / Qr $ cat hello.c # include & lt; Stdio.h & gt; # Include & lt; Qrencode.h & gt; Int main (zero) {QRcode * pQRC = QRcode_encodeString ("abc", 0, QR_ECLEVEL_L, QR_MODE_8, 0); Return 0; } Ubuntu @ ubuntu1504: ~ / qr $ gcc hello.c -lqrencode ubuntu @ ubuntu1504: ~ / qr $ ./a.out ubuntu @ ubuntu1504: ~ / qr $ strace ./a.out execve ("./a.out ", [" ./a.out "], [/ * 20 wars * /]) = 0 brick (0) = 0x1003f690000 reach (" / etc / ld.so.nohwcap ", F_OK) = -1 eonant (not Such file or directory) access ("/ etc / ld.so.preload", R_OK) = -1 incontinence (no such file or directory) ("/ etc / ld.so.cache", O_RDONLY | O_CLOEXEC) = 3 Open fstat (3, {st_mode = S_IFREG | 0644, st_size = 42,765, ...}) = 0 mmap (zero, 42,765, PROT_READ, MAP_PRIVATE, 3, 0) = 0x3fff816c0000 pass (3) = 0 access ("/ etc / Ld.so.nohwcap ", F_OK) = -1 ENOENT (such a file or directory) open (" / usr / lib / powerpc64le-linux- CNN / libqrencode.so.3 ", O_RDONLY | O_CLOEXEC) = 3 reading (3," \ 177ELF \ 2 \ 1 \ 1 \ 0 \ 0 \ 0 \ 0 \ 0 \ 3 \ 0 \ 25 \ 0 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 ) = 0 mmap (zero, 131,832, PROT_READ | PROT_EXEC, MAP_PRIVATE | MAP_DENYWRITE, 3, 0) = 0x3fff81 690000 mmap (0x3fff816a0000, 131,072, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED | MAP_DENYWRITE, 3, 0) = 0x3fff816a0000 pass (3) = 0 access ("/ etc / ld.so.nohwcap", ("/ Lib / powerpc64le-linux-gnu / libc.so.6", O_RDONLY | O_CLOEXEC) = 3 reading (3, "\ 177ELF \ 2 \") 1 \ 1 \ 3 \ 0 \ 0 \ 0 \ 0 \ 0 \ 0 \ 3 \ 0 \ 25 \ 0 \ 0 \ 0 \ 0 @ R \ 2 \ 0 \ 0 \ 0 \ 0 \ 0 "..., 832) = 832 Fstat (3, {st_mode = S_IFREG | 0755, st_size = 1789000, ...}) = 0 mm (zero, 1860208, PROT_READ | PROT_EXEC, MAP_PRIVATE | MAP_DENYWRITE, 3, 0) = 0x3fff814c0000 mmap (0x3fff81670000, 131072, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED | MAP_DENYWRITE, 3, 0x1a0000) = 0x3fff81670000 Close (3) = 0 mprotect (0x3fff81670000, 65536, PROT_READ) = 0 mprotect (0x3fff816a0000, 65536, PROT_READ) = 0 mprotect (0x10010000, 65536, PROT_READ) = 0 Mprotect (0x3fff81720000, 65536, PROT_READ) = 0 Manimap (0x3fff816c0000, 42765) = 0 bit (0) = 0x1003f690000 brack (0x1003f6c0000) = 0x1003f6c0000 exit_group (0) =? +++ 0 +++  
exited

No comments:

Post a Comment