Re: Memory fault when i am using a shared object



"Aneesh E Warrier" <vinuwarrier@xxxxxxxxx> writes:

I am new to Linux. I am facing on problem regarding shared object in
Linux. When I am running the application using the library the
application is crashing.

Have you considered the possibility that there is a bug in your code?

g++ -w -fPIC -g -o ./CPEPoints.o -c ./CPEPoints.cpp
g++ -w -fPIC -g -o ./CPERates.o -c ./ CPERates.cpp
g++ -g -shared -o ../../Lib/libCPERateCard.so.1
g++ RateCardTest.o -L./ -o RateCard -ldl Lib/libCPERateCard.so.1

The above are all fine (although your binary will likely not run
in any directory that doesn't have "Lib" subdirectory containing
libCPERateCard.so.1).

Can anybody suggest what I am missing.

You are missing basic debugging technique.
Try the following gdb commands:

list
where
x/4i $pc
x/10i $pc-15
info registers
info shared

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
.



Relevant Pages

  • Re: Program gets SIGBUS unless linked with -Wl,-aarchive_shared
    ... run the program with -ashared under GDB here's what I see... ... Looks like a bug in libstc_mscommon.sl ... ... In order to understand recursion you must first understand recursion. ...
    (comp.sys.hp.hpux)
  • Re: slurping in binary data
    ... that I must figure out precisely why it is that I don't expect the bug ... However, the recursion always ... I recently investigated a bug where there were missing packets from the output files of one of my programs. ... Because those were the easiest things to check, they were also the first things I checked (despite direct orders from upper management that I was not supposed to "waste" any time investigating the "impossibility" that those input files were defective). ...
    (comp.lang.c)
  • Re: slurping in binary data
    ... that I must figure out precisely why it is that I don't expect the bug ... However, the recursion always ... there were missing packets from the output files of one of my programs. ... certain assumptions about the contents of the input files. ...
    (comp.lang.c)
  • Re: Python bug? Named parameters in recursive calls sometimes confuses python?
    ... > Isn't it possible that the code has just returned twice? ... down in the recursion, instead of reverting to the object ... a Python bug! ... (It's the pure Python version 0.8) ...
    (comp.lang.python)
  • Re: [PATCH] workqueue: not allow recursion run_workqueue
    ... works is not run orderly when recursion run_workqueue ... It's bug. ... So we should not allow workqueue trying to flush its own queue. ... struct workqueue_struct *wq; ...
    (Linux-Kernel)