FS#60868 - Runtime Error in C program causes Arch Linux to crash

Attached to Project: Arch Linux
Opened by Christofer Padilla (rockzombie2) - Tuesday, 20 November 2018, 06:34 GMT
Last edited by Dave Reisner (falconindy) - Tuesday, 20 November 2018, 06:41 GMT
Task Type Bug Report
Category Kernel
Status Closed
Assigned To No-one
Architecture x86_64
Severity Critical
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: As part of a homework assignment, I was given this c program. I compiled it using gcc from the command line. Running it crashed the system. I verified this was the cause by running the program again as soon as my computer rebooted again. I tried to debug it using gdb (after recompiling the file with the gcc -g) but it crashed at line 38:

return atoi(secret_number);

It might be worth mentioning that this file was saved on my NTFS hard drive. I mount it automatically in my fstab using ntfs-3g. I'm not sure if this is related though.

Additional info:
* gcc version: 8.2.1+20180831-1
* Kernel: x86_64 Linux 4.19.1-arch1-1-ARCH
* terminal: Termite 14-2
* ntfs-3g: 2017.3.23-3

Steps to reproduce:
1. Compile test.c with gcc
2. Run the output file from the terminal (./a.out)
   test.c (1.2 KiB)
This task depends upon

Closed by  Dave Reisner (falconindy)
Tuesday, 20 November 2018, 06:41 GMT
Reason for closing:  Not a bug
Comment by Dave Reisner (falconindy) - Tuesday, 20 November 2018, 06:41 GMT
There's nothing broken about this. Your program, through some obfuscation, "returns" the value of the function call:

system("telinit 6");

This reboots your machine.

Loading...