Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sentry.lib missing debugging info, adds warnings to builds #527

Open
riot-pmaconi opened this issue Mar 28, 2024 · 6 comments
Open

sentry.lib missing debugging info, adds warnings to builds #527

riot-pmaconi opened this issue Mar 28, 2024 · 6 comments

Comments

@riot-pmaconi
Copy link

riot-pmaconi commented Mar 28, 2024

Environment

How do you use Sentry?
Sentry SaaS

Which version of the SDK?
0.15.1

How did you install the package? (Git-URL, Assetstore)
git

Which version of Unreal?
5.3

Is this happening in Unreal (editor) or on a player like Android, iOS, Windows?
This is happening during build instead of at runtime

Steps to Reproduce

  1. Integrate the sentry plugin
  2. Build the Unreal project from source

Expected Result

Sentry does not introduce new warnings into the build

Actual Result

A significant number of linking warnings are generated

Any logs or screenshots

12>sentry.lib(sentry_alloc.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_value.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_uuid.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_envelope.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_transport.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_options.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_core.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_session.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_unwinder.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(mpack.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_json.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_slice.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_string.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_utils.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_random.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_logger.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_path_windows.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_path.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_ratelimiter.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_backend.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_backend_crashpad.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_database.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_transport_winhttp.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_modulefinder_windows.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_tracing.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_scope.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_unwinder_dbghelp.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_disk_transport.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_sync.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_os.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_symbolizer_windows.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info
12>sentry.lib(sentry_windows_dbghelp.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Mar 28, 2024
@tustanivsky
Copy link
Collaborator

I assume the above warnings could be related to how we build sentry-native library which is included in the plugin yet this issue requires some additional investigation to tell for sure.

@riot-pmaconi
Copy link
Author

@tustanivsky I believe this is new for us in 0.15.1 and we were previously on 0.13 in case that helps!

@bitsandfoxes
Copy link
Contributor

Hey @riot-pmaconi, when is this happening for you or how are you running into this? Are you using a source-built version of the engine?

@riot-pmaconi
Copy link
Author

Hi @bitsandfoxes - this shows up in our build logs when compiling the engine from source.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Apr 22, 2024
@bitsandfoxes
Copy link
Contributor

@Swatinem, @supervacuus could you help us out here: Is there something missing from the way we build sentry-native here that would cause warnings like 12>sentry.lib(sentry_alloc.obj): Warning LNK4204 : '' is missing debugging information for referencing module; linking object as if no debug info

@supervacuus
Copy link

supervacuus commented Apr 23, 2024

There can be many reasons why this warning appears. Off the top of my head, the most apparent aspects:

The logs show that the quotes are empty. They should contain a path to a PDB. This could mean that the PDB is missing from the package you distribute or the translation unit has no PDB associated with it.

The latter seems plausible since you set SENTRY_BUILD_SHARED_LIBS in the build script you referenced to OFF. This means you are building a static library, and a PDB doesn't make sense in that context because it is the product of the linker, which is not involved in producing a static library only later when the library is linked in either an executable or dynamic library.

Nonetheless, it is possible to include debug information in a static library (which will increase in size), which the linker will later use to generate the PDB.

You can create a static_debug_info.cmake (name is irrelevant) that contains the following lines:

set(CMAKE_C_FLAGS_RELWITHDEBINFO "/Z7 /O2 /Ob1 /DNDEBUG" CACHE STRING "C Flags for RelWithDebInfo" FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Z7 /O2 /Ob1 /DNDEBUG" CACHE STRING "CXX Flags for RelWithDebInfo" FORCE)

Then apply it during the CMake configuration phase like this:

cmake -B "build" 
-DSENTRY_BACKEND=crashpad 
-DSENTRY_SDK_NAME=sentry.native.unreal 
-DSENTRY_BUILD_SHARED_LIBS=OFF 
-C static_debug_info.cmake

Can you reproduce the warnings locally to test against this change @tustanivsky and @bitsandfoxes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

4 participants