Bug 1482445 - coredump in ptx
Summary: coredump in ptx
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 26
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2017-08-17 09:45 UTC by Lukáš Zachar
Modified: 2017-08-24 03:51 UTC (History)
9 users (show)

Fixed In Version: coreutils-8.27-15.fc28 coreutils-8.27-15.fc27 coreutils-8.27-6.fc26
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-08-24 03:51:42 UTC
Type: Bug

Attachments (Terms of Use)
reproducer_file (13.91 KB, application/x-gzip)
2017-08-17 09:45 UTC, Lukáš Zachar
no flags Details
core (299.24 KB, application/x-gzip)
2017-08-17 09:46 UTC, Lukáš Zachar
no flags Details

Description Lukáš Zachar 2017-08-17 09:45:56 UTC
Created attachment 1314625 [details]

Description of problem:

ptx coredumps for particular input file. 

Version-Release number of selected component (if applicable):

How reproducible:
always with this file, probably more # CPU ? (could not reproduced in openstack)

Steps to Reproduce:
1. ptx reproducer_file

Actual results:
Segmentation fault (core dumped)

Additional info:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000000af3b98a2e9 in define_all_fields (occurs=0x7f587aac5e90) at ../src/ptx.c:1434
1434          SKIP_WHITE_BACKWARDS (cursor, buffer_start);
(gdb) bt
#0  0x000000af3b98a2e9 in define_all_fields (occurs=0x7f587aac5e90) at ../src/ptx.c:1434
#1  generate_all_output () at ../src/ptx.c:1780
#2  main (argc=<optimized out>, argv=<optimized out>) at ../src/ptx.c:2155

Comment 1 Lukáš Zachar 2017-08-17 09:46:28 UTC
Created attachment 1314627 [details]

Comment 2 Kamil Dudka 2017-08-17 11:08:59 UTC
Thank you for reporting the bug!  It seems to be cause by integer overflow.  The following patch fixes it:

--- a/src/ptx.c
+++ b/src/ptx.c
@@ -224,7 +224,7 @@ static BLOCK *text_buffers; /* files to study */
    start of the reference field, it is of type (DELTA) and usually
    negative.  */

-typedef short int DELTA;       /* to hold displacement within one context */
+typedef int DELTA;             /* to hold displacement within one context */

 typedef struct

Comment 3 Kamil Dudka 2017-08-17 11:54:22 UTC
proposed upstream:

Comment 4 Kamil Dudka 2017-08-18 15:49:12 UTC
upstream commit:

Comment 5 Kamil Dudka 2017-08-18 16:16:34 UTC
downstream commit:

Comment 6 Fedora Update System 2017-08-18 16:39:29 UTC
coreutils-8.27-6.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-a3eac38fa8

Comment 7 Lukáš Zachar 2017-08-21 11:09:27 UTC
Thanks a lot for such rapid turnaround.

Comment 8 Fedora Update System 2017-08-22 18:06:43 UTC
coreutils-8.27-6.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-a3eac38fa8

Comment 9 Fedora Update System 2017-08-24 03:51:42 UTC
coreutils-8.27-6.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

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