Bug 1079

Summary: LSB4.1:Segment fault occurred for wcsftime which is a test item of core test in LSB
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Xiaofeng Yan <Xiaofeng.yan>
Component: coreAssignee: Xiaofeng Yan <Xiaofeng.yan>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: kai.kang, meta.mr.watcher, meta.watcher, sgw
Version: 1.0-alpha   
Target Milestone: 1.1 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Attachments:
Description Flags
test program from core test none

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.