Bug 93105 - Libglamoregl.so module fails to load because of undefined symbol: fbComposite
Summary: Libglamoregl.so module fails to load because of undefined symbol: fbComposite
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Acceleration/glamor (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: high critical
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 93107
  Show dependency treegraph
 
Reported: 2015-11-25 16:30 UTC by Giovanni Mariani
Modified: 2015-12-12 18:03 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Log file of failed server startup with the new R270X card (31.39 KB, text/plain)
2015-11-25 16:30 UTC, Giovanni Mariani
no flags Details
Log file of failed libglamoregl.so load with the old HD5750 card (63.74 KB, text/plain)
2015-11-25 16:32 UTC, Giovanni Mariani
no flags Details
Try to fix undefined symbols from libfb.so in liglamoregl.so (1.09 KB, patch)
2015-11-25 16:37 UTC, Giovanni Mariani
no flags Details | Splinter Review
Try to fix undefined symbols from libfb.so in ligshadow.so (1.09 KB, patch)
2015-11-25 16:50 UTC, Giovanni Mariani
no flags Details | Splinter Review
radeon: Load fb earlier (774 bytes, patch)
2015-11-26 02:17 UTC, Michel Dänzer
no flags Details | Splinter Review

Description Giovanni Mariani 2015-11-25 16:30:44 UTC
Created attachment 120116 [details]
Log file of failed server startup with the new R270X card

Running ROSA 2014.1 R6 on x86_64, with a Radeon HD5750 video card.
For the above distribution I routinely build updated packages of libdrm, pixman, Mesa, xserver and related libraries and drivers and test them on my pc.

Some days ago I bought a newer video cards (Radeon R270X) to upgrade my pc system and then the xserver started to hang on startup: in the log file attached below there is a couple of error messages about libglamoregl.so and libshadow.so failing to load because of undefined symbols error: fbComposite for the first one, fbGetScreenPrivateKey for the latter.
Given that the R270X use the radeonsi driver and this in turn needs glamor to work, I guess that the hang originates here...
With the old video card (r600 driver), when setting "AccelMethod" to "glamor", there is the same error, but no hang because the driver automatically falls back to EXA.


The build log for the xserver I'm testing now (1.17.4) shows indeed many warnings about undefined symbols in libglamoregl.so, libshadow.so and some more xserver modules:
*********************
Warning: undefined symbols in /usr/lib64/xorg/modules/libvgahw.so: xf86FindOption xf86GetPciInfoForEntity xf86GetFlipPixels xf86IsUnblank xf86MarkOptionUsedByName xf86AllocateScrnInfoPrivateIndex xf86ScreenToScrn XNFcalloc xf86DrvMsg xf86SlowBcopy xf86HandleColormaps xf86DrvMsgVerb

Warning: undefined symbols in /usr/lib64/xorg/modules/libfb.so: miPolyRectangle miFillPolygon miPolyFillArc miPolyText8 miPolyText16 miImageText8 miImageText16 miChangeGC miCopyGC miDestroyGC miChangeClip miDestroyClip miCopyClip miZeroLineScreenKeyRec miWideDash globalSerialNumber miCompositeRects miWideLine screenInfo NoopDDA RegionEmptyData miPolySegment PictureScreenPrivateKeyRec PixmapWidthPaddingInfo RegionEmptyBox RegionRectAlloc miDoCopy miPolyArc miComputeCompositeClip miCompositeSourceValidate miSetVisualTypesAndMasks miPictureInit ValidateGC ShmRegisterFbFuncs FreePixmap dixRegisterPrivateKey RegionCreate FakeClientID miListInstalledColormaps ChangeGC GetGlyphPicture miScreenInit miInstallColormap miInitVisuals AllocatePixmap dixRegisterScreenSpecificPrivateKey miHandleExposures miExpandDirectColors miCreateDefColormap miWindowExposures miResolveColor miSetVisualTypes miInitializeColormap miCreateScreenResources DamageRegionAppend miZeroArcSetup miZeroPolyArc miUninstallColormap miClearVisualTypes DamageRegionProcessPending miCopyRegion miModifyPixmapHeader miZeroClipLine

Warning: undefined symbols in /usr/lib64/xorg/modules/libexa.so: miPolyRectangle miFillPolygon miPolyFillArc miPolyText8 miPolyText16 miImageText8 miImageText16 globalSerialNumber serverClient RegionEmptyData PictureScreenPrivateKeyRec PixmapWidthPaddingInfo RegionEmptyBox miDoCopy RegionDestroy xf86ScrnToScreen ValidatePicture ValidateGC dixRegisterPrivateKey DamageSetReportAfterOp RegionFromRects DamageRegion RegionCreate GetScratchGC FreeScratchGC ShmRegisterFuncs CreatePicture GetGlyphPicture miTriangleBounds PictureMatchFormat dixRegisterScreenSpecificPrivateKey xf86ScreenToScrn AdjustWaitForDelay FatalError miGlyphs xf86DrvMsg GetTimeInMillis DamageDestroy XNFalloc xf86ReturnOptValBool DamagePendingRegion DamageDamageRegion DamageRegionAppend miComputeCompositeRegion LogMessage CompositePicture DamageRegionProcessPending DamageRegister FreePicture miCopyRegion xf86ProcessOptions xf86GetOptValString miTrapezoidBounds ErrorF DamageCreate

Warning: undefined symbols in /usr/lib64/xorg/modules/libvbe.so: xf86ValidateModes xf86PrintModes xf86int10Addr XNFasprintf xf86CVTMode xf86FindScreenForEntity xf86LoadSubModule xf86ErrorFVerb XNFcalloc xf86DrvMsg xf86ExtendedInitInt10 xf86GetOptValBool xf86ExecX86int10 XNFalloc xf86Int10FreePages xf86ModeStatusToString xf86CheckModeForMonitor xf86InterpretEDID xf86DrvMsgVerb xf86FreeInt10 xf86Int10AllocPages xf86ProcessOptions ErrorF

Warning: undefined symbols in /usr/lib64/xorg/modules/libint10.so: xf86GetEntityInfo xf86GetPciInfoForEntity xf86MsgVerb xf86IsEntityPrimary xf86GetVerbosity xf86FindScreenForEntity xf86ErrorFVerb XNFcalloc VErrorF xf86DrvMsg OsBlockSignals xf86GetOptValBool XNFalloc OsReleaseSignals xf86DrvMsgVerb xf86ProcessOptions

Warning: undefined symbols in /usr/lib64/xorg/modules/extensions/libglx.so: noGlxExtension xf86Info enableIndirectGLX currentMaxClients serverClient StandardMinorOpcode lastGLContext screenInfo clients ClientStateCallback NoopDDA serverGeneration DRI2HasSwapControl AddCallback DRI2GetBuffersWithFormat xf86ScrnToScreen xf86Msg ResetCurrentRequest ValidateGC LoaderSymbol dixLookupFontable FreeResource dixRegisterPrivateKey IgnoreClient dixLookupResourceByType LegalNewID DRI2SwapBuffers dixLookupWindow FakeClientID FindWindowWithOptional CreateNewResourceType DRI2WaitSwap DRI2Connect FreeGC AttendClient ResizeVisualArray AddResource xf86ScreenToScrn dixLookupDrawable CreateGC DRI2CopyRegion DRI2SwapInterval FatalError AddExtensionAlias FreeResourceByType LoadExtensionList AddExtension XNFalloc LogMessage LogMessageVerbSigSafe DRI2GetBuffers DRI2CreateDrawable2 present_register_complete_notify WriteEventsToClient WriteToClient ErrorF

Warning: undefined symbols in /usr/lib64/xorg/modules/libwfb.so: miPolyRectangle miFillPolygon miPolyFillArc miPolyText8 miPolyText16 miImageText8 miImageText16 miChangeGC miCopyGC miDestroyGC miChangeClip miDestroyClip miCopyClip miZeroLineScreenKeyRec miWideDash globalSerialNumber miCompositeRects miWideLine screenInfo NoopDDA RegionEmptyData miPolySegment PictureScreenPrivateKeyRec PixmapWidthPaddingInfo RegionEmptyBox RegionRectAlloc miDoCopy miPolyArc miComputeCompositeClip miCompositeSourceValidate miSetVisualTypesAndMasks miPictureInit ValidateGC ShmRegisterFbFuncs FreePixmap dixRegisterPrivateKey RegionCreate FakeClientID miListInstalledColormaps ChangeGC GetGlyphPicture miScreenInit miInstallColormap miInitVisuals AllocatePixmap dixRegisterScreenSpecificPrivateKey miHandleExposures miExpandDirectColors miCreateDefColormap miWindowExposures miResolveColor miSetVisualTypes miInitializeColormap miCreateScreenResources DamageRegionAppend miZeroArcSetup miZeroPolyArc miUninstallColormap miClearVisualTypes DamageRegionProcessPending miCopyRegion miModifyPixmapHeader miZeroClipLine

Warning: undefined symbols in /usr/lib64/xorg/modules/libfbdevhw.so: xf86IsUnblank xf86AllocateScrnInfoPrivateIndex xf86ScreenToScrn XNFcalloc xf86DuplicateMode xf86DrvMsg XNFalloc xf86DrvMsgVerb
Warning: undefined symbols in /usr/lib64/xorg/modules/libshadowfb.so: dixRegisterPrivateKey DamageSetReportAfterOp xf86ScreenToScrn DamageRegister ErrorF DamageCreate

Warning: undefined symbols in /usr/lib64/xorg/modules/drivers/modesetting_drv.so: xf86CrtcConfigPrivateIndex xf86SaveScreen xf86DPMSSet NoopDDA serverGeneration shadowRemove xf86SetDefaultVisual xf86GetDefaultModes xf86GetEntityInfo xf86GetDevFromEntity xf86IsEntityShared xf86ClaimFbSlot xf86ModesAdd RegisterBlockAndWakeupHandlers xf86SetSingleMode xf86ModeWidth xf86ScrnToScreen RRChangeOutputProperty glamor_set_screen_pixmap xf86RemoveGeneralHandler xf86SetDpi present_screen_init glamor_egl_create_textured_pixmap_from_gbm_bo DRI2SwapComplete xf86SetBlackWhitePixels drmModeSetCrtc xf86PruneInvalidModes drmModeGetResources ValidateGC xf86XVScreenInit drmModeGetConnector drmModeRmFB drmModeFreeEncoder drmDropMaster xf86SetGamma xf86GetPciInfoForEntity dixRegisterPrivateKey RRCrtcGammaSet dixLookupResourceByType xf86MatchDevice glamor_egl_get_gbm_device DamageRegion xf86OutputFindClosestMode shadowSetup RegionCreate drmSetInterfaceVersion xf86PrintDepthBpp xf86CrtcCreate drmGetBusid drmWaitVBlank fbScreenInit glamor_xv_init GetScratchGC FreeScratchGC glamor_egl_destroy_textured_pixmap glamor_name_from_pixmap drmModeFreePropertyBlob FakeClientID glamor_init drmModeFreeProperty CreateNewResourceType xf86CrtcScreenInit xf86LoadSubModule drmGetDeviceNameFromFd gbm_bo_destroy xf86_cursors_init DRI2ScreenInit xf86AddEntityToScreen drmModeMoveCursor xf86CrtcConfigInit xf86DPMSInit xf86CrtcSetScreenSubpixelOrder xf86SetSilkenMouse glamor_supports_pixmap_import_export xf86InitialConfiguration xf86GetEntityPrivate xf86OutputSetEDID fbPictureInit miGetDefaultVisualMask xf86CrtcRotate NameForAtom xf86AllocateScreen xf86FindOptionValue gbm_bo_get_handle RemoveGeneralSocket drmModeSetCursor dixRegisterScreenSpecificPrivateKey drmModeGetPropertyBlob xf86SetPrimInitDone xf86ValidateModesSize AddResource xf86OutputDestroy xf86ScreenToScrn xf86AddGeneralHandler miCreateDefColormap drmModeDirtyFB miDCInitialize XNFcalloc DRI2BlockClient gbm_bo_get_stride xf86ShowUnusedOptions xf86SetDepthBpp miSetVisualTypes xf86CollectOptions MakeAtom FatalError xf86ModeHeight xf86DrvMsg shadowUpdatePacked drmModeGetProperty drmModeAddFB xf86ModeVRefresh xf86PrintChipsets glamor_egl_init drmModeFreeResources xf86SetModeCrtc xf86_hide_cursors DamageDestroy xf86ConfigFbEntity miSetPixmapDepths drmSetMaster drmModeFreeConnector xf86OutputCreate shadowAdd DRI2WaitMSCComplete RRConfigureOutputProperty XNFalloc xf86GetPointerScreenFuncs DRI2CloseScreen xf86ReturnOptValBool xf86LoaderCheckSymbol DamageEmpty drmClose xf86HandleColormaps AddGeneralSocket xf86SetWeight drmHandleEvent drmGetCap miClearVisualTypes drmModeSetCursor2 drmModeConnectorSetProperty RRGetInfo xf86InterpretEDID pixman_region_copy drmModeCrtcSetGamma xf86DrvMsgVerb glamor_block_handler present_event_notify DamageRegister drmPrimeFDToHandle drmOpen xf86ProviderSetup RemoveBlockAndWakeupHandlers DamageUnregister drmModeGetCrtc xf86IsPrimInitDone xf86AddDriver xf86ProcessOptions xf86ConfigPciEntity xf86GetOptValString drmIoctl gbm_bo_create drmModeGetEncoder xf86SetBackingStore xf86CrtcSetSizeRange ErrorF DamageCreate

Warning: undefined symbols in /usr/lib64/xorg/modules/libglamoregl.so: serverClient lastGLContext screenInfo serverGeneration RegionEmptyData PictureScreenPrivateKeyRec PixmapWidthPaddingInfo RegionEmptyBox miChangeGC miCopyGC miChangeClip miDestroyClip miCopyClip miPolyRectangle miPolyArc miFillPolygon miPolyFillArc miImageGlyphBlt RegionAppend AllocateFontPrivateIndex miDoCopy miPolyGlyphBlt miImageGlyphBlt RegionDestroy fbComposite LogMessageVerb fbGetImage pixman_rasterize_trapezoid ValidatePicture xf86Msg fbGetSpans miPolyPoint fbAddTraps miSyncShmScreenInit ValidateGC miImageText8 fbDestroyPixmap miPolyText16 fbCopy1toN miSyncGetScreenFuncs dixRegisterPrivateKey fbGetScreenPrivateKey XNFasprintf RegionCreate miCompositeRects GetScratchGC FreeScratchGC fbValidateGC pixman_region_rectangles pixman_region_contains_rectangle CreatePicture miCreatePicture miImageText16 miDestroyPicture pixman_image_unref ChangeGC pixman_region_init_rects fb24_32ReformatTile pixman_region_extents miPushPixels fbCopyNtoN xf86AllocateScrnInfoPrivateIndex PictureMatchFormat fbCreatePixmap fbCreateGC pixman_region_union fbTriangles pixman_region_init_with_extents miHandleExposures fbPolySegment xf86ScreenToScrn pixman_region_contains_point fbSetSpans RegionValidate miPolyText8 MakeAtom FatalError xf86DrvMsg DamageDestroy dri3_screen_init fbPadPixmap pixman_region_intersect _FontSetNewPrivate pixman_image_create_bits XNFalloc pixman_f_transform_point DamageDamageRegion DamageRegionAppend miComputeCompositeRegion fbPolyFillRect LogMessage CompositePicture pixman_transform_is_int_translate pixman_f_transform_from_pixman_transform miRenderColorToPixel XNFstrdup pixman_region_copy pixman_image_get_data DamageRegionProcessPending pixman_image_composite DamageRegister FreePicture miCopyRegion CreateSolidPicture fbCopyNto1 pixman_region_subtract pixman_region_translate XNFvasprintf DamageUnregister pixman_region_init miPolySegment miPolylines fbFillSpans dixGetGlyphs pixman_region_fini fbPixmapToRegion fbPutImage miTrapezoidBounds miDestroyGC ErrorF DamageCreate

Warning: undefined symbols in /usr/lib64/xorg/modules/libshadow.so: RegisterBlockAndWakeupHandlers dixRegisterPrivateKey fbGetScreenPrivateKey DamageRegion DamageDestroy DamageEmpty DamageRegister RemoveBlockAndWakeupHandlers DamageUnregister DamageSetup DamageCreate
*********************

Inspecting the binaries after the build shows that the symbols causing the load failure are provided by $(srcdir)/fb/libfb.{a|la}, so it sounds like the building process is actually underlinking both libglamoregl.so and libshadow.so...

BTW the same inspection work shows that:
1) libshadow.so also needs references from $(srcdir)/miext/damage/libdamage.{a|la} and $(srcdir)/dix/libdix.{a|la} to avoid to have undefined symbols.
2) libglamoregl.so also needs references from $(srcdir)/render/librender.{a|la},
$(srcdir)/miext/damage/libdamage.{a|la}, $(srcdir)/dix/libdix.{a|la}, $(srcdir)/os/libos.{a|la}, $(srcdir)/dri3/libdri3.{a|la}, $(srcdir)/hw/xfree86/common/libcommon.{a|la} and some more...

I first tried to manually add the needed reference to libfb to the Makefiles for libglamoregl and libshadow (see patch below) but given my little knowledge about autotools and about the xserver sources tree I don't think is correct: indeed using it removed the undefined warnings for fbXXXX symbols but added many more warnings than befoire for miXXXX ones...

What is wrong here? Our build system or there is really some problem in the sources re: linking xorg modules?
Comment 1 Giovanni Mariani 2015-11-25 16:32:25 UTC
Created attachment 120117 [details]
Log file of failed libglamoregl.so load with the old HD5750 card
Comment 2 Giovanni Mariani 2015-11-25 16:37:51 UTC
Created attachment 120118 [details] [review]
Try to fix undefined symbols from libfb.so in liglamoregl.so

Actually it does kill all the fbXXXX undefined symbol warnings, but it also causes many more miXXXX undfined symbol warnings than before.
Comment 3 Giovanni Mariani 2015-11-25 16:50:48 UTC
Created attachment 120121 [details] [review]
Try to fix undefined symbols from libfb.so in ligshadow.so
Comment 4 Michel Dänzer 2015-11-26 02:17:23 UTC
Created attachment 120125 [details] [review]
radeon: Load fb earlier

(In reply to Giovanni Mariani from comment #0)
> What is wrong here? Our build system or there is really some problem in the
> sources re: linking xorg modules?

There does seem to be something unusual about your build system or dynamic linker: Normally, unresolved symbols are only an issue when the code referencing them actually tries calling a corresponding function. The radeon driver loads the fb module before that happens. This radeon driver patch should avoid the problem by loading the fb module before the glamoregl/shadow modules.

Explicitly linking modules against other modules they reference symbols from may also be a good idea though, feel free to submit patches to that effect to the xorg-devel@lists.x.org mailing list for review.
Comment 5 Giovanni Mariani 2015-12-02 15:10:02 UTC
(In reply to Michel Dänzer from comment #4)
> Created attachment 120125 [details] [review] [review]
> radeon: Load fb earlier
> There does seem to be something unusual about your build system or dynamic
> linker: Normally, unresolved symbols are only an issue when the code
> referencing them actually tries calling a corresponding function. The radeon
> driver loads the fb module before that happens. This radeon driver patch
> should avoid the problem by loading the fb module before the
> glamoregl/shadow modules.

Sorry for the delay:
before trying you patch, I first built and installed xserver 1.18.0 and "vanilla" xf86-video-ati 7.6.1 to confirm that the problem was still in place (it did).

With your patch applied: problem solved... 
at least with the old HD5750 and glamor acceleration: as soon as I will have time I will try also with the new R270X (but given that the undefined symbol was the same with both video cards, I'm confident that your solution will work also with the newer one).

Thanks.
Comment 6 Giovanni Mariani 2015-12-12 18:03:52 UTC
Tested also with the newer video card: problem solved.
Marking closed.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.