From 31555637d8a9b3f4b3f12d0b472ae81ed41c7ad7 Mon Sep 17 00:00:00 2001 From: rensilin Date: Fri, 16 Aug 2019 12:59:16 +0800 Subject: [PATCH] fix Change-Id: Icd732be883b7a9f08da2f154f00f153395b601d1 --- paddle/fluid/train/custom_trainer/feed/dataset/data_reader.cc | 1 + paddle/fluid/train/custom_trainer/feed/io/shell.cc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/train/custom_trainer/feed/dataset/data_reader.cc b/paddle/fluid/train/custom_trainer/feed/dataset/data_reader.cc index 48b9e1fe..92e5f82f 100644 --- a/paddle/fluid/train/custom_trainer/feed/dataset/data_reader.cc +++ b/paddle/fluid/train/custom_trainer/feed/dataset/data_reader.cc @@ -171,6 +171,7 @@ public: if (line_len <= 0) { continue; } + DataItem data_item; if (_parser->parse(buffer, line_len, data_item) == 0) { VLOG(5) << "parse data: " << data_item.id << " " << data_item.data << ", filename: " << filepath << ", thread_num: " << thread_num << ", max_threads: " << max_threads; if (writer == nullptr) { diff --git a/paddle/fluid/train/custom_trainer/feed/io/shell.cc b/paddle/fluid/train/custom_trainer/feed/io/shell.cc index a96da2c6..d6fae5d0 100644 --- a/paddle/fluid/train/custom_trainer/feed/io/shell.cc +++ b/paddle/fluid/train/custom_trainer/feed/io/shell.cc @@ -165,14 +165,14 @@ static int shell_popen_fork_internal( if (child_end != child_std_end) { if (dup2(child_end, child_std_end) != child_std_end) { - return -1; + exit(127); } close(child_end); } close_open_fds_internal(); if (execl("/bin/bash", "bash", "-c", real_cmd, NULL) < 0) { - return -1; + exit(127); } exit(127); #endif -- GitLab