After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 104718 - pthread fix for NetBSD-1.6M
pthread fix for NetBSD-1.6M
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.2.x
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2003-01-29 12:41 UTC by Thomas Klausner
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to fix the problem (536 bytes, patch)
2003-01-29 12:42 UTC, Thomas Klausner
none Details | Review
patch to _really_ solve the problem (1.05 KB, patch)
2003-01-30 15:01 UTC, Sebastian Wilhelmi
none Details | Review
Another try (1.03 KB, patch)
2003-05-26 13:19 UTC, Sebastian Wilhelmi
none Details | Review

Description Thomas Klausner 2003-01-29 12:41:45 UTC
The NetBSD package for glib2 had a patch added with the following comment:

Check for symbol "_POSIX_THREAD_PRIORITY_SCHEDULING" to detect existance of
pthread_attr_getschedparam() and pthread_attr_setschedparam() as suggested
by Nathan J. Williams.

I'll attach the patch to the bug report, if I manage to.

It is needed to get glib2 to compile&work on NetBSD-1.6M.
Comment 1 Thomas Klausner 2003-01-29 12:42:47 UTC
Created attachment 13911 [details] [review]
patch to fix the problem
Comment 2 Owen Taylor 2003-01-29 17:36:34 UTC
What happens without this change? It's not apparent
from the patch why it would be needed.
Comment 3 Thomas Klausner 2003-01-30 01:30:48 UTC
Without this change, libgthread contained references to the
(non-existing) functions pthread_attr_setschedparam() and
pthread_attr_getschedparam().
Comment 4 Sebastian Wilhelmi 2003-01-30 15:01:23 UTC
I'd prefer the following patch. Would you mind testing it for NetBSD?
Comment 5 Sebastian Wilhelmi 2003-01-30 15:01:58 UTC
Created attachment 13951 [details] [review]
patch to _really_ solve the problem
Comment 6 Thomas Klausner 2003-01-31 18:22:50 UTC
Does not fix the problem, results in exactly the same error.
Comment 7 Sebastian Wilhelmi 2003-01-31 23:12:18 UTC
Hm, but if that works, it means, that pthread_attr_setschedparam is
available. Can you attach config.log
Comment 8 Matthias Scheler 2003-02-02 15:43:06 UTC
The suggested fix checks for pthread_attr_setschedparam() while the
code in "gthread-posix.c" uses pthread_setschedparam(). Maybe that
is the real problem.
Comment 9 Sebastian Wilhelmi 2003-02-03 09:23:22 UTC
Ok, gthread-posix.c uses both pthread_attr_setschedparam() and
pthread_setschedparam(). Obviously pthread_attr_setschedparam() is
defined in NetBSD, otherwise the configure check would fail. So what
exactly is the error, when compiling stock GLib on NetBBSD. Which
symbols are unresolved?
Comment 10 Owen Taylor 2003-05-22 18:16:37 UTC
Please reopen from NEEDINFO if you add more information.
Comment 11 Thomas Klausner 2003-05-23 20:25:16 UTC
I don't see a configure test for pthread_attr_setschedparam:
``grep pthread_attr_setschedparam configure'' is empty.

Without the patch, compilation works, but spews warnings:
In file included from gthread-impl.c:45:
gthread-posix.c: In function `g_thread_impl_init':
gthread-posix.c:135: warning: implicit declaration of function
`pthread_getschedparam'
gthread-posix.c: In function `g_thread_set_priority_posix_impl':
gthread-posix.c:391: warning: implicit declaration of function
`pthread_setschedparam'
gthread-impl.c: At top level:
gthread-posix.c:118: warning: `g_thread_min_stack_size' defined but
not used

make test fails, with:
creating list-test
cc ........
../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_getschedparam'
../gthread/.libs/libgthread-2.0.so: undefined reference to
`pthread_setschedparam'

What else do you want to know?
Comment 12 Sebastian Wilhelmi 2003-05-26 13:19:24 UTC
Then the following patch should fix it.

Please try.
Comment 13 Sebastian Wilhelmi 2003-05-26 13:19:49 UTC
Created attachment 16851 [details] [review]
Another try
Comment 14 Owen Taylor 2003-06-02 19:48:59 UTC
I think you can go ahead and commit this, even though it
would be good to have comfirmation that it fixes the
problem. It looks pretty safe to me.
Comment 15 Thomas Klausner 2003-06-02 21:09:16 UTC
Patch works for me and Matthias Scheler.
Comment 16 Sebastian Wilhelmi 2003-06-03 12:44:10 UTC
2003-06-03  Sebastian Wilhelmi  <seppi@seppi.de>

	* configure.in: Test for pthread_setschedparam. If not existant,
	disable priorities. (#104718)


Only commited to HEAD. Reopen, if you think, glib-2-2 should have it too.
Comment 17 Thomas Klausner 2003-06-03 13:48:09 UTC
I'd appreciate it if the fix could be included on the 2.2 branch too.
Thanks!
Comment 18 Owen Taylor 2003-06-03 13:55:25 UTC
I'd agree that it's the kind of fix that should go into
the stable branch.
Comment 19 Sebastian Wilhelmi 2003-06-03 14:09:58 UTC
Done.