pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/58717: wm/cde crashes in ttsession during startup on sparc64



>Number:         58717
>Category:       pkg
>Synopsis:       wm/cde crashes in ttsession during startup on sparc64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 05 08:55:00 +0000 2024
>Originator:     Sad Clouds
>Release:        pkg-2024Q2
>Organization:
>Environment:
>Description:
Pkgsrc wm/cde desktop has a number of issues on sparc64 and other architectures with LP64 data model.

The issue described in this bug occurs with ttsession executable, which crashes with SIGBUS due to alignment problems, where the original programmer assumed size of integer == size of long.
>How-To-Repeat:
Build wm/cde on sparc64 and then run /usr/pkg/bin/startcde
>Fix:
The patch below assumes that uid_t, gid_t, mode_t can be safely cast to unsigned int without data loss. Most platforms seem to define these types as either signed or unsigned 32-bit integer, so should be OK.

There are other executables like dthelpview which crash with SIGBUS, but at least with this patch CDE can be usable on sparc64.

--- cde-2.5.2/lib/tt/lib/db/db_server_xdr.C.orig	2023-11-18 22:38:09.000000000 +0000
+++ cde-2.5.2/lib/tt/lib/db/db_server_xdr.C	2024-10-05 06:59:06.723430670 +0100
@@ -108,7 +108,7 @@
 			 (xdrproc_t) xdr_keydesc)) {
 		return (FALSE);
 	}
-	if (!xdr_int(xdrs, &objp->mode)) {
+	if (!xdr_u_int(xdrs, (unsigned *)&objp->mode)) {
 		return (FALSE);
 	}
 	if (!xdr_int(xdrs, &objp->isreclen)) {
@@ -168,7 +168,7 @@
 	if (!xdr_string(xdrs, &objp->path, 1024)) {
 		return (FALSE);
 	}
-	if (!xdr_int(xdrs, &objp->mode)) {
+	if (!xdr_u_int(xdrs, (unsigned *)&objp->mode)) {
 		return (FALSE);
 	}
 	return (TRUE);
@@ -183,7 +183,7 @@
 	if (!xdr_array(xdrs, (char **)&objp->rec.rec_val, (u_int *)&objp->rec.rec_len, ISMAXRECLEN, sizeof(char), (xdrproc_t) xdr_char)) {
 		return (FALSE);
 	}
-	if (!xdr_int(xdrs, &objp->mode)) {
+	if (!xdr_u_int(xdrs, (unsigned *)&objp->mode)) {
 		return (FALSE);
 	}
 	if (!xdr_long(xdrs, &objp->isrecnum)) {
@@ -242,7 +242,7 @@
 	if (!xdr_array(xdrs, (char **)&objp->rec.rec_val, (u_int *)&objp->rec.rec_len, ISMAXRECLEN, sizeof(char), (xdrproc_t)xdr_char)) {
 		return (FALSE);
 	}
-	if (!xdr_int(xdrs, &objp->mode)) {
+	if (!xdr_u_int(xdrs, (unsigned *)&objp->mode)) {
 		return (FALSE);
 	}
 	return (TRUE);
@@ -380,13 +380,13 @@
 bool_t
 xdr_Tt_oidaccess_results(XDR *xdrs, _Tt_oidaccess_results *objp)
 {
-	if (!xdr_long(xdrs, (long *)&objp->uid)) {
+	if (!xdr_u_int(xdrs, (unsigned *)&objp->uid)) {
 		return (FALSE);
 	}
-	if (!xdr_long(xdrs, (long *)&objp->group)) {
+	if (!xdr_u_int(xdrs, (unsigned *)&objp->group)) {
 		return (FALSE);
 	}
-	if (!xdr_short(xdrs, (short *)&objp->mode)) {
+	if (!xdr_u_int(xdrs, (unsigned *)&objp->mode)) {
 		return (FALSE);
 	}
 	if (!xdr_int(xdrs, &objp->result)) {
@@ -503,13 +503,13 @@
 bool_t
 xdr_tt_access(XDR *xdrs, _tt_access *objp)
 {
-	if (!xdr_long(xdrs, (long *)&objp->user)) {
+	if (!xdr_u_int(xdrs, (unsigned *)&objp->user)) {
 		return (FALSE);
 	}
-	if (!xdr_long(xdrs, (long *)&objp->group)) {
+	if (!xdr_u_int(xdrs, (unsigned *)&objp->group)) {
 		return (FALSE);
 	}
-	if (!xdr_u_long(xdrs, (unsigned long *)&objp->mode)) {
+	if (!xdr_u_int(xdrs, (unsigned *)&objp->mode)) {
 		return (FALSE);
 	}
 	return (TRUE);



Home | Main Index | Thread Index | Old Index