Conflict of tasks leading to program closing

I have a small project with Arduino that uses FreeRTOS.
In this project I create 2 tasks:
task 1 function is to read temperature, humidity and gas concentration sensor values from DHT11 and MQ2 sensors, then it displays these values on LCD and Serial, and sends data to queue for task 2
task 2 is responsible for reading the values received from the queue and processing, giving warnings if the allowed value is exceeded.
The problem here is:
If there is only task 1, the program runs fine. But if there is task 2, the whole program does not run, only runs through the Setup() function.
I let 2 tasks have the same priority and the same stack value of 400.

I’ve been trying to fix this problem for over two days now to no result.
Hope to get help from everyone.
Source code :

#include <Arduino_FreeRTOS.h>
#include <queue.h>
#include <task.h>
#include <semphr.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "DHT.h"
const int DHTPIN = 4;
const int DHTTYPE = DHT11;
DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal_I2C lcd(0x27, 16, 2);
#define ledr 8
#define ledb 7
#define buzzer 2
TaskHandle_t xReadSensor;
TaskHandle_t xHandler;
QueueHandle_t queueGas;
QueueHandle_t queueHum;
QueueHandle_t queueTemp;

void setup() {
  Serial.begin(9600);
  Serial.println("System is setting up!");
  dht.begin();
  lcd.init();
  lcd.backlight();
  lcd.clear();

  xTaskCreate(taskReadSensor, "readss", 400, NULL, 1, &xReadSensor);
  xTaskCreate(taskHandler, "handler", 400, NULL, 1, &xHandler);
  queueGas = xQueueCreate(1, sizeof(int));
  queueHum = xQueueCreate(1, sizeof(int));
  queueTemp = xQueueCreate(1, sizeof(int));

}

void loop() {}

void taskReadSensor() {

  while (1) {
    Serial.println("- - -!- - -");
    int h = dht.readHumidity();
    int t = dht.readTemperature();
    int value = analogRead(A0);
    lcd.setCursor(2, 0);
    lcd.print("Gas value:");
    if (value >= 100) {
      lcd.print(value);
    } else {
      lcd.print(value);
      lcd.print(" ");
    }

    lcd.setCursor(0, 1);
    lcd.print("T:");
    lcd.print(t);
    lcd.setCursor(4, 1);
    lcd.print("*C");

    lcd.setCursor(6, 1);
    lcd.print(" ---");

    lcd.setCursor(11, 1);
    lcd.print("H:");
    lcd.print(h);
    lcd.setCursor(15, 1);
    lcd.print("%");
    delay(1000);

xQueueOverwrite(queueGas, (void*)&value);
xQueueOverwrite(queueTemp , (void*)&t);
xQueueOverwrite(queueHum, (void*)&h);

    Serial.print("Khi gas: ");
    Serial.println(value);
    Serial.print("Nhiet do: ");
    Serial.println(t);
    Serial.print("Do am: ");
    Serial.println(h);

    delay(500);
  }
}

void taskHandler() {
  int gBuffer;
  char gStr[16];
  int hBuffer;
  char hStr[16];
  int tBuffer;
  char tStr[16];
  Serial.println("Handlingggg!");
  while (1) {
    xQueuePeek(queueGas, &gBuffer, ( TickType_t ) 10 );
    xQueuePeek(queueTemp, &tBuffer, ( TickType_t ) 10 );
    xQueuePeek(queueHum, &hBuffer, ( TickType_t ) 10 );
    Serial.println("Peeking data!");
    Serial.println("Gas value: ");
    Serial.println(gBuffer);
    Serial.println("Temp value: ");
    Serial.println(tBuffer);
    Serial.println("Hum value: ");
    Serial.println(hBuffer);

    if (gBuffer >= 300) {
      lcd.clear();
      lcd.setCursor(1, 1);
      lcd.print("Gas detected");
      digitalWrite(ledr, HIGH);
      digitalWrite(ledb, LOW);
      Serial.println("Gas deteced!!!");
      Serial.println("FBI WARING");
    } else {
      digitalWrite(ledr, LOW);
      digitalWrite(ledb, HIGH);
      lcd.clear();
      Serial.println("Normal ^^");
    }

    vTaskDelay(1000 / portTICK_PERIOD_MS);
    taskYIELD();
  }

  
}


strong text

Does the call to vTaskStartScheduler() return? If so you have run out of heap space so can’t create the idle and/or timer tasks. Do you have malloc failed and stack overflow hooks defined? Do you have configASSERT() defined? https://freertos.org/FAQHelp.html

doesn’t really make sense. Letting a task sleep (using e.g. vTaskDelay) schedules / yields to other ready tasks anyway.
What’s the difference between delay() used in taskReadSensor and vTaskDelay used in taskHandler ? I’d use one consistent API.
Also why not simply using xQueueSend/Receive to automatically synchronize both tasks (omitting the vTaskDelay in taskHandler) ?
But that’s merely style… First you should take care about Richard’s hints to make your application running somehow.