Bug 28795 - Segmentation fault with gcc 4.8.5 during pthread_cleanup_push and pthread_mutex_unlock
Summary: Segmentation fault with gcc 4.8.5 during pthread_cleanup_push and pthread_mut...
Status: RESOLVED MOVED
Alias: None
Product: glibc
Classification: Unclassified
Component: nptl (show other bugs)
Version: 2.22
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-20 09:35 UTC by Digvijay Gour
Modified: 2022-01-21 08:37 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2022-01-20 00:00:00
fweimer: security-


Attachments
C File to reproduce described issue (617 bytes, text/plain)
2022-01-20 09:35 UTC, Digvijay Gour
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Digvijay Gour 2022-01-20 09:35:32 UTC
Created attachment 13917 [details]
C File to reproduce described issue

Hi,

I'm working on SUSE Linux 12.4 platform with gcc 4.8.5 and glibc 2.22.

I have threading application which fails during pthread_mutex_unlock (which is pushed via pthread_cleanup_push)

I've attached source file.

Failure can be reproduced when compiled like :

gcc -m32 -pthread sapl.c -o sapl.o


If it's compiled without -m32 option, it works fine.


Also, issue is reproducing for a single thread too.


Please help out.

Thanks,
Digvijay
Comment 1 Florian Weimer 2022-01-20 11:24:12 UTC
I can't reproduce this with more recent distribution builds.

There were some issues with the old x86 assembler implementations of locking primitives, and we have since removed them.

I suggest to reach out to SUSE to see if they can apply relevant fixes to their distribution. Thanks.
Comment 2 Digvijay Gour 2022-01-21 04:09:31 UTC
Hi,

Thanks for reply. I'll get in touch with SUSE then. Apart from that, is there anyway to resolve this by upgrading glibc version or gcc version to get rid of assembler issues you mentioned earlier?


Thanks.
Comment 3 Florian Weimer 2022-01-21 08:37:19 UTC
(In reply to Digvijay Gour from comment #2)
> Thanks for reply. I'll get in touch with SUSE then. Apart from that, is
> there anyway to resolve this by upgrading glibc version or gcc version to
> get rid of assembler issues you mentioned earlier?

That depends on the nature of the bug. Without knowing the actual cause, I don't think it makes sense to speculate about (reliable) workarounds, sorry.