tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Bug: segfault when running empty file on tcc-0.9.26-w


From: grischka
Subject: Re: [Tinycc-devel] Bug: segfault when running empty file on tcc-0.9.26-win64
Date: Wed, 05 Jul 2017 13:08:35 +0200
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

André Willik Valenti wrote:
It happened using binaries from
http://download.savannah.gnu.org/releases/tinycc/.

0,9,26 is rather old.  You might want to try the 'mob' branch
from http://repo.or.cz/w/tinycc.git which we'll use for next
release -- hopefully soon ;)

-- gr

Tried also via libtcc and the same happened: on win32, it works fine; on
win64, a segfault happens. Here's the code:


#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include "libtcc.h"

char my_program[] = "\n";

int main(int argc, char **argv)
{
    TCCState *s = tcc_new();
    tcc_set_output_type(s, TCC_OUTPUT_MEMORY);
    tcc_compile_string(s, my_program);
    tcc_relocate(s, TCC_RELOCATE_AUTO); // <-- segfault here
    return 0;
}


2017-07-05 0:18 GMT-03:00 André Willik Valenti <address@hidden>:

Hello,

I believe I've found a bug. It happens on 64-bit version of tcc for
Windows. No problems were found on 32-bit Windows or 64-bit Linux
(installed from apt-get).

To reproduce, run on a terminal:

REM Creates an empty file
type nul > empty.c

REM win32 tcc works normally
win32\tcc empty.c
tcc: error: undefined symbol 'main'

REM win32 tcc works normally
win32\tcc -run empty.c
tcc: error: main not defined

REM win64 tcc works normally when generating file output
win64\tcc empty.c
tcc: error: undefined symbol 'main'

REM ...but crashes with a segfault when running source code directly
win64\tcc -run empty.c


The same happens with a file containing just

#

or

#inclu


Regards,
André



reply via email to

[Prev in Thread] Current Thread [Next in Thread]