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

segmentation fault on any code compiled by tcc with libc6 2.21-4



Control: retitle -1 segmentation fault on any code compiled by tcc with libc6 2.21-4

Cc to the glibc maintainers because the cause of the bug is due to
some change in glibc.

On 2015-12-15 09:35:04 +0100, Vincent Lefevre wrote:
> Code compiled by tcc segfaults:
> 
> ypig% cat conftest.c 
> int main (void)
> { return 0; }
> ypig% tcc conftest.c -o conftest
> ypig% ./conftest 
> zsh: segmentation fault (core dumped)  ./conftest

The cause is libc6 2.21. I get this problem with libc6 2.21-4,
but on another machine, after reverting to libc6 2.19-22, this
problem no longer occurs. So, I wonder whether this is a tcc
bug or a glibc one.

In the "objdump -S" output of conftest, I notice the following
difference:

libc6 2.19:

0000000000400430 <_init>:
  400430:       48 83 ec 08             sub    $0x8,%rsp
  400434:       48 8b 05 4d 01 20 00    mov    0x20014d(%rip),%rax        # 600588 <_init+0x200158>
[...]

libc6 2.21:

00000000004003f0 <_init>:
  4003f0:       48 83 ec 08             sub    $0x8,%rsp
  4003f4:       48 8b 05 00 00 00 00    mov    0x0(%rip),%rax        # 4003fb <_init+0xb>

The 0x20014d(%rip) has changed to 0x0(%rip).

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


Reply to: