Bug 24246

Summary: tcc segfaults when writing output file.
Product: Mageia Reporter: Alan Richter <arichter>
Component: RPM PackagesAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal CC: geiger.david68210, marja11
Version: Cauldron   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: tcc-0.9.27-4.mga7.src.rpm CVE:
Status comment:

Description Alan Richter 2019-01-26 23:15:37 CET
Description of problem:
tcc -run <program.c> works but having tcc compile a .c program to an executable generates a segmentation violation in write_output().

Version-Release number of selected component (if applicable):
The ".git" code for tcc dated 20161217.

How reproducible:
Always.

Steps to Reproduce:
1. echo int main(void){} > crash.c
2. tcc crash.c
3.

Replacing the source tarball with the one from: http://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27.tar.bz2

and patching the "SPEC" file with:

--- tcc.spec.orig       2018-09-02 11:52:18.000000000 -0600
+++ tcc.spec    2019-01-26 15:01:53.000000000 -0700
@@ -1,6 +1,3 @@
-%define date 20161217
-%define git cd9514ab
-
 # (tv) fix build:
 %global _ssp_cflags %nil
 
@@ -11,7 +8,7 @@
 License:       GPL
 Group:         Development/C
 URL:           http://bellard.org/tcc/
-Source0:       http://download.savannah.nongnu.org/releases/tinycc/%{name}_%{version}~git%{date}.%{git}.tar.gz
+Source0:       http://download.savannah.nongnu.org/releases/tinycc/%{name}-%{version}.tar.bz2
 Patch0:                tcc-0.9.26-arm.patch
 BuildRequires: texinfo
 
@@ -21,7 +18,7 @@
 
 
 %prep
-%setup -q -n tinycc-%git
+%setup -q -n %{name}-%{version}
 %autopatch -p1
 
 # path fix

and rebuilding the rpm fixes the problem, tcc using the above tarball no longer crashes.
Comment 1 David GEIGER 2019-01-27 13:32:41 CET
Should be fixed with tcc-0.9.27-5.mga7!

CC: (none) => geiger.david68210

Comment 2 Marja Van Waes 2019-01-31 19:02:32 CET
(In reply to David GEIGER from comment #1)
> Should be fixed with tcc-0.9.27-5.mga7!

Thanks!

CC: (none) => marja11
Status: NEW => RESOLVED
Resolution: (none) => FIXED