Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1862809 - ./ssh.c:165:9: internal compiler error: Segmentation fault
Summary: ./ssh.c:165:9: internal compiler error: Segmentation fault
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1863455
TreeView+ depends on / blocked
 
Reported: 2020-08-02 18:35 UTC by Robert Scheck
Modified: 2020-10-05 08:33 UTC (History)
10 users (show)

Fixed In Version: gcc-10.2.1-2.fc33
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-08-06 23:03:42 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Robert Scheck 2020-08-02 18:35:45 UTC
Description of problem:
I'm not sure if this is really a GCC issue, but I believe so.

Version-Release number of selected component (if applicable):
gcc-10.2.1-1.fc33
annobin-9.27-1.fc33

How reproducible:
Try to rebuild dsniff-2.4-0.33.b1.fc33 for Fedora 33 (while it works for Fedora 32 as expected).

Actual results:
./ssh.c:165:9: internal compiler error: Segmentation fault

Expected results:
Working rebuild.

Additional info:
[...]
./ssh.c: In function 'SSH_accept':
./ssh.c:252:9: warning: passing argument 1 of 'put_bn' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  252 |  put_bn(servkey_e, &p);    /* servkey exponent */
      |         ^~~~~~~~~
./ssh.c:92:16: note: expected 'BIGNUM *' {aka 'struct bignum_st *'} but argument is of type 'const BIGNUM *' {aka 'const struct bignum_st *'}
   92 | put_bn(BIGNUM *bn, u_char **pp)
      |        ~~~~~~~~^~
./ssh.c:253:9: warning: passing argument 1 of 'put_bn' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  253 |  put_bn(servkey_n, &p);    /* servkey modulus */
      |         ^~~~~~~~~
./ssh.c:92:16: note: expected 'BIGNUM *' {aka 'struct bignum_st *'} but argument is of type 'const BIGNUM *' {aka 'const struct bignum_st *'}
   92 | put_bn(BIGNUM *bn, u_char **pp)
      |        ~~~~~~~~^~
./ssh.c:261:9: warning: passing argument 1 of 'put_bn' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  261 |  put_bn(hostkey_e, &p);    /* hostkey exponent */
      |         ^~~~~~~~~
./ssh.c:92:16: note: expected 'BIGNUM *' {aka 'struct bignum_st *'} but argument is of type 'const BIGNUM *' {aka 'const struct bignum_st *'}
   92 | put_bn(BIGNUM *bn, u_char **pp)
      |        ~~~~~~~~^~
./ssh.c:262:9: warning: passing argument 1 of 'put_bn' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  262 |  put_bn(hostkey_n, &p);    /* hostkey modulus */
      |         ^~~~~~~~~
./ssh.c:92:16: note: expected 'BIGNUM *' {aka 'struct bignum_st *'} but argument is of type 'const BIGNUM *' {aka 'const struct bignum_st *'}
   92 | put_bn(BIGNUM *bn, u_char **pp)
      |        ~~~~~~~~^~
./ssh.c:342:34: warning: passing argument 2 of 'ssh_session_id' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  342 |  if ((p = ssh_session_id(cookie, hostkey_n,
      |                                  ^~~~~~~~~
./ssh.c:122:40: note: expected 'BIGNUM *' {aka 'struct bignum_st *'} but argument is of type 'const BIGNUM *' {aka 'const struct bignum_st *'}
  122 | ssh_session_id(u_char *cookie, BIGNUM *hostkey_n, BIGNUM *servkey_n)
      |                                ~~~~~~~~^~~~~~~~~
./ssh.c:343:5: warning: passing argument 3 of 'ssh_session_id' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  343 |     servkey_n)) == NULL) {
      |     ^~~~~~~~~
./ssh.c:122:59: note: expected 'BIGNUM *' {aka 'struct bignum_st *'} but argument is of type 'const BIGNUM *' {aka 'const struct bignum_st *'}
  122 | ssh_session_id(u_char *cookie, BIGNUM *hostkey_n, BIGNUM *servkey_n)
      |                                                   ~~~~~~~~^~~~~~~~~
*** WARNING *** there are active plugins, do not report this as a bug unless you can reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_FINISH_UNIT               | annobin: Generate final annotations
PLUGIN_START_UNIT                | annobin: Generate global annotations
PLUGIN_ALL_PASSES_START          | annobin: Generate per-function annotations
PLUGIN_ALL_PASSES_END            | annobin: Register per-function end symbol
during RTL pass: expand
./ssh.c: In function 'SSH_send':
./ssh.c:165:9: internal compiler error: Segmentation fault
  165 |   res = (f) (fd, s + pos, n - pos);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
The bug is not reproducible, so it is likely a hardware or OS problem.
make: *** [Makefile:76: ssh.o] Error 1

Comment 1 Robert Scheck 2020-08-02 18:37:55 UTC
Nick, is this the same (similar?) like bug #1862297 but for Fedora 33 rather 32?

Comment 2 Jeff Law 2020-08-02 19:26:07 UTC
Nope, completely different.  1862297 was a mismatch between annobin and gcc.  This is a GCC fault.  There's not enough information to even hazard a guess what might be going wrong here or to guide you on how to get the data Jakub would need to reproduce, analyze and fix this issue.  A pointer to the koji failure would help significantly.

Comment 3 Robert Scheck 2020-08-02 19:38:21 UTC
(In reply to Jeff Law from comment #2)
> A pointer to the koji failure would help significantly.

https://koji.fedoraproject.org/koji/taskinfo?taskID=48455276 (https://koji.fedoraproject.org/koji/taskinfo?taskID=48456040 is the same against F32).

Comment 4 Jeff Law 2020-08-02 20:24:08 UTC
Thanks.  Based on those logs I believe you have at least two distinct issues.

First, I believe you have missing dependencies in your Makefiles which result in trying to reference libmissing before it has been built.  I would fix this first.

Second, it looks like you're triggering a fault in GCC itself.  Once you've fixed the libmissing issue I would suggest trying to build without LTO and see if the GCC fault is still triggered or not.

Comment 5 Robert Scheck 2020-08-05 00:56:36 UTC
Okay, https://koji.fedoraproject.org/koji/taskinfo?taskID=48684629 should work around the libmissing issue, but still fails with a segmentation fault. What's the correct way to build without LTO? https://fedoraproject.org/wiki/LTOByDefault just says "There will be a simple way for packages to opt-out of LTO", but doesn't mention which way.

Comment 6 Jakub Jelinek 2020-08-06 11:00:22 UTC
%global _lto_cflags %{nil}
is the standard way to opt-out of LTO.

Comment 7 Robert Scheck 2020-08-06 22:18:48 UTC
Thank you! For https://koji.fedoraproject.org/koji/taskinfo?taskID=48838418 I opt-outed LTO...and it succeeded. The libmissing issue can be worked around with '%global _smp_flags -j1' or similar (maybe I'll find the missing dependency in the Makefiles. So, that leaves us now with a GCC fault, if I got Jeff right?

Comment 8 Robert Scheck 2020-08-06 23:03:42 UTC
Nope, my comment #7 is wrong. It's gcc-10.2.1-1.fc33 -> gcc-10.2.1-2.fc33, which solves this issue.


Note You need to log in before you can comment on or make changes to this bug.