syslog.1 file in UBUNTU consuming 48 GB space due to repetitive logging of console message from program made in C - Stack Overfl

admin2025-05-02  1

So from several days I get this message from disk Analyzer that only 100 MB space remaining on disk.

I have a 70 GB partition on disk on which I installed UBUNTU Linux. (Dual Boot with preinstalled Windows 11).

When I opened Disk Analyzer I saw that most of the space is occupied by syslog.1 file and that too 48 GB!

When I opened this file I saw regular system logs and after several lines of that I saw a strange and repetitive log like this which goes forever:

The log :

<address>/Programing/C/Projects/Chess/main.exe: 1: MZ\90#003#004\FF\FF\B8\40\80\23\30\31\36\23\30\33\37\BA\23\30\31\36\B4\3A\20\6E\6F\74\20\66\6F\75\6E\64\0A\32\30\32\34\2D\31\31\2D\32\39\54\32\32\3A\31\31\3A\34\30\2E\31\34\37\36\34\39\2B\30\35\3A\33\30\20\6D\72\2D\71\75\61\6E\74\75\6D\2D\56\69\76\6F\42\6F
\6F\6B\2D\41\53\55\53\4C\61\70\74\6F\70\2D\58\35\31\33\45\41\4E\2D\4B\35\31\33\45\41\20\6D\61\69\6E\2E\65\78\65\5B\35\35\34\38\5D\3A\20\2F\6D\65\64\69\61\2F\6D\72\2D\71\75\61\6E\74\75\6D\2F\4F\53\2F\31\29\2E\44\61\72\73\68\61\6E\2F\43\53\2F
\50\72\6F\67\72\61\6D\69\6E\67\2F\43\2F\50\72\6F\6A\65\63\74\73\2F\43\68\65\73\73\2F\6D\61\69\6E\2E\65\78\65\3A\20\32\3A\20\53\79\6E\74\61\78\20\65\72\72\6F\72\3A\20\22\28\22\20\75\6E\65\78\70\65\63\74\65\64\0A\32\30\32\34\2D\31\31\2D\32\39
\54\32\32\3A\31\31\3A\34\31\2E\39\31\30\35\33\36\2B\30\35\3A\33\30\20\6D\72\2D\71\75\61\6E\74\75\6D\2D\56\69\76\6F\42\6F\6F\6B\2D\41\53\55\53\4C\61\70\74\6F\70\2D\58\35\31\33\45\41\4E\2D\4B\35\31\33\45\41\20\6D\61\69\6E\2E\65\78\65\5B\35\35
\35\33\5D\3A\20\2F\6D\65\64\69\61\2F\6D\72\2D\71\75\61\6E\74\75\6D\2F\4F\53\2F\31\29\2E\44\61\72\73\68\61\6E\2F\43\53\2F\50\72\6F\67\72\61\6D\69\6E\67\2F\43\2F\50\72\6F\6A\65\63\74\73\2F\43\68\65\73\73\2F\6D\61\69\6E\2E\65\78\65\3A\20\31\3A
\20\4D\5A\90\23\30\30\33\23\30\30\34\FF\FF\B8\40\80\23\30\31\36\23\30\33\37\BA\23\30\31\36\B4: not found
<time-stamp> <hostname> main.exe[5553]: <address>/Programing/C/Projects/Chess/main.exe: 2: Syntax error: "(" unexpected
<time-stamp> <hostname>: 1. Enter the Coordinates (from-->to) format exactly like this : a2 a4
<time-stamp> <hostname>: 2.
<time-stamp> <hostname>: 3.
<time-stamp> <hostname>: Enter name of Player 1 :
<time-stamp> <hostname>: Enter name of Player 2 :
<time-stamp> <hostname>:  is assigned white, while  is assigned black
<time-stamp> <hostname>: #011#011#011     a  b  c  d  e  f  g  h
<time-stamp> <hostname>: #011#011#0118   #033[1;90m#033[48;5;255m r #033[0m#033[1;97m#033[48;5;236m n #033[0m#033[1;90m#033[48;5;255m b #033[0m#033[1;97m#033[48;5;236m q #033[0m#033[1;90m#033[48;5;255m k #033[0m#033[1;97m#033[48;5;236m b #033[0m#033[1;90m#033[48;5;255m n #033[0m#033[1;97m#033[48;5;236m r #033[0m
<time-stamp> <hostname>: #011#011#0117   #033[1;97m#033[48;5;236m p #033[0m#033[1;90m#033[48;5;255m p #033[0m#033[1;97m#033[48;5;236m p #033[0m#033[1;90m#033[48;5;255m p #033[0m#033[1;97m#033[48;5;236m p #033[0m#033[1;90m#033[48;5;255m p #033[0m#033[1;97m#033[48;5;236m p #033[0m#033[1;90m#033[48;5;255m p #033[0m
<time-stamp> <hostname>: #011#011#0116   #033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m
<time-stamp> <hostname>: #011#011#0115   #033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m
<time-stamp> <hostname>: #011#011#0114   #033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m
<time-stamp> <hostname>: #011#011#0113   #033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m
<time-stamp> <hostname>: #011#011#0112   #033[1;90m#033[48;5;255m P #033[0m#033[1;97m#033[48;5;236m P #033[0m#033[1;90m#033[48;5;255m P #033[0m#033[1;97m#033[48;5;236m P #033[0m#033[1;90m#033[48;5;255m P #033[0m#033[1;97m#033[48;5;236m P #033[0m#033[1;90m#033[48;5;255m P #033[0m#033[1;97m#033[48;5;236m P #033[0m
<time-stamp> <hostname>: #011#011#0111   #033[1;97m#033[48;5;236m R #033[0m#033[1;90m#033[48;5;255m N #033[0m#033[1;97m#033[48;5;236m B #033[0m#033[1;90m#033[48;5;255m Q #033[0m#033[1;97m#033[48;5;236m K #033[0m#033[1;90m#033[48;5;255m B #033[0m#033[1;97m#033[48;5;236m N #033[0m#033[1;90m#033[48;5;255m R #033[0m
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move

This the output of the console based chess game (main.c) that I made in C language and run it, the time stamp shows that it started a month ago, may be in Integrated terminal of VScode while coding in it.

But the log says main.exe which is for windows. May be I had accidentally ran it on linux.

I found some answers about how to free the file and rotate the log to limit the log file size, but I want to know what is root cause of this problem and how to stop it from happening. Whether the problem is with my code's file handling function or its because of .exe file.

My first question is :

How the .exe file even executed on linux? It seems to have run by seeing the logs that stored the stdout from the terminal.

My second question is :

If even it ran, then, How the stdout of console being logged in the system log file? Usually the output in the terminal is not stored in log files. And my code does not redirect or force to do so explicitly. Then why? Will this happen in windows also when I run that .exe file?

I simply used printf() function to print the messages (that can seen in the log above) in std output that is terminal. And this should not store it in log files right?

The code-block for reference :

if (whoseMove == black)
        {
            whoseMove = white;
            int InitialColumn_int, FinalColumn_int;
            char piece;
            while (validMove == no)
            {
                printf("Check = %d", check);
                if (check == yes)
                {
                    printf("Caution White Kings is in Check !");
                }

                printf("\nIt's %s's turn. Enter the Coordintes of the Move : ", player1.name);
                scanf("%c%d %c%d", &InitialColumn, &InitialRow, &FinalColumn, &FinalRow);
                if (InitialColumn == '0' && InitialRow == 0 && FinalColumn == '0' && FinalRow == 0)
                {
                    exit = yes;
                    goto exit;
                }

                getchar();
                InitialColumn_int = mapCharToInt(InitialColumn);
                FinalColumn_int = mapCharToInt(FinalColumn);
                piece = matrix[8 - InitialRow][InitialColumn_int - 1]; // to scan what the piece is at the position mentioned by user

                int possibleEnpassant = no;

                validMove = validate(whoseMove, matrix, piece, InitialRow, InitialColumn_int, FinalRow, FinalColumn_int, possibleEnpassant, &check);

                if (check == yes)
                {
                    printf("\n King is Under Check, Can't make this move.");
                }

                if (validMove == no)
                {
                    printf("\nPlease Enter Valid Move");
                }
            }
            if (piece == whiteKing)
            {
                trackWhiteKing.row = FinalRow;
                trackBlackKing.column = FinalColumn_int;
            }

            matrix[8 - InitialRow][InitialColumn_int - 1] = ' ';
            matrix[8 - FinalRow][FinalColumn_int - 1] = piece;
            printf("\033[H\033[2J\033[3J"); // to clear the terminal, to reprint the canvas
            checkCheck(black, matrix, trackBlackKing.row, trackBlackKing.column, &check);
            printBoard(matrix);
            storeMoveHistory(player1.name, InitialColumn, InitialRow, FinalColumn, FinalRow);
        }

Then which part of my code be resulting in that behavior?

So from several days I get this message from disk Analyzer that only 100 MB space remaining on disk.

I have a 70 GB partition on disk on which I installed UBUNTU Linux. (Dual Boot with preinstalled Windows 11).

When I opened Disk Analyzer I saw that most of the space is occupied by syslog.1 file and that too 48 GB!

When I opened this file I saw regular system logs and after several lines of that I saw a strange and repetitive log like this which goes forever:

The log :

<address>/Programing/C/Projects/Chess/main.exe: 1: MZ\90#003#004\FF\FF\B8\40\80\23\30\31\36\23\30\33\37\BA\23\30\31\36\B4\3A\20\6E\6F\74\20\66\6F\75\6E\64\0A\32\30\32\34\2D\31\31\2D\32\39\54\32\32\3A\31\31\3A\34\30\2E\31\34\37\36\34\39\2B\30\35\3A\33\30\20\6D\72\2D\71\75\61\6E\74\75\6D\2D\56\69\76\6F\42\6F
\6F\6B\2D\41\53\55\53\4C\61\70\74\6F\70\2D\58\35\31\33\45\41\4E\2D\4B\35\31\33\45\41\20\6D\61\69\6E\2E\65\78\65\5B\35\35\34\38\5D\3A\20\2F\6D\65\64\69\61\2F\6D\72\2D\71\75\61\6E\74\75\6D\2F\4F\53\2F\31\29\2E\44\61\72\73\68\61\6E\2F\43\53\2F
\50\72\6F\67\72\61\6D\69\6E\67\2F\43\2F\50\72\6F\6A\65\63\74\73\2F\43\68\65\73\73\2F\6D\61\69\6E\2E\65\78\65\3A\20\32\3A\20\53\79\6E\74\61\78\20\65\72\72\6F\72\3A\20\22\28\22\20\75\6E\65\78\70\65\63\74\65\64\0A\32\30\32\34\2D\31\31\2D\32\39
\54\32\32\3A\31\31\3A\34\31\2E\39\31\30\35\33\36\2B\30\35\3A\33\30\20\6D\72\2D\71\75\61\6E\74\75\6D\2D\56\69\76\6F\42\6F\6F\6B\2D\41\53\55\53\4C\61\70\74\6F\70\2D\58\35\31\33\45\41\4E\2D\4B\35\31\33\45\41\20\6D\61\69\6E\2E\65\78\65\5B\35\35
\35\33\5D\3A\20\2F\6D\65\64\69\61\2F\6D\72\2D\71\75\61\6E\74\75\6D\2F\4F\53\2F\31\29\2E\44\61\72\73\68\61\6E\2F\43\53\2F\50\72\6F\67\72\61\6D\69\6E\67\2F\43\2F\50\72\6F\6A\65\63\74\73\2F\43\68\65\73\73\2F\6D\61\69\6E\2E\65\78\65\3A\20\31\3A
\20\4D\5A\90\23\30\30\33\23\30\30\34\FF\FF\B8\40\80\23\30\31\36\23\30\33\37\BA\23\30\31\36\B4: not found
<time-stamp> <hostname> main.exe[5553]: <address>/Programing/C/Projects/Chess/main.exe: 2: Syntax error: "(" unexpected
<time-stamp> <hostname>: 1. Enter the Coordinates (from-->to) format exactly like this : a2 a4
<time-stamp> <hostname>: 2.
<time-stamp> <hostname>: 3.
<time-stamp> <hostname>: Enter name of Player 1 :
<time-stamp> <hostname>: Enter name of Player 2 :
<time-stamp> <hostname>:  is assigned white, while  is assigned black
<time-stamp> <hostname>: #011#011#011     a  b  c  d  e  f  g  h
<time-stamp> <hostname>: #011#011#0118   #033[1;90m#033[48;5;255m r #033[0m#033[1;97m#033[48;5;236m n #033[0m#033[1;90m#033[48;5;255m b #033[0m#033[1;97m#033[48;5;236m q #033[0m#033[1;90m#033[48;5;255m k #033[0m#033[1;97m#033[48;5;236m b #033[0m#033[1;90m#033[48;5;255m n #033[0m#033[1;97m#033[48;5;236m r #033[0m
<time-stamp> <hostname>: #011#011#0117   #033[1;97m#033[48;5;236m p #033[0m#033[1;90m#033[48;5;255m p #033[0m#033[1;97m#033[48;5;236m p #033[0m#033[1;90m#033[48;5;255m p #033[0m#033[1;97m#033[48;5;236m p #033[0m#033[1;90m#033[48;5;255m p #033[0m#033[1;97m#033[48;5;236m p #033[0m#033[1;90m#033[48;5;255m p #033[0m
<time-stamp> <hostname>: #011#011#0116   #033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m
<time-stamp> <hostname>: #011#011#0115   #033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m
<time-stamp> <hostname>: #011#011#0114   #033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m
<time-stamp> <hostname>: #011#011#0113   #033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m#033[1;97m#033[48;5;236m   #033[0m#033[1;90m#033[48;5;255m   #033[0m
<time-stamp> <hostname>: #011#011#0112   #033[1;90m#033[48;5;255m P #033[0m#033[1;97m#033[48;5;236m P #033[0m#033[1;90m#033[48;5;255m P #033[0m#033[1;97m#033[48;5;236m P #033[0m#033[1;90m#033[48;5;255m P #033[0m#033[1;97m#033[48;5;236m P #033[0m#033[1;90m#033[48;5;255m P #033[0m#033[1;97m#033[48;5;236m P #033[0m
<time-stamp> <hostname>: #011#011#0111   #033[1;97m#033[48;5;236m R #033[0m#033[1;90m#033[48;5;255m N #033[0m#033[1;97m#033[48;5;236m B #033[0m#033[1;90m#033[48;5;255m Q #033[0m#033[1;97m#033[48;5;236m K #033[0m#033[1;90m#033[48;5;255m B #033[0m#033[1;97m#033[48;5;236m N #033[0m#033[1;90m#033[48;5;255m R #033[0m
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move
<time-stamp> <hostname>: It's 's turn. Enter the Coordintes of the Move :
<time-stamp> <hostname>: Please Enter Valid Move

This the output of the console based chess game (main.c) that I made in C language and run it, the time stamp shows that it started a month ago, may be in Integrated terminal of VScode while coding in it.

But the log says main.exe which is for windows. May be I had accidentally ran it on linux.

I found some answers about how to free the file and rotate the log to limit the log file size, but I want to know what is root cause of this problem and how to stop it from happening. Whether the problem is with my code's file handling function or its because of .exe file.

My first question is :

How the .exe file even executed on linux? It seems to have run by seeing the logs that stored the stdout from the terminal.

My second question is :

If even it ran, then, How the stdout of console being logged in the system log file? Usually the output in the terminal is not stored in log files. And my code does not redirect or force to do so explicitly. Then why? Will this happen in windows also when I run that .exe file?

I simply used printf() function to print the messages (that can seen in the log above) in std output that is terminal. And this should not store it in log files right?

The code-block for reference :

if (whoseMove == black)
        {
            whoseMove = white;
            int InitialColumn_int, FinalColumn_int;
            char piece;
            while (validMove == no)
            {
                printf("Check = %d", check);
                if (check == yes)
                {
                    printf("Caution White Kings is in Check !");
                }

                printf("\nIt's %s's turn. Enter the Coordintes of the Move : ", player1.name);
                scanf("%c%d %c%d", &InitialColumn, &InitialRow, &FinalColumn, &FinalRow);
                if (InitialColumn == '0' && InitialRow == 0 && FinalColumn == '0' && FinalRow == 0)
                {
                    exit = yes;
                    goto exit;
                }

                getchar();
                InitialColumn_int = mapCharToInt(InitialColumn);
                FinalColumn_int = mapCharToInt(FinalColumn);
                piece = matrix[8 - InitialRow][InitialColumn_int - 1]; // to scan what the piece is at the position mentioned by user

                int possibleEnpassant = no;

                validMove = validate(whoseMove, matrix, piece, InitialRow, InitialColumn_int, FinalRow, FinalColumn_int, possibleEnpassant, &check);

                if (check == yes)
                {
                    printf("\n King is Under Check, Can't make this move.");
                }

                if (validMove == no)
                {
                    printf("\nPlease Enter Valid Move");
                }
            }
            if (piece == whiteKing)
            {
                trackWhiteKing.row = FinalRow;
                trackBlackKing.column = FinalColumn_int;
            }

            matrix[8 - InitialRow][InitialColumn_int - 1] = ' ';
            matrix[8 - FinalRow][FinalColumn_int - 1] = piece;
            printf("\033[H\033[2J\033[3J"); // to clear the terminal, to reprint the canvas
            checkCheck(black, matrix, trackBlackKing.row, trackBlackKing.column, &check);
            printBoard(matrix);
            storeMoveHistory(player1.name, InitialColumn, InitialRow, FinalColumn, FinalRow);
        }

Then which part of my code be resulting in that behavior?

Share Improve this question asked Jan 2 at 14:11 Mr. Cosmic_QuantumMr. Cosmic_Quantum 151 silver badge6 bronze badges 3
  • Use the process tools (like the ps command) to help find the process, and kill it. Then figure out why it's running, who started it, and if it will start automatically running in the background. – Some programmer dude Commented Jan 2 at 14:16
  • Don't put multiple questions into one here. You're asking two things that are totally unrelated to each other. – Ulrich Eckhardt Commented Jan 2 at 14:20
  • Please post a minimal reproducible example apart of the recommendation of @UlrichEckhardt, which is also applicable. – Luis Colorado Commented Jan 8 at 18:31
Add a comment  | 

1 Answer 1

Reset to default 2

How the .exe file even executed on linux? It seems to have run by seeing the logs that stored the stdout from the terminal.

Even on Windows, filename extensions are discretionary, in the sense that you can name files with extensions that do not reflect their content. The same is true for Linux, but more so, because unlike Windows, Linux will happily run an executable with any name or extension, as long as the contents are in a supported executable format. It is not conventional to name Linux executables with a .exe extension, but such naming is not inherently problematic. If a program named main.exe is running natively on your Ubuntu system then it is a Linux executable, not a Windows executable.

If even it ran, then, How the stdout of console being logged in the system log file? Usually the output in the terminal is not stored in log files. And my code does not redirect or force to do so explicitly. Then why?

Nothing in the code presented explains the output being directed to the system log. That was surely set up by something external to the code itself. Since you mention VSCode, it is possible that VSCode did that, but I don't know offhand how exactly one would request that from VSCode or configure VSCode to do it.

Will this happen in windows also when I run that .exe file?

I am confident in saying no, it will not. The same binary that runs natively on Linux will not run on Windows at all. And even if it did, the code you show is not responsible for the logging, and if rebuilt for Windows it would not, itself, create large files of any kind. Moreover, Windows has an entirely different logging system, such that if large files were created by some combination of your program and some agent external to it, you should not expect those files to be part of the Windows system log.

Side note: it should be safe to remove syslog.1.

转载请注明原文地址:http://www.anycun.com/QandA/1746115541a91885.html