[MDEV-33092] Undefined reference to concurrency on Solaris Created: 2023-12-20  Updated: 2024-01-10  Resolved: 2024-01-10

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.11.6
Fix Version/s: 10.5.24, 10.6.17, 10.11.7, 11.0.5, 11.1.4, 11.2.3

Type: Bug Priority: Major
Reporter: Rainer Orth Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None
Environment:

Solaris 11.4/x86 with GCC 13.2.0


Attachments: File MDEV-33092-thr_setconcurrency.patch    

 Description   

The MariaDB 10.11.6 `mysqld` doesn't link on Solaris:
```
Undefined first referenced
symbol in file
concurrency ../../sql/libsql.a(mysqld.cc.o)
```
This is from a call in `sql/mysqld.cc` (`mysql_main`):
```
(void) thr_setconcurrency(concurrency); // 10 by default
```
The `concurrency` variable had been ripped out in MDEV-18650 with the deprecation of `thread_concurrency`, but that has been incomplete. It seems that this issue wasn't noticed on other targets since `my_pthread.h` has:
```
#ifndef HAVE_THR_SETCONCURRENCY
#define thr_setconcurrency(A) pthread_dummy(0)
#endif
```
while Solaris *does* have `thr_setconcurrency`.

Given the previous (incomplete) removal, I've just removed this call as well.



 Comments   
Comment by Sergei Golubchik [ 2024-01-03 ]

same as with other issues. We don't have Solaris in CI, but if you'll provide a patch, we'll apply it (providing it won't break anything else)

Comment by Rainer Orth [ 2024-01-09 ]

I now have a proper patch (for 11.4) for this issue. There are two issues with the use of `thr_setconcurrency`:

  • Some calls use a `concurrency` argument which has been removed in MDEV-18650, wo fail to compile. These calls must go to unbreak the Solaris build.
  • However, in other cases calls to `thr_setconcurrency` are guarded with `HAVE_THR_SETCONCURRENCY` and use fixed args. While they could stay, there's no equivalent code on other targets. Besides, the Solaris 11.4 `thr_setconcurrency(3C)` declares thefunction as obsolete, so I've decided to remove those calls, too. MDEV-33092-thr_setconcurrency.patch
Generated at Thu Feb 08 10:36:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.