Flame building issues, v4l includes?

Hi.

I tried posting this to the ML as well, but a) that was withheld for moderation and b) the ML seems a lot less frequented. I apologize if this ‘cross post’ is against the etiquette here.

I’m building on Arch Linux, after a long hiatus/switching machines, and my build fails in objdir-gecko/media/webrtc/trunk/webrtc/modules/modules_video_capture_module_internal_impl with

/usr/bin/ccache /home/dar/temp/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -std=gnu++11 -o Unified_cpp_webrtc_modules0.o -c -I/home/dar/rojects/B2G/objdir-gecko/dist/system_wrappers -include /home/dar/projects/B2G/gecko/config/gcc_hidden.h -DNDEBUG -DTRIMMED=1 -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DUSE_LIBJPEG_TURBO=1 -DUSE_NSS=1 -DENABLE_ONE_CLICK_SIGNIN -DGTK_DISABLE_SINGLE_INCLUDES=1 -D_ISOC99_SOURC=1 -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DENABLE_CONFIGURATION_POLICY -DENABLE_INPUT_SPEECH -DENABLE_NOTIFICATIONS -DENABLE_GPU=1 -DENABLE_EGLIMAGE=1 -DUSE_SKIA=1 -DENABLE_TASK_MANAGER=1 -DENABLE_WEB_INTENTS=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGIN_INSTALLATION=1 -DENABLEPROTECTOR_SERVICE=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_BACKGROUND=1 -DENABLE_AUTOMATION=1 -DENABLE_PRINTING=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DWEBRTC_GONK -DWEBRTC_MOZILLA_BUILD -DEXPAT_RELATIVE_PATH -DWEBRTC_ARCH_ARM -DWEBRTC_ARCH_ARM_V7 -DWEBRTC_UILD_NEON_LIBS -DWEBRTC_DETECT_ARM_NEON -DWEBRTC_POSIX -DWEBRTC_LINUX -DWEBRTC_ANDROID_OPENSLES -DMOZ_WEBRTC_OMX -D__STDC_FORMAT_MACROS -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DSTATIC_EXPORTABLE_JS_API -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/home/dar/projects/B2G/geco/media/webrtc/trunk/webrtc/modules -I/home/dar/projects/B2G/objdir-gecko/media/webrtc/trunk/webrtc/modules/modules_video_capture_module_internal_impl -I/home/dar/projects/B2G/gecko/media/webrtc/trunk -I/home/dar/projects/B2G/objdir-gecko/ipc/ipdl/_ipdlheaders -I/home/darprojects/B2G/gecko/ipc/chromium/src -I/home/dar/projects/B2G/gecko/ipc/glue -I/home/dar/projects/B2G/objdir-gecko/dist/include -fPIC -DMOZILLA_CLIENT -include /home/dar/projects/B2G/objdir-gecko/mozilla-config.h -MD -MP -MF .deps/Unified_cpp_webrtc_modules0.o.pp -I/home/dr/projects/B2G/system -I/home/dar/projects/B2G/system/core/include -I/home/dar/projects/B2G/hardware/libhardware/include -I/home/dar/projects/B2G/external/valgrind/fxos-include -I/home/dar/projects/B2G/frameworks/native/include -I/home/dar/projects/B2G/frameworks/av/inclue -I/home/dar/projects/B2G/frameworks/av/include/media -I/home/dar/projects/B2G/frameworks/av/include/camera -I/home/dar/projects/B2G/frameworks/native/include/media/openmax -I/home/dar/projects/B2G/frameworks/av/media/libstagefright/include -idirafter /home/dar/temp/andrid-ndk-r11c/platforms/android-19/arch-arm/usr/include -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wthread-safety -Wno-error=maybe-uninitilized -Wno-error=deprecated-declarations -Wno-error=array-bounds -fno-short-enums -fno-exceptions -DMOZ_ENABLE_JS_DUMP -include /home/dar/projects/B2G/gonk-misc/Unicode.h -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=softfp -mno-unaligned-access -I/home/dar/temp/android-nk-r11c/sources/android/support/include -I/home/dar/temp/android-ndk-r11c/sources/cxx-stl/llvm-libc++/libcxx/include -I/home/dar/temp/android-ndk-r11c/sources/cxx-stl/llvm-libc++abi/libcxxabi/include -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdatasections -fno-exceptions -fno-math-errno -pipe -g -freorder-blocks -fno-reorder-functions -Os -funwind-tables -I/home/dar/projects/B2G/objdir-gecko/dist/include/nspr /home/dar/projects/B2G/objdir-gecko/media/webrtc/trunk/webrtc/modules/modules_video_capture_module_interna_impl/Unified_cpp_webrtc_modules0.cpp
In file included from /home/dar/projects/B2G/objdir-gecko/media/webrtc/trunk/webrtc/modules/modules_video_capture_module_internal_impl/Unified_cpp_webrtc_modules0.cpp:2:0:
/home/dar/projects/B2G/gecko/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc: In member function 'int32_t webrtc::videocapturemodule::DeviceInfoLinux::FillCapabilities(int)':
/home/dar/projects/B2G/gecko/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc:408:29: error: aggregate 'webrtc::videocapturemodule::DeviceInfoLinux::FillCapabilities(int)::v4l2_frmsizeenum frmsize' has incomplete type and cannot be defined
     struct v4l2_frmsizeenum frmsize;
                             ^
/home/dar/projects/B2G/gecko/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc:409:29: error: aggregate 'webrtc::videocapturemodule::DeviceInfoLinux::FillCapabilities(int)::v4l2_frmivalenum frmival' has incomplete type and cannot be defined
     struct v4l2_frmivalenum frmival;
                             ^
/home/dar/projects/B2G/gecko/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc:416:26: error: 'VIDIOC_ENUM_FRAMESIZES' was not declared in this scope
         while (ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &frmsize) >= 0) {
                          ^
/home/dar/projects/B2G/gecko/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc:417:33: error: 'V4L2_FRMSIZE_TYPE_DISCRETE' was not declared in this scope
             if (frmsize.type == V4L2_FRMSIZE_TYPE_DISCRETE) {
                                 ^
/home/dar/projects/B2G/gecko/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc:422:31: error: 'VIDIOC_ENUM_FRAMEINTERVALS' was not declared in this scope
                 if (ioctl(fd, VIDIOC_ENUM_FRAMEINTERVALS, &frmival) >= 0) {

But … the file in question (device_info_linux.cc) has these includes

#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/videoio.h>
#elif defined(__sun)
#include <sys/videodev2.h>
#else
#include <linux/videodev2.h>
#endif

and /usr/include/linux/videodev2.h line 2243 is

#define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum)

What am I missing? Thanks in advance,
Ben

You need to apply the patches from https://bugzilla.mozilla.org/show_bug.cgi?id=1304965

Whoa. That was insanely fast. Very much appreciated and I apologize that I didn’t see that bug earlier. I did a general “What could I do wrong here” type of search, but didn’t search bugzilla. My bad.

Appreciated!

That patch allowed me to build successfully and I could flash the result. Unfortunately that is broken (screen stays off, logcat shows a looping SIGSEGV. I … assume that’s because building ‘master’ isn’t a good idea and that this isn’t a problem on my side anymore, right? After the SIGSEGV everything dies

I/ServiceManager( 191): service ‘android.security.keystore’ died
6 I/ServiceManager( 191): service ‘SurfaceFlinger’ died
5 I/ServiceManager( 191): service ‘permission’ died
4 I/ServiceManager( 191): service ‘display.qservice’ died
3 I/ServiceManager( 191): service ‘media.audio_flinger’ died
2 I/ServiceManager( 191): service ‘media.player’ died
1 I/ServiceManager( 191): service ‘media.camera’ died
0 I/ServiceManager( 191): service ‘media.audio_policy’ died

and the process starts all over again.

You should use the ./run-gdb.sh script to start b2g and get a backtrace to track the issue.

Is this helpful? I’m - kinda lost. Also - is this thread the right way to ask about this issue?
Screen stays dark (only the ‘charging/connected’ LED is on), logcat repeats and so I assume the bt would repeat as well.

(gdb) c
Continuing.
*****************************************************************
***
*** This is stdout. Most of the useful output will be in logcat.
***
*****************************************************************
MobileConnectionService: init complete
[New Thread 1761.1809]

Program received signal SIGSEGV, Segmentation fault.
InvalidArrayIndex_CRASH (aIndex=aIndex@entry=0, aLength=0) at /home/dar/projects/B2G/gecko/xpcom/glue/nsTArray.cpp:35
35	  MOZ_REALLY_CRASH();
(gdb) bt
#0  InvalidArrayIndex_CRASH (aIndex=aIndex@entry=0, aLength=0) at /home/dar/projects/B2G/gecko/xpcom/glue/nsTArray.cpp:35
#1  0xb4229df8 in nsTArray_Impl<mp4_demuxer::Sample*, nsTArrayInfallibleAllocator>::ElementAt (this=<optimized out>, 
    aIndex=aIndex@entry=0) at ../../dist/include/nsTArray.h:1045
#2  0xb50684b4 in operator[] (aIndex=0, this=<optimized out>) at ../../dist/include/nsTArray.h:1071
#3  nsScreenManagerGonk::GetPrimaryScreen (this=<optimized out>, outScreen=0xbea83be4)
    at ../../../gecko/widget/gonk/nsScreenManagerGonk.cpp:843
#4  0xb47cf3da in gfxPlatform::PopulateScreenInfo (this=0xb04627a0) at ../../../gecko/gfx/thebes/gfxPlatform.cpp:1222
#5  0xb47d0edc in gfxPlatform::Init () at ../../../gecko/gfx/thebes/gfxPlatform.cpp:687
#6  0xb47d123a in gfxPlatform::GetPlatform () at ../../../gecko/gfx/thebes/gfxPlatform.cpp:518
#7  0xb5041c3c in mozilla::widget::GfxInfoBase::GetContentBackend (this=<optimized out>, aContentBackend=...)
    at /home/dar/projects/B2G/gecko/widget/GfxInfoBase.cpp:1406
#8  0xb427f0a2 in NS_InvokeByIndex (that=<optimized out>, methodIndex=<optimized out>, paramCount=<optimized out>, 
    params=<optimized out>) at ../../../../../../gecko/xpcom/reflect/xptcall/md/unix/xptcinvoke_arm.cpp:169
#9  0xb461f5b6 in Invoke (this=0xbea83db8) at /home/dar/projects/B2G/gecko/js/xpconnect/src/XPCWrappedNative.cpp:2063
#10 Call (this=0xbea83db8) at /home/dar/projects/B2G/gecko/js/xpconnect/src/XPCWrappedNative.cpp:1382
#11 XPCWrappedNative::CallMethod (ccx=..., mode=mode@entry=XPCWrappedNative::CALL_GETTER)
    at /home/dar/projects/B2G/gecko/js/xpconnect/src/XPCWrappedNative.cpp:1349
#12 0xb4623510 in GetAttribute (ccx=...) at /home/dar/projects/B2G/gecko/js/xpconnect/src/xpcprivate.h:1884
#13 XPC_WN_GetterSetter (cx=0xb1e11000, argc=0, vp=0xbea83fe8)
    at /home/dar/projects/B2G/gecko/js/xpconnect/src/XPCWrappedNativeJSOps.cpp:1179
#14 0xb59e8378 in CallJSNative (args=..., native=0xb46233e1 <XPC_WN_GetterSetter(JSContext*, unsigned int, JS::Value*)>, cx=0xb1e11000)
    at ../../../gecko/js/src/jscntxtinlines.h:239
#15 js::InternalCallOrConstruct (cx=cx@entry=0xb1e11000, args=..., construct=construct@entry=js::NO_CONSTRUCT)
    at /home/dar/projects/B2G/gecko/js/src/vm/Interpreter.cpp:458
#16 0xb59e85ae in InternalCall (cx=cx@entry=0xb1e11000, args=...) at /home/dar/projects/B2G/gecko/js/src/vm/Interpreter.cpp:503
#17 0xb59e8622 in js::Call (cx=cx@entry=0xb1e11000, fval=..., fval@entry=..., thisv=..., thisv@entry=..., args=..., 
    rval=rval@entry=...) at /home/dar/projects/B2G/gecko/js/src/vm/Interpreter.cpp:522
#18 0xb59e868c in js::CallGetter (cx=cx@entry=0xb1e11000, thisv=..., getter=getter@entry=..., rval=rval@entry=...)
    at /home/dar/projects/B2G/gecko/js/src/vm/Interpreter.cpp:636
#19 0xb59e86ec in CallGetter (cx=cx@entry=0xb1e11000, obj=..., obj@entry=..., receiver=..., receiver@entry=..., shape=..., 
    shape@entry=..., vp=vp@entry=...) at /home/dar/projects/B2G/gecko/js/src/vm/NativeObject.cpp:1757
#20 0xb59e8960 in GetExistingProperty<(js::AllowGC)1> (vp=..., shape=..., obj=..., receiver=..., cx=0xb1e11000)
    at /home/dar/projects/B2G/gecko/js/src/vm/NativeObject.cpp:1809
#21 NativeGetPropertyInline<(js::AllowGC)1> (vp=..., nameLookup=NotNameLookup, id=..., receiver=..., obj=..., cx=0xb1e11000)
    at /home/dar/projects/B2G/gecko/js/src/vm/NativeObject.cpp:2032
#22 js::NativeGetProperty (cx=0xb1e11000, obj=..., receiver=..., id=..., vp=vp@entry=...)
    at /home/dar/projects/B2G/gecko/js/src/vm/NativeObject.cpp:2066
#23 0xb5932c10 in GetProperty (vp=..., id=..., receiver=..., obj=..., cx=<optimized out>)
    at ../../../gecko/js/src/vm/NativeObject.h:1497
#24 js::GetProperty (cx=<optimized out>, obj=..., receiver=..., id=..., vp=...) at ../../../gecko/js/src/jsobj.h:854
#25 0xb59e0f80 in GetObjectElementOperation (op=<optimized out>, res=..., key=..., receiver=..., obj=..., cx=0xb1e11000)
    at ../../../gecko/js/src/vm/Interpreter-inl.h:458
#26 GetElementOperation (op=<optimized out>, res=..., rref=..., lref=..., cx=<optimized out>)
    at ../../../gecko/js/src/vm/Interpreter-inl.h:563
#27 Interpret (cx=0xb1e11000, state=...) at /home/dar/projects/B2G/gecko/js/src/vm/Interpreter.cpp:2760
#28 0xb59e80de in js::RunScript (cx=cx@entry=0xb1e11000, state=...) at /home/dar/projects/B2G/gecko/js/src/vm/Interpreter.cpp:404
#29 0xb59e8242 in js::InternalCallOrConstruct (cx=0xb1e11000, args=..., construct=construct@entry=js::NO_CONSTRUCT)
    at /home/dar/projects/B2G/gecko/js/src/vm/Interpreter.cpp:476
#30 0xb59e85ae in InternalCall (cx=<optimized out>, args=...) at /home/dar/projects/B2G/gecko/js/src/vm/Interpreter.cpp:503
#31 0xb59e8622 in js::Call (cx=<optimized out>, fval=..., fval@entry=..., thisv=..., thisv@entry=..., args=..., rval=rval@entry=...)
    at /home/dar/projects/B2G/gecko/js/src/vm/Interpreter.cpp:522
#32 0xb5901292 in JS_CallFunctionValue (cx=<optimized out>, obj=obj@entry=..., fval=fval@entry=..., args=..., rval=rval@entry=...)
    at /home/dar/projects/B2G/gecko/js/src/jsapi.cpp:2777
#33 0xb46225d6 in nsXPCWrappedJSClass::CallMethod (this=0xb1c4a430, wrapper=wrapper@entry=0xb0461c00, methodIndex=methodIndex@entry=3, 
    info_=info_@entry=0xb1c039c0, nativeParams=nativeParams@entry=0xbea84830)
    at /home/dar/projects/B2G/gecko/js/xpconnect/src/XPCWrappedJSClass.cpp:1211
#34 0xb4622b9a in nsXPCWrappedJS::CallMethod (this=0xb0461c00, methodIndex=<optimized out>, info=0xb1c039c0, params=0xbea84830)
    at /home/dar/projects/B2G/gecko/js/xpconnect/src/XPCWrappedJS.cpp:613
#35 0xb427f93a in PrepareAndDispatch (self=0xb040fde0, methodIndex=<optimized out>, args=<optimized out>)
    at ../../../../../../gecko/xpcom/reflect/xptcall/md/unix/xptcstubs_arm.cpp:103
#36 0xb427f0e8 in SharedStub () from /home/dar/projects/B2G/objdir-gecko/toolkit/library/libxul.so
#37 0xb4271c10 in NS_CreateServicesFromCategory (aCategory=aCategory@entry=0xb5d73ce0 "profile-after-change", 
    aOrigin=aOrigin@entry=0x0, aObserverTopic=aObserverTopic@entry=0xb5d73ce0 "profile-after-change", 
    aObserverData=aObserverData@entry=0x0) at ../../../gecko/xpcom/components/nsCategoryManager.cpp:825
#38 0xb5461b4e in nsXREDirProvider::DoStartup (this=this@entry=0xbea84b24)
    at /home/dar/projects/B2G/gecko/toolkit/xre/nsXREDirProvider.cpp:1172
#39 0xb545e846 in XREMain::XRE_mainRun (this=this@entry=0xbea84b08) at ../../../gecko/toolkit/xre/nsAppRunner.cpp:4257
#40 0xb545eca6 in XREMain::XRE_main (this=this@entry=0xbea84b08, argc=argc@entry=1, argv=argv@entry=0xb6a030c0, 
    aAppData=aAppData@entry=0xb6f72d90 <sAppData>) at ../../../gecko/toolkit/xre/nsAppRunner.cpp:4552
#41 0xb545ee7a in XRE_main (argc=1, argv=0xb6a030c0, aAppData=0xb6f72d90 <sAppData>, aFlags=<optimized out>)
    at ../../../gecko/toolkit/xre/nsAppRunner.cpp:4643
#42 0xb6f4b51c in do_main (argv=0xb6a030c0, argc=1) at ../../../gecko/b2g/app/nsBrowserApp.cpp:163
#43 main (argc=1, argv=<optimized out>) at ../../../gecko/b2g/app/nsBrowserApp.cpp:239