Search code examples
cqr-codeaixpowerpc

qrencode - Segmentation fault (core dumped)


I have made a working program that generated an image given a certain string. It is fully working on my Slackware 32bit distro and others distros also 32bit.

Now i need to implement it on the client machine, which is an AIX powerpc. It compiled without any problem, and seems to work (every other function works and gives correct results), except when i call these 2 functions "QRcode_encodeString" and "QRcode_encodeData". It keeps giving me Segmentation fault.

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

#include <stdio.h>
#include <qrencode.h>

int main(void)
{
   QRcode* pQRC = QRcode_encodeString("abc", 0, QR_ECLEVEL_L, QR_MODE_8, 0);    
   return 0;
}

I don't have gdb on the client machine and no root priv. It works with "QRcode_encodeStringMQR()" which generates a micro QRcode, but that isn't a solution for me. It generates a dump file by the name "core" which I can't use it since that machine doesn't have gdb... And I'm assuming I can't open it on another machine since they don't share the same architecture. I have literaly no clue on how to troubleshoot this one...

Again, this code works on my Slackware distro.

My knowledge about powerpc and AIX is limited to this experience only, unfortunately.

I forgot to mention, only cc is available and I'm compiling like this:

cc qrgen.c -lqrencode -L/usr/local/lib -I/usr/local/include

Solution

  • I found the problem... The installation of the lib generated problems and caused the caused the symbolic links to exist as a simple file and the library just wasn't there...

    This is the missing file "/usr/local/lib/libqrencode.so.3.4.4" which is the code itself... I was looking at the files and didn't notice it because there was a file called libqrencode.so.3.4 but this file was supose to be a symbolic link to libqrencode.so.3.4.4 since libqrencode.so.3.4.4 didn't exist, instead of the symbolic link failing, it created a empty file with that same name...