0

I compiled libAPR sources and ran successfully all tests provided by Apache.

However when I link my program to libapr.so the same functionality is not present.

For instance, apr_pollset_add primitive doesn't work. It returns always 1 (when it should return 0) and doesn't work (in the source test works like a charm).

I modified all the code of APRlib related to that primitive so it would just return -1. When I run the Apache tests, they present expected behaviour (return -1), however once again when I call the primitive from .so libs it is always returning 1.

I am almost sure the lib has just a wrapper on that function wich returns always 1.

Any clue on what is happening?

twawpt
  • 51
  • 4
  • Are you sure you are linking the exact same lib that you compiled? – Shiplu Mokaddim Dec 20 '12 at 04:53
  • Yes. Deleted the old ones. Tried to compile, and my program returned error because it didn't find them, Then did 'make install' and my program compiled successfully again. So I am pretty sure I am using the new libs. – twawpt Dec 20 '12 at 05:00
  • of course before make install, I did make and make clean. ^^ – twawpt Dec 20 '12 at 05:01
  • My money would be on a bug in the modifications you have made to APR, or that you have neglected something in your program. Sadly, we cannot know. – Brett Hale Dec 20 '12 at 05:50
  • Listen I didn't modify the function to add functionality. I modified the function, so that its unique line of code is 'return -1' to check if the behaviour is reproduced in the lib (which is not happening). I did modified because with APR unmodified that function doesn't work. – twawpt Dec 20 '12 at 14:03
  • Please help me on this. For some reason the installed libraries are not preserving functionality that exists and runs in the apr source folde, namely with the tests (which are ok). I was searching and tests are compiled pointing to a .la file. – twawpt Dec 20 '12 at 15:19

1 Answers1

1

So finally I found the problem.

I had libapr already installed in my system, so whenever I would use -libapr-1, it would link my program to the previously installed version of libapr. That was the reason it was not responding to my code modifications.

Regarding apr_pollset_add primitve, it is working well. The error is returned by the system when apr calls poll_ctl, because I was adding a regular file descriptor which is not accepted.

twawpt
  • 51
  • 4