Bug 1079 - LSB4.1:Segment fault occurred for wcsftime which is a test item of core test in LSB
Summary: LSB4.1:Segment fault occurred for wcsftime which is a test item of core test ...
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.0-alpha
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.1 M1
Assignee: Xiaofeng Yan
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2011-05-18 04:01 UTC by Xiaofeng Yan
Modified: 2012-11-13 07:34 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments
test program from core test (3.00 KB, text/x-csrc)
2011-05-18 04:01 UTC, Xiaofeng Yan
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xiaofeng Yan 2011-05-18 04:01:23 UTC
Created attachment 158 [details]
test program from core test

Please check attachment for wcsftime.c

target$gcc wcsftime.c -o wcsftime
target$./wcsftime
Segmentation fault

In fact segment fault caused by function "mbsrtowcs". I call this function in my PC machine(ubuntu 10.04,x86-32) and segment fault arise too.
Comment 1 Xiaofeng Yan 2011-05-18 04:32:28 UTC
I solve this bug by disabling time "UTC" on target environment,default is "UTC". Because there are two branches in test program, if target's time environment is "UTC", then function "mbsrtowcs" will be called with segment fault. if time environment is other standard time. then this function can't be called. Please check http://git.pokylinux.org/cgit.cgi/poky-contrib/commit/?h=xiaofeng/lsb&id=fadb1ec52c31b89379fca3880e7f00fad0222565 

It could be not a good method to solve this bugs. So if anyone has a better solution, I will adopt it. If this patch can't be passed, then I mark this bug here for solving it later.
Comment 3 Kai Kang 2012-11-13 07:34:34 UTC
Test case passes now without the patch.