[syslog-ng] Getting error : .../libsyslog-ng.so: file not recognized: File truncated

Peter Kokai (pkokai) Peter.Kokai at oneidentity.com
Wed Feb 5 12:10:08 UTC 2020


Hello,

Have you verified if both file is the same (no transport issue) ? (check sha256sum)
Could other tools - that understands elf - read that library ? (readelf -a syslog..so)

What was the exact linker option it was called with ? (you can ask gcc/clang to emit such information with -### option)

--
Kokan
On Wed, Feb 05, 2020 at 05:27:09PM +0530, Nitish Saboo wrote:
> CAUTION: This email originated from outside of the organization. Do not follow guidance, click links, or open attachments unless you recognize the sender and know the content is safe.
> 
> Hi,
> 
> I compiled the syslog-ng-3.7.1.tar.gz on a Ubuntu 16.04 machine .The syslog-ng got compiled successfully on this machine.
> 
> ----------------------------------------------------------------------
> Libraries have been installed in:
>    /home/anassa/nitish/syslog-ng-3.7.1/install/lib
> 
> If you ever happen to want to link against installed libraries
> in a given directory, LIBDIR, you must either use libtool, and
> specify the full pathname of the library, or use the `-LLIBDIR'
> flag during linking and do at least one of the following:
>    - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
>      during execution
>    - add LIBDIR to the `LD_RUN_PATH' environment variable
>      during linking
>    - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
>    - have your system administrator add LIBDIR to `/etc/ld.so.conf'
> 
> See any operating system documentation about shared libraries for
> more information, such as the ld(1) and ld.so(8) manual pages.
> ----------------------------------------------------------------------
> 
> 
> 
> --------------------------------------------------------------------Libraries have been installed in:
>    /home/anassa/nitish/syslog-ng-3.7.1/install/lib/syslog-ng
> 
> If you ever happen to want to link against installed libraries
> in a given directory, LIBDIR, you must either use libtool, and
> specify the full pathname of the library, or use the `-LLIBDIR'
> flag during linking and do at least one of the following:
>    - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
>      during execution
>    - add LIBDIR to the `LD_RUN_PATH' environment variable
>      during linking
>    - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
>    - have your system administrator add LIBDIR to `/etc/ld.so.conf'
> 
> See any operating system documentation about shared libraries for
> more information, such as the ld(1) and ld.so(8) manual pages.
> ----------------------------------------------------------------------
> 
> 
> -Ubuntu:~/nitish/syslog-ng-3.7.1/install/lib$ gcc --version
> gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609
> Copyright (C) 2015 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> 
> My project got compiled in 'syslog-ng-3.7.1' folder on machine Ubuntu 16.04.
> 
> I have a different machine  with Ubuntu 14.04.I copied 'syslog-ng-3.7.1' folder on this machine (Ubuntu 14.04). In this machine I tried compiling my CGO project (Go and C) where my Go code is calling the C wrapper code that internally call syslog-ng api's.
> I have defined all the CFLAGS and LDFLAGS in my Go code for the run-timne dependencies. At the time of compilation it is failing with the following error:
> 
> Error
> =====
> 
> lib/../deps/syslog/syslog-ng-3.7.1/install/lib/libsyslog-ng.so: file not recognized: File truncated
> [11:36:44][shellscript] collect2: error: ld returned 1 exit status
> [11:36:44][shellscript] make: *** [main] Error 2
> 
> 
> The file 'libsyslog-ng.so' is present  at the  location 'lib/../deps/syslog/syslog-ng-3.7.1/install/lib/':
> 
> total 3152
> drwxrwxr-x 2 anassa anassa    4096 Feb  5 16:47 pkgconfig
> -rwxr-xr-x 1 anassa anassa 3208176 Feb  5 16:47 libsyslog-ng-3.7.so.0.0.0
> lrwxrwxrwx 1 anassa anassa      25 Feb  5 16:47 libsyslog-ng.so -> libsyslog-ng-3.7.so.0.0.0
> -rwxr-xr-x 1 anassa anassa    1155 Feb  5 16:47 libsyslog-ng.la<https://nam05.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibsyslog-ng.la&data=02%7C01%7CPeter.Kokai%40oneidentity.com%7C0a9ab8afa67a4c47891908d7aa3291d6%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637165006496910785&sdata=%2BCP70RsY0LJmfH0K%2FEy5bhxD6HKgzNU4FEdiMCaccTI%3D&reserved=0>
> lrwxrwxrwx 1 anassa anassa      25 Feb  5 16:47 libsyslog-ng-3.7.so.0 -> libsyslog-ng-3.7.so.0.0.0
> drwxrwxr-x 3 anassa anassa    4096 Feb  5 16:47 python2.7
> drwxrwxr-x 3 anassa anassa    4096 Feb  5 16:47 syslog-ng
> 
> Can someone please guide me what could be the possible reasons to get this error ? What am I missing here ?
> 
> 
> Thanks,
> Nitish


> ______________________________________________________________________________
> Member info: https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.balabit.hu%2Fmailman%2Flistinfo%2Fsyslog-ng&data=02%7C01%7CPeter.Kokai%40oneidentity.com%7C0a9ab8afa67a4c47891908d7aa3291d6%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637165006496960760&sdata=1Q%2FUex04eQ4kDcQoGwIm%2FersEqit7W8qil6aEC20lag%3D&reserved=0
> Documentation: https://nam05.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fsupport%2Fdocumentation%2F%3Fproduct%3Dsyslog-ng&data=02%7C01%7CPeter.Kokai%40oneidentity.com%7C0a9ab8afa67a4c47891908d7aa3291d6%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637165006496960760&sdata=Od7XVpPtuxyu8igzSjXrLhJ5iuVjIDV9sjSOSy3Oxic%3D&reserved=0
> FAQ: https://nam05.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.balabit.com%2Fwiki%2Fsyslog-ng-faq&data=02%7C01%7CPeter.Kokai%40oneidentity.com%7C0a9ab8afa67a4c47891908d7aa3291d6%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637165006496960760&sdata=vKLhRgRAQqEruzIYWW7m3zIyWOY4FBKlMHlVNBaYVho%3D&reserved=0
> 


More information about the syslog-ng mailing list