conditions for setting HAVE___LIBC_STACK_END in nsStackWalk.cpp seem wrong

RESOLVED FIXED in mozilla38

Status

()

Core
XPCOM
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: heycam, Assigned: heycam)

Tracking

Trunk
mozilla38
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Created attachment 8546974 [details] [diff] [review]
patch

https://hg.mozilla.org/mozilla-central/file/bb8d6034f5f2/xpcom/base/nsStackWalk.cpp#l878

The condition there looks wrong.  For one, the || probably should be an &&.  Second, the __GLIBC_MINOR should be an __GLIBC_MINOR__.  What's the actual version number check we should be doing?  From a bit of searching, I think it might be ">= 2.1".

When I try with this patch it fails during linking, though.

cam@mintvm32 ~/moz/a $ objdump -T /lib/ld-linux.so.2 | grep stack_end
00020f2c g    DO .data.rel.ro	00000004  GLIBC_2.1   __libc_stack_end
cam@mintvm32 ~/moz/a $ ./mach build
...
 0:36.52 /home/cam/moz/a/xpcom/base/nsStackWalk.cpp:962: error: undefined reference to '__libc_stack_end'
 0:36.52 collect2: error: ld returned 1 exit status

Mike do you know what's going on here?
Attachment #8546974 - Flags: review?(mh+mozilla)
Attachment #8546974 - Attachment is patch: true
Blocks: 649142
Comment on attachment 8546974 [details] [diff] [review]
patch

Review of attachment 8546974 [details] [diff] [review]:
-----------------------------------------------------------------

::: xpcom/base/nsStackWalk.cpp
@@ +877,5 @@
>  #define HAVE___LIBC_STACK_END 0
>  #endif
>  
>  #if HAVE___LIBC_STACK_END
>  extern void* __libc_stack_end; // from ld-linux.so

This probably needs a MOZ_EXPORT.
Attachment #8546974 - Flags: review?(mh+mozilla) → feedback+
Created attachment 8549176 [details] [diff] [review]
patch (v2)

Thanks, that's exactly what was needed.
Assignee: nobody → cam
Attachment #8546974 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8549176 - Flags: review?(mh+mozilla)
Attachment #8549176 - Flags: review?(mh+mozilla) → review+
https://treeherder.mozilla.org/#/jobs?repo=try&revision=3644e19027a3
https://hg.mozilla.org/integration/mozilla-inbound/rev/f9a5a968a5f3
https://hg.mozilla.org/mozilla-central/rev/f9a5a968a5f3
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.