Bug 16862

Summary: strptime(..., "%+" ...) dumps core
Product: Base System Reporter: Martin Cracauer <cracauer>
Component: binAssignee: Martin Cracauer <cracauer>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Martin Cracauer 2000-02-21 10:30:01 UTC
Parsing '%+' (time in date(1) format) in strptime dumps core. it works
in 3.4-stable.

Fix: 

I'm not sure why this program messes with i386_get_ioperm etc. at all,
so I didn't take a shot at it.
	
Someone who messed with strptime in -current should pick it up.
Thanks.
How-To-Repeat: 
Run this standalone program:


#include <stdio.h>
#include <time.h>

int
main(void)
{
  struct tm tm;
  if (strptime("Mon Feb 21 11:20:36 MET 2000", "%+", &tm) == NULL) {
    printf("Parsing failed\n");
    exit(1);
  }

  printf("Time was '%s'\n", asctime(&tm));

  return 0;
}

Result:

#0  0x280c19ee in strcmp () from /usr/lib/libc.so.4
#1  0x2807f0a8 in i386_get_ioperm () from /usr/lib/libc.so.4
#2  0x2807e2e9 in i386_get_ioperm () from /usr/lib/libc.so.4
#3  0x2807f13d in strptime () from /usr/lib/libc.so.4
#4  0x80484b0 in main () at ptime.c:8
#5  0x804842d in _start ()
Comment 1 Martin Cracauer 2000-02-22 09:16:48 UTC
This looks like a dynamic linker bug, see my message to the -current
list from earlier today.

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@cons.org> http://www.cons.org/cracauer/
BSD User Group Hamburg, Germany     http://www.bsdhh.org/
Comment 2 bright 2000-02-23 20:11:09 UTC
This looks like it's been addressed:

3-stable:
~ % ./a.out 
Parsing failed

4-stable:
~ % ./a.out 
Parsing failed

You didn't specify the desired output, is that what you wanted?
If so may I close the pr?  If not can you explain what output
should be presented?

thanks,
-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
Comment 3 Sheldon Hearn freebsd_committer freebsd_triage 2000-03-29 10:36:20 UTC
State Changed
From-To: open->feedback

What's the story, morning glory? 
:-) 
Comment 4 Sheldon Hearn freebsd_committer freebsd_triage 2000-03-29 12:35:19 UTC
State Changed
From-To: feedback->open

Martin says he'd like this one open until the compiler/linker 
problem is fixed. 


Comment 5 Sheldon Hearn freebsd_committer freebsd_triage 2000-03-29 12:35:19 UTC
Responsible Changed
From-To: freebsd-bugs->cracauer

Martin wants this one. :-) 
Comment 6 Martin Cracauer freebsd_committer freebsd_triage 2000-08-16 11:33:16 UTC
State Changed
From-To: open->closed

Fixed by binutils update in both -current and -stable