Skip to content

Serialization warnings #44

Closed
Closed

Description

@mbojan

In statnet/ergm#641 we added neat progress bars. On a HPC which has, it seems, very stripped images on computing nodes, I'm getting locale-related warnings. Benign but annoying.

I thought its the progress bars, but apparently not.

Warning: strings not representable in native encoding will be translated to UTF-8
Warning: input string '
<f5><dc>
' cannot be translated to UTF-8, is it valid in 'UTF-8'?
Warning: input string '
<f5><dc>
' cannot be translated to UTF-8, is it valid in 'UTF-8'?
Warning: input string '
<f5><dc>
' cannot be translated to UTF-8, is it valid in 'UTF-8'?
Warning: input string '
<f5><dc>
' cannot be translated to UTF-8, is it valid in 'UTF-8'?
Burning in ======================>--------   74% |  ETA:  1s
Best valid proposal 'BDStratTNT' cannot take into account hint(s) 'triadic'.
Burning in ===============>---------------   49% |  ETA:  1s

Activity

  1. transferred this issue fromstatnet/ergmon Sep 17, 2026
  2. changed the title [-]Progress bars emitting non-portable strings?[/-] [+]Serialization warnings[/+] on Sep 17, 2026
  3. mbojan commented on Sep 17, 2026

    @mbojan
    MemberAuthor

    Claude writes:

    Root cause (verified locally): both warnings come from R's ReadChar() in src/main/serialize.c, i.e. from unserializing a native-encoded, non-ASCII string that was serialized under a different native encoding. The string is the "crude sentinel" literal in statnet.common::match_names():

    # src/statnet.common/R/misc.utilities.R:171-173
    namesmatch <- if(partial) pmatch(names(v), names)
                  else pmatch(paste(names(v), "\n\xf5\xdc\n"), paste(names, "\n\xf5\xdc\n"))
    

    "\n\xf5\xdc\n" is invalid UTF-8 and unmarked (CE_NATIVE). When statnet.common is installed in a UTF-8 locale, the lazy-load DB records native encoding UTF-8; when the function is first lazy-loaded in a C-locale session, R tries to translate the string, fails, and warns — once for "strings not representable…" and once per copy of the literal (source + bytecode constant pool → 3). ergm triggers it on its first match_names() call (R/ergm.R:408/471, R/san.R, R/simulate.R, …), which lands right next to the burn-in bar.

    Reproduction (no ergm needed):

    LC_ALL=C Rscript -e 'options(warn=1); invisible(statnet.common::match_names)'
  4. self-assigned this
    on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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