Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[arm64]disable snmp's parallel make for now, because it causes compile fail with file truncated #6592

Merged
merged 1 commit into from
Feb 1, 2021

Conversation

guxianghong
Copy link
Contributor

Disable snmp's parallel make for now, because it causes compile fail with file truncated.

- Why I did it
snmpd's compile is always failed with file truncated on ARM64 arch, the error log is like "/usr/bin/ld: mibgroup/ip-forward-mib/inetCidrRouteTable/.libs/inetCidrRouteTable_interface.o: file not recognized: file truncated"

- How I did it
Disable snmp's parallel make for now on ARM64 compile.

- How to verify it
make configure PLATFORM=centec-arm64 PLATFORM_ARCH=arm64
make target/debs/buster/libsnmp-base_5.7.3+dfsg-5_all.deb NOSTRETCH=1

- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@lguohan
Copy link
Collaborator

lguohan commented Jan 28, 2021

do we know the reason?

@guxianghong
Copy link
Contributor Author

do we know the reason?

The direct cause is different jobs compile same file at the same time, ld use the truncated object file. see the log(from https://sonic-jenkins.westus2.cloudapp.azure.com/job/centec/job/buildimage-centec-arm64-all/40/consoleText):
[2021-01-28T10:00:57.948Z] libtool: compile: gcc -I../include -I. -I../agent -I../agent/mibgroup -I/usr/include/libnl3 -I../snmplib -I/usr/include/libnl3 -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -g -O2 -fdebug-prefix-map=/sonic/src/snmpd/net-snmp-5.7.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -DNETSNMP_USE_INLINE -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/aarch64-linux-gnu/perl/5.28/CORE -c mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c -o mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.o >/dev/null 2>&1
...
[2021-01-28T10:00:57.951Z] libtool: compile: gcc -I../../include -I. -I../../agent -I../../agent/mibgroup -I/usr/include/libnl3 -I../../snmplib -I/usr/include/libnl3 -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -g -O2 -fdebug-prefix-map=/sonic/src/snmpd/net-snmp-5.7.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -DNETSNMP_USE_INLINE -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/aarch64-linux-gnu/perl/5.28/CORE -c ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c -fPIC -DPIC -o ip-forward-mib/inetCidrRouteTable/.libs/inetCidrRouteTable_interface.o
...
[2021-01-28T10:00:57.954Z] /usr/bin/ld: mibgroup/ip-forward-mib/inetCidrRouteTable/.libs/inetCidrRouteTable_interface.o: file not recognized: file truncated
...
[2021-01-28T10:00:57.954Z] libtool: compile: gcc -I../../include -I. -I../../agent -I../../agent/mibgroup -I/usr/include/libnl3 -I../../snmplib -I/usr/include/libnl3 -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -g -O2 -fdebug-prefix-map=/sonic/src/snmpd/net-snmp-5.7.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -DNETSNMP_USE_INLINE -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/aarch64-linux-gnu/perl/5.28/CORE -c ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c -o ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.o >/dev/null 2>&1

@lguohan
Copy link
Collaborator

lguohan commented Jan 29, 2021

is this only arm64 problem or it is a generic problem? looks like a generic problem, then we should disable the paralledl build for all platforms.

@guxianghong
Copy link
Contributor Author

is this only arm64 problem or it is a generic problem?

It should be a generic problem. ARM64 compile is much more slower than x86, the problem has a very high probability of occurrence. I'm not yet carefully analyzed why hasn't this question come out before. It suspected to be related to the PR #6408 changes.

@lguohan
Copy link
Collaborator

lguohan commented Jan 29, 2021

since it is generic, can disable for the parallel build for all platforms?

@guxianghong
Copy link
Contributor Author

guxianghong commented Jan 30, 2021

since it is generic, can disable for the parallel build for all platforms?

I looked into this problem again. it seems this problem only occurs on ARM64.

On x86 platform, the object ".libs/inetCidrRouteTable_interface.o" is compiled once(From the compile log https://sonic-jenkins.westus2.cloudapp.azure.com/job/centec/job/buildimage-centec-all/186/artifact/target/debs/buster/libsnmp-base_5.7.3+dfsg-5_all.deb.log):
libtool: compile: gcc -I../include -I. -I../agent -I../agent/mibgroup -I/usr/include/libnl3 -I../snmplib -I/usr/include/libnl3 -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -g -O2 -fdebug-prefix-map=/sonic/src/snmpd/net-snmp-5.7.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -DNETSNMP_USE_INLINE -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/x86_64-linux-gnu/perl/5.28/CORE -c mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c -fPIC -DPIC -o mibgroup/ip-forward-mib/inetCidrRouteTable/.libs/inetCidrRouteTable_interface.o

On armhf platform, the object ".libs/inetCidrRouteTable_interface.o" is also compiled once (From compile log https://sonic-jenkins.westus2.cloudapp.azure.com/job/marvell/job/buildimage-mrvl-armhf-all/54/artifact/target/debs/buster/libsnmp-base_5.7.3+dfsg-5_all.deb.log):
libtool: compile: gcc -I../include -I. -I../agent -I../agent/mibgroup -I/usr/include/libnl3 -I../snmplib -I/usr/include/libnl3 -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -g -O2 -fdebug-prefix-map=/sonic/src/snmpd/net-snmp-5.7.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -DNETSNMP_USE_INLINE -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/arm-linux-gnueabihf/perl/5.28/CORE -c mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c -fPIC -DPIC -o mibgroup/ip-forward-mib/inetCidrRouteTable/.libs/inetCidrRouteTable_interface.o

But on ARM64 platform, the object ".libs/inetCidrRouteTable_interface.o" is compiled twice.(From the compile log https://sonic-jenkins.westus2.cloudapp.azure.com/job/centec/job/buildimage-centec-arm64-all/40/consoleText):
[2021-01-28T10:00:57.944Z] libtool: compile: gcc -I../include -I. -I../agent -I../agent/mibgroup -I/usr/include/libnl3 -I../snmplib -I/usr/include/libnl3 -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -g -O2 -fdebug-prefix-map=/sonic/src/snmpd/net-snmp-5.7.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -DNETSNMP_USE_INLINE -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/aarch64-linux-gnu/perl/5.28/CORE -c mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c -fPIC -DPIC -o mibgroup/ip-forward-mib/inetCidrRouteTable/.libs/inetCidrRouteTable_interface.o
[2021-01-28T10:00:57.951Z] libtool: compile: gcc -I../../include -I. -I../../agent -I../../agent/mibgroup -I/usr/include/libnl3 -I../../snmplib -I/usr/include/libnl3 -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -g -O2 -fdebug-prefix-map=/sonic/src/snmpd/net-snmp-5.7.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -DNETSNMP_USE_INLINE -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/aarch64-linux-gnu/perl/5.28/CORE -c ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c -fPIC -DPIC -o ip-forward-mib/inetCidrRouteTable/.libs/inetCidrRouteTable_interface.o
...
[2021-01-28T10:00:57.954Z] /usr/bin/ld: mibgroup/ip-forward-mib/inetCidrRouteTable/.libs/inetCidrRouteTable_interface.o: file not recognized: file truncated

snmpd's makefile is changed in PR #6408. before this change, snmpd's dh_auto_build use "make -j1" to build(https://sonic-jenkins.westus2.cloudapp.azure.com/job/centec/job/buildimage-centec-arm64-all/lastSuccessfulBuild/artifact/target/debs/buster/libsnmp-base_5.7.3+dfsg-5_all.deb.log); After this change, dh_auto_build use parallel build.

Then, I suggest disable parallel build only for ARM64.

@lguohan lguohan merged commit 4421a68 into sonic-net:master Feb 1, 2021
lguohan pushed a commit that referenced this pull request Feb 3, 2021
snmpd's compile is always failed with file truncated on ARM64 arch, the error log is like "/usr/bin/ld: mibgroup/ip-forward-mib/inetCidrRouteTable/.libs/inetCidrRouteTable_interface.o: file not recognized: file truncated"

Co-authored-by: Xianghong Gu <xgu@centecnetworks.com>
deran1980 pushed a commit to deran1980/sonic-buildimage that referenced this pull request Feb 4, 2021
snmpd's compile is always failed with file truncated on ARM64 arch, the error log is like "/usr/bin/ld: mibgroup/ip-forward-mib/inetCidrRouteTable/.libs/inetCidrRouteTable_interface.o: file not recognized: file truncated"

Co-authored-by: Xianghong Gu <xgu@centecnetworks.com>
lguohan pushed a commit that referenced this pull request Aug 4, 2021
I have been seeing intermittent (~40%) build failures with the same error described in PR #6592, even with that fix present

```
/usr/bin/ld: mibgroup/ip-forward-mib/ipCidrRouteTable/.libs/ipCidrRouteTable_interface.o: file not recognized: file truncated
...
libtool:   error: 'mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.lo' is not a valid libtool object
make[5]: *** [Makefile:1020: libnetsnmpmibs.la] Error 1
make[5]: *** Waiting for unfinished jobs....
```

#### How I did it

Use `-j1` for the libsnmp build regardless of the value of `$(MULTIARCH_QEMU_ENVIRON)`

#### How to verify it

Performed 10 builds of the libsnmp target (`target/debs/buster/libsnmp-base_5.7.3+dfsg-5_all.deb`) with and without this change. Without the change, hit the error 40% of the time. With the change did not see the error at all

Signed-off-by: Justin Sherman <jusherma@cisco.com>
qiluo-msft pushed a commit that referenced this pull request Aug 5, 2021
I have been seeing intermittent (~40%) build failures with the same error described in PR #6592, even with that fix present

```
/usr/bin/ld: mibgroup/ip-forward-mib/ipCidrRouteTable/.libs/ipCidrRouteTable_interface.o: file not recognized: file truncated
...
libtool:   error: 'mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.lo' is not a valid libtool object
make[5]: *** [Makefile:1020: libnetsnmpmibs.la] Error 1
make[5]: *** Waiting for unfinished jobs....
```

#### How I did it

Use `-j1` for the libsnmp build regardless of the value of `$(MULTIARCH_QEMU_ENVIRON)`

#### How to verify it

Performed 10 builds of the libsnmp target (`target/debs/buster/libsnmp-base_5.7.3+dfsg-5_all.deb`) with and without this change. Without the change, hit the error 40% of the time. With the change did not see the error at all

Signed-off-by: Justin Sherman <jusherma@cisco.com>
judyjoseph pushed a commit that referenced this pull request Aug 7, 2021
I have been seeing intermittent (~40%) build failures with the same error described in PR #6592, even with that fix present

```
/usr/bin/ld: mibgroup/ip-forward-mib/ipCidrRouteTable/.libs/ipCidrRouteTable_interface.o: file not recognized: file truncated
...
libtool:   error: 'mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.lo' is not a valid libtool object
make[5]: *** [Makefile:1020: libnetsnmpmibs.la] Error 1
make[5]: *** Waiting for unfinished jobs....
```

#### How I did it

Use `-j1` for the libsnmp build regardless of the value of `$(MULTIARCH_QEMU_ENVIRON)`

#### How to verify it

Performed 10 builds of the libsnmp target (`target/debs/buster/libsnmp-base_5.7.3+dfsg-5_all.deb`) with and without this change. Without the change, hit the error 40% of the time. With the change did not see the error at all

Signed-off-by: Justin Sherman <jusherma@cisco.com>
carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
…#8324)

I have been seeing intermittent (~40%) build failures with the same error described in PR sonic-net#6592, even with that fix present

```
/usr/bin/ld: mibgroup/ip-forward-mib/ipCidrRouteTable/.libs/ipCidrRouteTable_interface.o: file not recognized: file truncated
...
libtool:   error: 'mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.lo' is not a valid libtool object
make[5]: *** [Makefile:1020: libnetsnmpmibs.la] Error 1
make[5]: *** Waiting for unfinished jobs....
```

#### How I did it

Use `-j1` for the libsnmp build regardless of the value of `$(MULTIARCH_QEMU_ENVIRON)`

#### How to verify it

Performed 10 builds of the libsnmp target (`target/debs/buster/libsnmp-base_5.7.3+dfsg-5_all.deb`) with and without this change. Without the change, hit the error 40% of the time. With the change did not see the error at all

Signed-off-by: Justin Sherman <jusherma@cisco.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants