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

Name mangling mistakes with -g #1344

Closed
brson opened this issue Dec 20, 2011 · 2 comments
Closed

Name mangling mistakes with -g #1344

brson opened this issue Dec 20, 2011 · 2 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Dec 20, 2011

This is a backtrace from compiletest built with -g

#11 0x00007ffff7aee3ff in context::call_shim_on_c_stack (this=0x43d700, args=0x445e80, fn_ptr=0x7ffff7af2f48) at
 ../src/rt/arch/x86_64/context.h:58
#12 0x00007ffff7af4066 in call_upcall_on_c_stack (args=0x445e80, fn_ptr=0x7ffff7af2f48) at ../src/rt/rust_upcall
.cpp:37
#13 0x00007ffff7af3144 in upcall_shared_malloc (nbytes=52, td=0x0) at ../src/rt/rust_upcall.cpp:200
#14 0x000000000042be44 in glue_take::S::_7fffa7de31d4d8d4 ()
#15 0x000000000042ebf6 in _ZN9glue_take32R_5B_compile_lib_path_3D_Srun_lib_path17_78527795f021202cE ()
#16 0x0000000000426d8e in run_tests::_37dd24d3b9435856 ()
#17 0x000000000042fe28 in __morestack ()
#18 0x000000000041c0d0 in main::_c5e23313747479c7 ()
#19 0x000000000041c162 in _rust_main ()
#20 0x00007ffff7aec619 in task_start_wrapper (a=0x44272c) at ../src/rt/rust_task.cpp:282
#21 0x0000000000000000 in ?? ()

gdb doesn't understand one of the names.

@graydon
Copy link
Contributor

graydon commented Dec 20, 2011

Guess is this is because we're sanitizing after mangling. Mangling encodes name-component lengths, and sanitizing goes through and converts various objectionable single-characters to multi-character sequences (eg. @ becomes boxed).

Should sanitize before-or-during mangling.

@ghost ghost assigned graydon Mar 3, 2012
@graydon
Copy link
Contributor

graydon commented Mar 20, 2012

I have a patchlet that fixes half of this -- the half of doing mangling and sanitizing in the wrong order. But there's another worse half that will be more work: any time we generate a symbol with the same name as another, LLVM silently renames it and appends a numeric suffix. This breaks mangling. We have to ... very carefully go through trans and ensure we never make duplicate names.

I think that's worth splitting into a sub-bug and deferring. The major piece I'll land on this bug shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

2 participants