Skip to contentSkip to conversation

lib/tst_test.c: fix Segmentation fault in tst_vbrk_

PATCH New Xiao Yang 2 participants 2 messages Jun 16, 2016 Library code

lore
Share & tools
lore

Xiao Yang

author
#0 lore raw

PATCH 1/1 lib/tst_test.c: fix Segmentation fault in tst_vbrk_

We can't allocate resources to results pointer before checking kernel version, so do_exit() will fail if we print results pointer.

---
 lib/tst_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/tst_test.c +1 -1
index c560727..68791cb 100644
@@ -237,7 +237,7 @@ void tst_vbrk_(const char *file, const int lineno, int ttype,
 		do_test_cleanup();
 
 	if (getpid() == lib_pid)
-		do_exit(TTYPE_RESULT(ttype));
+		do_cleanup();
 
 	exit(TTYPE_RESULT(ttype));
 }
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 lib/tst_test.c: fix Segmentation fault in tst_vbrk_

----- Original Message -----

Quoted 9 lines

From: "Xiao Yang" <[email protected]>
To: [email protected]
Sent: Thursday, 16 June, 2016 9:52:04 AM
Subject: [LTP] [PATCH] lib/tst_test.c: fix Segmentation fault in tst_vbrk_

We can't allocate resources to results pointer before checking kernel version, so do_exit() will fail if we print results pointer.

Thanks, I pushed a patch that fixes do_exit() instead. So we preserve do_exit as a single place for library process to exit.

Regards,
Jan