[MDEV-29324] Compile error in debug mode on s390x (srw_lock.cc) Created: 2022-08-18 Updated: 2023-09-11 Resolved: 2023-09-07 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.8.3 |
| Fix Version/s: | 10.6.16, 10.10.7, 10.11.6, 11.0.4, 11.1.3, 11.2.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Vivian Kong | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
s390x |
||
| Issue Links: |
|
||||||||
| Description |
|
Tried to compile the server in debug mode on s390x but I ran into a compile error in srw_lock.cc (https://github.com/MariaDB/server/blob/10.11/storage/innobase/sync/srw_lock.cc#L121).
|
| Comments |
| Comment by Daniel Black [ 2022-08-21 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
__builtin_tx_nesting_depth() > 0 as a s390x equivalent version of the expression maybe ? | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ehsan Kiani Far [ 2023-06-30 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
I replaced this part of code with __builtin_tx_nesting_depth() > 0 as Daniel suggested. The debug build pass. I am looking for a way to check if that part of code serves its intended purpose. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ehsan Kiani Far [ 2023-08-01 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
I wrote a PoC code to check Daniel's proposed solution:
After compiling and running on s390x, I got this result:
It looks correct to me and must be safe to PR that change and merge. What do you think @Daniel? | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-08-13 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Sure, feel free to target 10.5 with the appropriate pre-processor directives for s390x | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nayana [ 2023-08-30 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
srw_lock.cc file is added in v10.6 . | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-08-30 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
quite right. Looking forward to PR. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nayana [ 2023-09-04 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
PR raised - https://github.com/MariaDB/server/pull/2745 | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-09-04 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Thank you. Based on what I found, the __builtin_tx_nesting_depth() is specific to the s390x (not to POWER) and it was introduced at the same time with the htm target attribute, in GCC 6.5 (or possibly in some earlier release of GCC 6; the documentation I found was for GCC 6.5). By the way, there is a unit test innodb_sync-t that should exercise this.
The unit test program innodb_sync-t is run by the test unit.innodb_sync. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nayana [ 2023-09-11 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Executed above steps and all tests are passing. |