Skip to content

potential registration issue when using _ prefix? #733

@kevinushey

Description

@kevinushey

From @krlmlr:

I'm getting bogus errors that seem to relate to the new registration code. I can't replicate them locally yet, but on Travis CI I'm getting test failures iff I use the all-new registration code (with the underscore prefix). I'd like to suggest to hold the release until we get a better understanding of the problem.

It's complicated because the failures occur in the DBItest repo which (effectively) installs the RSQLite repo from source. They don't occur inside the RSQLite repo. See [1] for a failing and [2] for a successful build of the same repo, the only difference is that the second build happened with the old Rcpp registration code [3]. In the failing build, the exported symbol declared last (_RSQLite_init_logging) cannot be loaded from the .so file. Does this ring a bell?

-Kirill

[1] https://travis-ci.org/rstats-db/DBItest/builds/251777532#L3897

[2] https://travis-ci.org/rstats-db/DBItest/builds/251929259

[3] r-dbi/RSQLite@66070b4e

The relevant bit of the error logs, from what I can see:

Error in dyn.load(dllfile) : 
  unable to load shared object '/home/travis/build/rstats-db/DBItest/revdep-dev/RSQLite/src/RSQLite.so':
  /home/travis/build/rstats-db/DBItest/revdep-dev/RSQLite/src/RSQLite.so: undefined symbol: _RSQLite_init_logging
Calls: <Anonymous> -> load_dll -> library.dynam2 -> dyn.load

The only thing I can divine is that, normally, C-style name mangling will prepend an underscore to the symbol name, so we might expect the symbol to actually be called __RSQLite_init_logging. Indeed that's what I see on a local installation:

$ nm RSQLite.so  | grep RSQLite
000000000003f360 T _R_init_RSQLite
000000000003e7d0 T __RSQLite_rsqliteVersion
000000000003c0a0 T __RSQLite_rsqlite_bind_rows
000000000003acb0 T __RSQLite_rsqlite_clear_result
000000000003db00 T __RSQLite_rsqlite_column_info
00000000000363b0 T __RSQLite_rsqlite_connect
0000000000039700 T __RSQLite_rsqlite_connection_valid
0000000000039080 T __RSQLite_rsqlite_copy_database
0000000000038a30 T __RSQLite_rsqlite_disconnect
000000000003b300 T __RSQLite_rsqlite_fetch
000000000003ba20 T __RSQLite_rsqlite_get_placeholder_names
000000000003c750 T __RSQLite_rsqlite_has_completed
0000000000039d90 T __RSQLite_rsqlite_import_file
000000000003eda0 T __RSQLite_rsqlite_init_logging
000000000003e150 T __RSQLite_rsqlite_result_valid
000000000003cdd0 T __RSQLite_rsqlite_row_count
000000000003d480 T __RSQLite_rsqlite_rows_affected
000000000003a5d0 T __RSQLite_rsqlite_send_query

so it's possible this is something specific to the Travis environment in which @krlmlr was testing. (Note that the package builds, installs, and loads fine for me locally)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions