Closed Bug 1568473 Opened 8 months ago Closed 5 months ago

no need for xp_qsort.h on Solaris


(Thunderbird :: General, defect)

Not set


(Not tracked)

Thunderbird 72.0


(Reporter: petr.sumbera, Assigned: petr.sumbera)



(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0

Steps to reproduce:

Build fails on Solaris with:

comm/ldap/c-sdk/libraries/libldap/sort.c:62:10: fatal error: xp_qsort.h: No such file or directory
#include "xp_qsort.h"
compilation terminated.

There is no xp_qsort.h and Thunderbird works on Solaris well without it.

I was trying to build Thunderbird on Solaris, and I was determined to find out what xp_qsort.h was before commenting it out, and I couldn't find any other reference to it on Bugzilla. Since there was a mention of libxp in the source code comments above it, I thought it might be referring to a qsort function in the X11 print libraries. It wasn't, though. Here's xp_qsort.h:

And the references to it in various CVS source tarballs disappear sometime around 2001, where it seems to get replaced by nsQuickSort, which is still in the tree to this day.

Based on where this file is now, I think "libxp" might be what Netscape used to call XPCOM (or a close ancestor). You can tell it's loosely based on the same files because both xp_qsort.h and nsQuickSort.h contain this comment that seems to have been carried along for about 22 years:

/* We need this because Solaris' version of qsort is broken and

  • causes array bounds reads.

The possible options I see here involve either putting a definition for XP_SORT into this file, rewriting this to use nsQuickSort, or else simply removing the patch and hoping that whatever issue existed back then has been fixed. Because right now, the only way people can get this to compile on Solaris is by removing this and just using qsort. People have probably just been ripping it out for a couple decades now.

This is in the library, i.e. not our code?

Component: Untriaged → General
Flags: needinfo?(mkmelin+mozilla)

We (unfortunately) maintain that library.
Thanks Petr for the patch, please update it per the comments I made on it.

Assignee: nobody → petr.sumbera
Ever confirmed: true
Flags: needinfo?(mkmelin+mozilla)
OS: Unspecified → Other

Pushed by
remove include of xp_qsort.h on Solaris. r=mkmelin DONTBUILD

Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 72.0
Pushed by
Follow-up: Reformat. rs=reformat
You need to log in before you can comment on or make changes to this bug.