Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 765799 - net-libs/pjproject - build failure with parallel build
Summary: net-libs/pjproject - build failure with parallel build
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jaco Kroon
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: parallel-make
  Show dependency tree
 
Reported: 2021-01-17 19:58 UTC by Ed Wildgoose
Modified: 2022-06-16 15:35 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Wildgoose 2021-01-17 19:58:35 UTC
I'm seeing a build failure in some circumstances with building with -j24 for parallel builds

Specific platform seems to make it more likely to trigger, eg I see it happen on x86, but not on amd64 or a qemu-arm chroot. Seems pretty predictable on the x86 chroot though. 

Setting compile flags to -j1 allows the build to complete (on all platforms).

It looks as though there is a non explicit dependency in part of the make, with something like libpjsua2.so needing to link with pjsua.so ?

I'm not sure how best to resolve this? How would I filter the compile flags to remove the "-j"? 

Snippet of the error below. Would it be useful to post the whole build log?



gcc-ranlib ../lib/libpjsua2-i686-gentoo-linux-musl.a
make[2]: Leaving directory '/var/tmp/portage/net-libs/pjproject-2.10/work/pjproject-2.10/pjsip/build'
make -f /var/tmp/portage/net-libs/pjproject-2.10/work/pjproject-2.10/build/rules.mak APP=PJSUA2_LIB app=pjsua2-lib ../lib/libpjsua2.so
make[2]: Entering directory '/var/tmp/portage/net-libs/pjproject-2.10/work/pjproject-2.10/pjsip/build'
if test ! -d ../lib; then mkdir -p ../lib; fi
i686-gentoo-linux-musl-gcc -o ../lib/libpjsua2.so.2 \
     output/pjsua2-lib-i686-gentoo-linux-musl/account.o  output/pjsua2-lib-i686-gentoo-linux-musl/endpoint.o  output/pjsua2-lib-i686-gentoo-linux-musl/json.o  output/pjsua2-lib-i686-gentoo-linux-musl/persistent.o  output/pjsua2-lib-i686-gentoo-linux-musl/types.o  output/pjsua2-lib-i686-gentoo-linux-musl/siptypes.o  output/pjsua2-lib-i686-gentoo-linux-musl/call.o  output/pjsua2-lib-i686-gentoo-linux-musl/presence.o  output/pjsua2-lib-i686-gentoo-linux-musl/media.o -lpjsua -lpjsip-ua -lpjsip-simple -lpjsip -lpjmedia-audiodev -lpjmedia-videodev -lpjmedia-codec -lpjmedia -lpjnath -lpjlib-util -lpj  -lilbccodec -lg7221codec  -lsrtp2 -lgsm  -Wl,-O1 -Wl,--as-needed -lssl -lcrypto -luuid -lm -lrt -lpthread  -lasound   -L/var/tmp/portage/net-libs/pjproject-2.10/work/pjproject-2.10/pjlib/lib -L/var/tmp/portage/net-libs/pjproject-2.10/work/pjproject-2.10/pjlib-util/lib -L/var/tmp/portage/net-libs/pjproject-2.10/work/pjproject-2.10/pjnath/lib -L/var/tmp/portage/net-libs/pjproject-2.10/work/pjproject-2.10/pjmedia/lib -L/var/tmp/portage/net-libs/pjproject-2.10/work/pjproject-2.10/pjsip/lib -L/var/tmp/portage/net-libs/pjproject-2.10/work/pjproject-2.10/third_party/lib           -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed  -lstdc++ -shared -Wl,-soname,libpjsua2.so.2
/usr/lib/gcc/i686-gentoo-linux-musl/9.3.0/../../../../i686-gentoo-linux-musl/bin/ld: cannot find -lpjsua
collect2: error: ld returned 1 exit status
make[2]: *** [/var/tmp/portage/net-libs/pjproject-2.10/work/pjproject-2.10/build/rules.mak:113: ../lib/libpjsua2.so.2] Error 1
make[2]: Leaving directory '/var/tmp/portage/net-libs/pjproject-2.10/work/pjproject-2.10/pjsip/build'
make[1]: *** [Makefile:266: libpjsua2.so] Error 2
make[1]: *** Waiting for unfinished jobs....
ln -sf libpjsua.so.2 ../lib/libpjsua.so
make[2]: Leaving directory '/var/tmp/portage/net-libs/pjproject-2.10/work/pjproject-2.10/pjsip/build'
make[1]: Leaving directory '/var/tmp/portage/net-libs/pjproject-2.10/work/pjproject-2.10/pjsip/build'
make: *** [Makefile:14: all] Error 1
 * ERROR: net-libs/pjproject-2.10::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=net-libs/pjproject-2.10::gentoo'`,
Comment 1 Jaco Kroon 2021-02-12 08:27:09 UTC
I think you're right, looks like a missing dep in one of the sub folders.  Will investigate, but would you mind please filing a bug upstream so long and referencing that here?
Comment 2 Jaco Kroon 2021-02-12 08:32:27 UTC
Before you do that ... build.log please.  Looks like this is configuration dependent.  I've started make clean && make -j24 in a loop now and it's been running for a few iterations now without issue (default ./configure), so whilst I agree that there is a missing dep, it's not quite as trivial as I had hoped.
Comment 3 Ed Wildgoose 2021-02-12 10:39:30 UTC
Hi, I can get a full build log shortly, however, I *think* my original snippet narrows down the problem. Note that for me it *only* occurs when compiling on x86 and I build all platforms using quite similar profiles, so its less likely to be a config issue.

My read of the error is that it wants:
   cannot find -lpjsua
...while it's building libpjsua2.so

So my read of that was it was building both in parallel and the race was whether one finished building before the other? No?
Comment 4 Jaco Kroon 2021-02-12 14:20:16 UTC
(In reply to Ed Wildgoose from comment #3)
> Hi, I can get a full build log shortly, however, I *think* my original
> snippet narrows down the problem. Note that for me it *only* occurs when
> compiling on x86 and I build all platforms using quite similar profiles, so
> its less likely to be a config issue.

Agreed, but I still need a way to reproduce to confirm the fix.

> My read of the error is that it wants:
>    cannot find -lpjsua
> ...while it's building libpjsua2.so

Happy, so likely we need to add a "libpjsua2.so : libpjsua.so" somewhere...

> So my read of that was it was building both in parallel and the race was
> whether one finished building before the other? No?

race implies missing dependency.
Comment 5 Jaco Kroon 2021-03-14 22:09:11 UTC
Ed,

I just spent some time on this - are you still able to reproduce reliably?

Kind Regards,
Jaco
Comment 6 Ed Wildgoose 2021-03-14 23:21:18 UTC
Apologies. Bear with me. We are racing to go live with the project and I'm working umpteen hours a day to finish coding.

Nothing has changed, so yes, I believe I can still repro this consistently. However, it's only on certain platforms that I see it. I didn't think that was significant, but could be?

Ed
Comment 7 Jaco Kroon 2021-03-15 10:57:18 UTC
(In reply to Ed Wildgoose from comment #6)
> Apologies. Bear with me. We are racing to go live with the project and I'm
> working umpteen hours a day to finish coding.

No worries.  The fact that I only managed to spend an hour or two on this yesterday should testify to the fact that I've got understanding for that.

> Nothing has changed, so yes, I believe I can still repro this consistently.

Please do confirm.  I was telling Sam as much last night about no changes but I can't reproduce.  The error does seem very valid though.  Had another pjsip issue which turns out was a toolchain issue (missing headers), so I've seen my share of weirdness.


> However, it's only on certain platforms that I see it. I didn't think that
> was significant, but could be?

I agree I don't see *how*.  However, I'm struggling to reproduce ... I've recompiled pjsip probably 20 times last night on my laptop with anything ranging from make -j16 through to make -j100 ... and not a single failure.  amd64.

Kind Regards,
Jaco
Comment 8 Sergey 'L29Ah' Alirzaev 2021-12-06 00:18:17 UTC
It reproduces consistently (well, five times in a row, and after that i gave up and did -j1) on my machine with -j9.
Comment 9 Jaco Kroon 2021-12-06 10:26:03 UTC
(In reply to Sergey 'L29Ah' Alirzaev from comment #8)
> It reproduces consistently (well, five times in a row, and after that i gave
> up and did -j1) on my machine with -j9.

Could you please indicate exact version, and error please?

I know this is a problem, but can't seem to pinpoint the exact issue.
Comment 10 Jaco Kroon 2022-06-09 20:17:42 UTC
Once merged, please test pjproject-2.12.1.
Comment 11 Larry the Git Cow gentoo-dev 2022-06-15 13:32:18 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74bc4476b50218718af7c43038176f1d69c50e61

commit 74bc4476b50218718af7c43038176f1d69c50e61
Author:     Jaco Kroon <jaco@uls.co.za>
AuthorDate: 2021-07-24 08:36:57 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2022-06-15 13:32:11 +0000

    net-libs/pjproject: Version 2.12.1.
    
    Upstream release.
    
    Remove the need for custom patches (which is still required but no
    longer applies, instead, rely on ./configure detecting openssl, we do
    depend on it, and only --disable-ssl works, passing --enable-ssl also
    effectively disables ssl).
    
    Compile tested asterisk 13, 16 and 18 (in-tree versions) against this.
    Would appreciate a double-check on this one.  One version from each is
    sufficient.
    
    Since the two libraries that were the target of parallel build failures
    are now one, I believe the parallel build issue is fixed too.
    
    Included patch for CVE-2022-31031
    
    Closes: https://bugs.gentoo.org/833765
    Closes: https://bugs.gentoo.org/817803
    Closes: https://bugs.gentoo.org/808099
    Closes: https://bugs.gentoo.org/834491
    Bug: https://bugs.gentoo.org/803614
    Bug: https://bugs.gentoo.org/765799
    Bug: https://bugs.gentoo.org/829894
    Package-Manager: Portage-3.0.20, Repoman-3.0.2
    Signed-off-by: Jaco Kroon <jaco@uls.co.za>
    Closes: https://github.com/gentoo/gentoo/pull/21761
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 net-libs/pjproject/Manifest                        |   1 +
 .../files/pjproject-2.12.1-CVE-2022-31031.patch    |  41 +++++++
 net-libs/pjproject/pjproject-2.12.1.ebuild         | 125 +++++++++++++++++++++
 3 files changed, 167 insertions(+)
Comment 12 Jaco Kroon 2022-06-16 15:35:18 UTC
Ed,

I've decided I'm going to close this after all, please advise if you can still reproduce.

Kind Regards,
Jaco