* [LTP] [PATCH] fix aio_suspend/3-1
@ 2010-01-27 5:16 Yasuaki Ishimatsu
2010-01-27 9:01 ` Garrett Cooper
0 siblings, 1 reply; 4+ messages in thread
From: Yasuaki Ishimatsu @ 2010-01-27 5:16 UTC (permalink / raw)
To: ltp-list; +Cc: isimatu.yasuaki
Hi all
When the aio_suspend/3-1.test ran, SIGSEGV occured with following message
on my x86_64 box.
---
/bin/sh: line 38: 10675 Segmentation fault ./t0 240 conformance/interfaces/aio_suspend/3-1.test
> $COMPLOG 2>&1
---
This test does not initialize a list[1] array as follows.
---
40 int main()
...
88 list[0] = NULL;
89 list[2] = &aiocb[0];
90 list[3] = NULL;
91 list[4] = NULL;
92 list[5] = &aiocb[1];
93 list[6] = &aiocb[2];
94 list[7] = NULL;
...
---
So, list[1] holds a strange value. Since aio_suspend() uses this value as address,
SIGSEGV occurred.
When applying this patch, this test succeeds as follows.
---
conformance/interfaces/aio_suspend/3-1: execution: PASS
---
Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Index: ltp-2010-01-27/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/3-1.c
===================================================================
--- ltp-2010-01-27.orig/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/3-1.c
2010-01-27 11:44:30.000000000 +0900
+++ ltp-2010-01-27/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/3-1.c
2010-01-27 11:45:23.000000000 +0900
@@ -82,6 +82,7 @@ int main()
}
list[0] = NULL;
+ list[1] = NULL;
list[2] = &aiocb[0];
list[3] = NULL;
list[4] = NULL;
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] fix aio_suspend/3-1
2010-01-27 5:16 [LTP] [PATCH] fix aio_suspend/3-1 Yasuaki Ishimatsu
@ 2010-01-27 9:01 ` Garrett Cooper
2010-01-28 0:48 ` Yasuaki Ishimatsu
0 siblings, 1 reply; 4+ messages in thread
From: Garrett Cooper @ 2010-01-27 9:01 UTC (permalink / raw)
To: Yasuaki Ishimatsu; +Cc: ltp-list
On Tue, Jan 26, 2010 at 9:16 PM, Yasuaki Ishimatsu
<isimatu.yasuaki@jp.fujitsu.com> wrote:
> Hi all
>
> When the aio_suspend/3-1.test ran, SIGSEGV occured with following message
> on my x86_64 box.
>
> ---
> /bin/sh: line 38: 10675 Segmentation fault ./t0 240 conformance/interfaces/aio_suspend/3-1.test
>> $COMPLOG 2>&1
> ---
>
> This test does not initialize a list[1] array as follows.
>
> ---
> 40 int main()
> ...
> 88 list[0] = NULL;
> 89 list[2] = &aiocb[0];
> 90 list[3] = NULL;
> 91 list[4] = NULL;
> 92 list[5] = &aiocb[1];
> 93 list[6] = &aiocb[2];
> 94 list[7] = NULL;
> ...
> ---
>
> So, list[1] holds a strange value. Since aio_suspend() uses this value as address,
> SIGSEGV occurred.
>
> When applying this patch, this test succeeds as follows.
>
> ---
> conformance/interfaces/aio_suspend/3-1: execution: PASS
> ---
>
> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>
> Index: ltp-2010-01-27/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/3-1.c
> ===================================================================
> --- ltp-2010-01-27.orig/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/3-1.c
> 2010-01-27 11:44:30.000000000 +0900
> +++ ltp-2010-01-27/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/3-1.c
> 2010-01-27 11:45:23.000000000 +0900
> @@ -82,6 +82,7 @@ int main()
> }
>
> list[0] = NULL;
> + list[1] = NULL;
> list[2] = &aiocb[0];
> list[3] = NULL;
> list[4] = NULL;
Wouldn't it just be better to memset(&list, 0, sizeof(list)) the
array and just set that one array value to &aiocb[0]? Seems like a
much better idea...
Thanks,
-Garrett
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] fix aio_suspend/3-1
2010-01-27 9:01 ` Garrett Cooper
@ 2010-01-28 0:48 ` Yasuaki Ishimatsu
2010-01-28 3:44 ` Garrett Cooper
0 siblings, 1 reply; 4+ messages in thread
From: Yasuaki Ishimatsu @ 2010-01-28 0:48 UTC (permalink / raw)
To: Garrett Cooper, ltp-list; +Cc: isimatu.yasuaki
Hi Garrett
> Wouldn't it just be better to memset(&list, 0, sizeof(list)) the
> array and just set that one array value to &aiocb[0]? Seems like a
> much better idea...
Thank you for your good idea.
I applied it.
Regards,
Yasuaki Ishimatsu
--------------------------------------------------------------------------
When the aio_suspend/3-1.test ran, SIGSEGV occured with following message
on my x86_64 box.
---
/bin/sh: line 38: 10675 Segmentation fault ./t0 240 conformance/interfaces/aio_suspend/3-1.test
$COMPLOG 2>&1
---
This test does not initialize a list[1] array as follows.
---
40 int main()
...
88 list[0] = NULL;
89 list[2] = &aiocb[0];
90 list[3] = NULL;
91 list[4] = NULL;
92 list[5] = &aiocb[1];
93 list[6] = &aiocb[2];
94 list[7] = NULL;
...
---
So, list[1] holds a strange value. Since aio_suspend() uses this value as address,
SIGSEGV occurred.
When applying this patch, this test succeeds as follows.
---
conformance/interfaces/aio_suspend/3-1: execution: PASS
---
Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Index: ltp-2010-01-28/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/3-1.c
===================================================================
--- ltp-2010-01-28.orig/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/3-1.c
2010-01-28 09:10:48.000000000 +0900
+++ ltp-2010-01-28/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/3-1.c
2010-01-28 09:11:16.000000000 +0900
@@ -81,13 +81,11 @@ int main()
}
}
- list[0] = NULL;
+ memset(&list, 0, sizeof(list));
+
list[2] = &aiocb[0];
- list[3] = NULL;
- list[4] = NULL;
list[5] = &aiocb[1];
list[6] = &aiocb[2];
- list[7] = NULL;
if (aio_suspend(list, NENT, NULL) != 0)
{
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] fix aio_suspend/3-1
2010-01-28 0:48 ` Yasuaki Ishimatsu
@ 2010-01-28 3:44 ` Garrett Cooper
0 siblings, 0 replies; 4+ messages in thread
From: Garrett Cooper @ 2010-01-28 3:44 UTC (permalink / raw)
To: Yasuaki Ishimatsu; +Cc: ltp-list
On Wed, Jan 27, 2010 at 4:48 PM, Yasuaki Ishimatsu
<isimatu.yasuaki@jp.fujitsu.com> wrote:
> Hi Garrett
>
>> Wouldn't it just be better to memset(&list, 0, sizeof(list)) the
>> array and just set that one array value to &aiocb[0]? Seems like a
>> much better idea...
>
> Thank you for your good idea.
> I applied it.
Committed -- thanks!
-Garrett
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-01-28 3:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-27 5:16 [LTP] [PATCH] fix aio_suspend/3-1 Yasuaki Ishimatsu
2010-01-27 9:01 ` Garrett Cooper
2010-01-28 0:48 ` Yasuaki Ishimatsu
2010-01-28 3:44 ` Garrett Cooper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox