Compilation Error for ' assert '

Asked by Ahmed Rafiq-ul-Islam on 2013-04-16

Hello,

 I'm trying rohc-1.4.2 with openvpn-2.1.3 with the patch given. But I got stuck while trying to " make " under openvpn with error -

rohc.o: In function `openvpn_rohc_compress':
/usr/src/openvpn-2.1.3/rohc.c:146: undefined reference to `assert'
rohc.o: In function `openvpn_rohc_decompress':
/usr/src/openvpn-2.1.3/rohc.c:207: undefined reference to `assert'
collect2: ld returned 1 exit status

I've googled for related issue about assert - where including assert.h is the general solution. rohc.c already have assert.h file however, assert.h file is located into the include directory.

Any idea ??

Best Regards,

Question information

Language:
English Edit question
Status:
Answered
For:
rohc Edit question
Assignee:
No assignee Edit question
Last query:
2013-06-07
Last reply:
2013-06-08

Ahmed,

> I'm trying rohc-1.4.2 with openvpn-2.1.3 with the patch given. But I got stuck while
> trying to " make " under openvpn with error -
>
> rohc.o: In function `openvpn_rohc_compress':
> /usr/src/openvpn-2.1.3/rohc.c:146: undefined reference to `assert'
> rohc.o: In function `openvpn_rohc_decompress':
> /usr/src/openvpn-2.1.3/rohc.c:207: undefined reference to `assert'
> collect2: ld returned 1 exit status

Lines 146 and 207 refer to code that is enabled only if the constant DEBUG_ROHC is
defined. It is not by default.

Did you enable it? If so, the "#include <assert.h>" statement at line 31 should have
been enabled too at the same time. It then should build successfully. Example:
  $ make CFLAGS="-DDEBUG_ROHC=1" clean all

Or did you change the source code manually to enable those parts? If yes, change all
the lines where the DEBUG_ROHC constant is tested for.

Regards,
Didier

Ahmed Rafiq-ul-Islam (email-y) said : #2

Hello,
 Many thanks. That's worked perfectly. Sorry for late reply.

But getting " Segmentation fault (core dumped) " after sometimes. Where without ROHC its working fine.

Any experience ?

Ahmed,

> Many thanks. That's worked perfectly. Sorry for late reply.

You're welcome!

> But getting " Segmentation fault (core dumped) " after sometimes. Where without ROHC its working fine.
>
> Any experience ?

I do not experience such a problem myself. Some people reported similar problem to me. I failed to gather enough information to either reproduce the problem myself or find out the root of the problem. Would you like to help me finding it?

If yes, I need the coredump generated and the OpenVPN binary (with symbols not stripped). If the OpenVPN binary is a dynamic executable, please send me all the libraries that it depends on. Another possibility is to build a static OpenVPN binary, reproduce the problem with it, then only the OpenVPN binary is needed in addition to the core.

Please note that the Launchpad interface to ask questions does not accept files. Upload them to a file sharing service and give me the links here.

If you use certificate/password for authentication, they might be stored in the coredump. So, maybe you should reproduce the problem first with fake certificate/password to avoid publishing them.

Regards,
Didier

Ahmed Rafiq-ul-Islam (email-y) said : #4

Hello,
 Here is your required files.

http://www.mediafire.com/?9qio7d88v5jpdk2

Please let me know if anything required more.

> Here is your required files.
> Please let me know if anything required more.

Thanks. I need the following libraries:

 linux-gate.so.1
 libselinux.so.1
 libssl.so.10
 libcrypto.so.10
 liblzo2.so.2
 librohc_common.so.0
 librohc_comp.so.0
 librohc_decomp.so.0
 libm.so.6
 libdl.so.2
 libc.so.6

Regards,
Didier

Ahmed Rafiq-ul-Islam (email-y) said : #6

Hallo,
 Below are those files, except linux-gate-so.1.

http://www.mediafire.com/?tt5c5yjca1eb5je

and two log files

http://www.mediafire.com/?pio51xdczy6kvo3

Mfg
-rafiq...

Ahmed,

It seems that the crash is caused by mixed UDP/TCP traffic. There is one UDP packet encoded by context #N, then a TCP encoded on the same context #N (context re-use) because all contexts are used and context #N is the oldest one. I tried to reproduce the same behaviour on my system without any success. I need your help.

Could you please try running OpenVPN with the version 1.5.1 of the ROHC library [1] ? There were several changes on that part between 1.4.x and 1.5.x.
Between 1.4.x and 1.5.x, the API is compatible but the ABI is perhaps not, so build the 1.5.1 library, then rebuild the OpenVPN binary (make 'clean', then 'make all' in OpenVPN sources). The instructions for building and installing the 1.5.1 version of the ROHC library are also available [2].

Regards,
Didier

[1] https://launchpad.net/rohc/1.5.x/1.5.1#downloads
[2] http://rohc-lib.org/wiki/doku.php?id=library-install-sources#native_build_on_unix-like_systems

Launchpad Janitor (janitor) said : #8

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.

Ahmed Rafiq-ul-Islam (email-y) said : #9

Hello,
 Sorry for so late reply. Having two problem now -

1. theres no rohc.c file in latest version. I used old one with patched.

2. While doing ./configure - stopped by below error,

==============================================
   if test "x$as_val" = x""yes; then

else
  LPCAP="no"
fi
==============================================

I've checked same part of the configuration file of other version, which is exact similar with it.

Would you please have another look on it.

Mfg.

Hi Ahmed,

> 1. theres no rohc.c file in latest version. I used old one with patched.

The rohc.c in the ROHC library sources was renamed. Why do you need to modify it?

> 2. While doing ./configure - stopped by below error,

What options did you give to the ./configure script?

Regards,
Didier

 I don't know which file now contain rohc.c content. On patch file for openvpn and rohc, a part is to patch rohc.c.

I've used just ./configure , no option.

Ahmed,

Oh, you were talking about the rohc.c file in OpenVPN sources. Do not use newer OpenVPN versions, the patch won't work with them. Some work would be needed on that topic.

Use a newer ROHC version (1.5.1 or 1.5.2) with the old Openvpn version for testing.

Regards,
Didier

Didier,
 I'm using same openvpn-2.1.3 with rohc-1.5.1. But, I didn't found rohc.c file in version 1.5.1. Which i believe is a requirement to use ROHC with openvpn [ according the patch file]

So, I copied a rohc.c file from an older version of ROHC and try to compile - got failed with above error.

I'm now here till now.

Regards,

-Ahmed...

Ahmed,

The patch has to be applied on OpenVPN sources, not on ROHC sources:
  1/ download & untar rohc-1.5.1
  2/ cd rohc-1.5.1
  3/ ./configure --prefix=/usr && make clean all
  4/ make install # as root
  5/ cd ..
  6/ download & untar openvpn-2.1.3
  7/ cd openvpn-2.1.3
  8/ download ROHC patch for OpenVPN as openvpn-2.1-add_rohc_support_v2.patch
  9/ patch -p0 < openvpn-2.1-add_rohc_support_v2.patch
10/ ./configure --prefix=/usr <openvpn options> --enable-rohc
11/ make clean all
12/ make install # as root
13/ cd ..

Regards,
Didier

Can you help with this problem?

Provide an answer of your own, or ask Ahmed Rafiq-ul-Islam for more information if necessary.

To post a message you must log in.