Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 71207 - app-misc/screen crashes when compiled 64-bit userspace
Summary: app-misc/screen crashes when compiled 64-bit userspace
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Sparc Linux
: High critical (vote)
Assignee: Sven Wegener
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-14 14:25 UTC by Jan Oravec
Modified: 2005-05-14 15:09 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed patch. (PATCH,298 bytes, patch)
2004-11-14 14:26 UTC, Jan Oravec
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Oravec 2004-11-14 14:25:23 UTC
I have Gentoo compiled completely 64-bit on sparc including userspace.

When I run screen, it crashes; I debugged it with the following result - when screen is trying to create UTMP record, it fills into 'struct utmp' current time using (void)time((time_t *)&u->ut_time) call. Unfortunatelly, ut_time is 32-bit due to __WORDSIZE_COMPAT32, but time_t is 64-bit. Calling time() results in SIGBUG. It could probably affect other 64-bit platforms too. The proposed patch is:

--- utmp.c.orig 2004-11-14 23:15:28.000000000 +0100
+++ utmp.c      2004-11-14 23:15:39.000000000 +0100
@@ -618,7 +618,7 @@
 #endif /* sgi */
   strncpy(u->ut_line, line, sizeof(u->ut_line));
   u->ut_pid = pid;
-  (void)time((time_t *)&u->ut_time);
+  u->ut_time = time(NULL);
 }
 
 static slot_t


Reproducible: Always
Steps to Reproduce:
1.run screen

Actual Results:  
It crashed.

Expected Results:  
It should not crash :-).


See details.
Comment 1 Jan Oravec 2004-11-14 14:26:46 UTC
Created attachment 43954 [details, diff]
Proposed patch.
Comment 2 Ciaran McCreesh 2004-11-14 14:27:40 UTC
We only support 32bit userland...
Comment 3 Jan Oravec 2004-11-14 14:40:06 UTC
OKay, I agree with supporting only 32-bit userland on sparc, but the bug may cause problems on other 64-bit platforms too. Especially on big endians (like ppc).
Comment 4 Jeremy Huddleston (RETIRED) gentoo-dev 2005-01-10 04:02:19 UTC
Passing this to screen's maintainer
Comment 5 Sven Wegener gentoo-dev 2005-05-14 15:09:22 UTC
Added to app-misc/screen-4.0.2-r3