Closed Bug 1326011 Opened 6 years ago Closed 6 years ago

webrtc/trunk/webrtc/base/platform_thread.cc:44:47: error: cast from 'pthread_t {aka pthread*}' to 'pid_t {aka int}' loses precision [-fpermissive]

Categories

(Core :: WebRTC, defect, P2)

Unspecified
FreeBSD
defect

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox50 --- unaffected
firefox51 --- unaffected
firefox52 --- unaffected
firefox53 --- fixed

People

(Reporter: jbeich, Unassigned)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

For some reason our implementation is often lost during rebases.

In file included from media/webrtc/trunk/webrtc/base/base_rtc_base_approved/Unified_cpp_trunk_webrtc_base0.cpp:128:
media/webrtc/trunk/webrtc/base/platform_thread.cc:44:9: error: cast from pointer to
      smaller type 'pid_t' (aka 'int') loses information
  ret = reinterpret_cast<pid_t>(pthread_self());
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from media/webrtc/trunk/webrtc/modules/modules_video_capture_module_internal_impl/Unified_cpp_webrtc_modules0.cpp:2:
In file included from media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc:11:
In file included from media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.h:14:
In file included from media/webrtc/trunk/webrtc/modules/video_capture/device_info_impl.h:16:
media/webrtc/trunk/webrtc/modules/video_capture/video_capture.h:110:9: error: unknown
      type name 'pid_t'
        pid_t* pid = 0) = 0;
        ^
1 error generated.
../../media/webrtc/trunk/webrtc/modules/modules_audio_device/Unified_cpp_webrtc_modules0.o:In function `webrtc_adm_linux::LateBindingSymbolTable<98, &(webrtc_adm_linux_alsa::AlsaSymbolTable_kDllName), &(webrtc_adm_linux_alsa::AlsaSymbolTable_kSymbolNames)>::~LateBindingSymbolTable()':
objdir//media/webrtc/trunk/webrtc/modules/modules_audio_device/Unified_cpp_webrtc_modules0.cpp:(.text._ZN16webrtc_adm_linux22LateBindingSymbolTableILi98EXadL_ZN21webrtc_adm_linux_alsa24AlsaSymbolTable_kDllNameEEEXadL_ZNS1_28AlsaSymbolTable_kSymbolNamesEEEED2Ev[_ZN16webrtc_adm_linux22LateBindingSymbolTableILi98EXadL_ZN21webrtc_adm_linux_alsa24AlsaSymbolTable_kDllNameEEEXadL_ZNS1_28AlsaSymbolTable_kSymbolNamesEEEED2Ev]+0x12): undefined reference to `webrtc_adm_linux::InternalUnloadDll(void*)'
/usr/bin/ld: ../../media/webrtc/trunk/webrtc/modules/modules_audio_device/Unified_cpp_webrtc_modules0.o: relocation R_X86_64_PC32 against `_ZN16webrtc_adm_linux17InternalUnloadDllEPv' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
Attached patch v0 (obsolete) — Splinter Review
No mozreview as git-cinnabar got stuck in a loop trying to find common changesets between inbound and autoland.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=7d8b5f809cc18b77c98344374b94b98c5caab18f
Attachment #8822125 - Flags: review?(rjesup)
Comment on attachment 8822125 [details] [diff] [review]
v0

../../media/webrtc/trunk/webrtc/modules/modules_audio_device/audio_device_pulse_linux.o: In
function `webrtc_adm_linux::LateBindingSymbolTable<55, &(webrtc_adm_linux_pulse::PulseAudioSymbolTable_kDllName), &(webrtc_adm_linux_pulse::PulseAudioSymbolTable_kSymbolNames)>::Load()':
media/webrtc/trunk/webrtc/modules/audio_device/linux/latebindingsymboltable_linux.h:88: undefined reference to `webrtc_adm_linux::InternalLoadDll(char const*)'
/usr/bin/ld: ../../media/webrtc/trunk/webrtc/modules/modules_audio_device/audio_device_pulse_linux.o: relocation R_X86_64_PC32 against `_ZN16webrtc_adm_linux15InternalLoadDllEPKc' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
Attachment #8822125 - Attachment is obsolete: true
Attachment #8822125 - Flags: review?(rjesup)
Attached patch v0.1Splinter Review
https://treeherder.mozilla.org/#/jobs?repo=try&revision=56f50ec563914a9e2c4d1e8ebfe95896eb77f1f8

Tested:
o --disable-alsa + --enable-pulseaudio (default)
o --enable-alsa + --disable-pulseaudio (my conf)
o --enable-alsa + --enable-pulseaudio (default in our ports)
o --disable-alsa + --disable-pulseaudio (never worked)
Attachment #8822131 - Flags: review?(rjesup)
This seems like something we should uplift to webrtc.org.
(This reminds me of bug 301986.)

I don't like using an lwp id instead of the pthread id; that there is a 1:1 correlation is an implementation detail and should not be relied upon in applications. I don't know what the ID is used for tho
(In reply to Martin Husemann from comment #7)
> (This reminds me of bug 301986.)

The code here is from bug 807492 or bug 753046.

> I don't like using an lwp id instead of the pthread id; that there is a 1:1
> correlation is an implementation detail and should not be relied upon in
> applications.

WebRTC only uses it for logging and event_tracer. pthread_self() value is unlikely to valid across processes.
Attachment #8822131 - Flags: review?(rjesup) → review+
Keywords: checkin-needed
backlog: --- → webrtc/webaudio+
Rank: 25
Priority: -- → P2
https://hg.mozilla.org/mozilla-central/rev/b8ab1963da32
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.