On 12 June 2016 at 23:05, Richard Weinberger <rich...@nod.at> wrote: > Am 12.06.2016 um 22:59 schrieb Vegard Nossum: >> On 12 June 2016 at 22:11, Richard Weinberger >> <richard.weinber...@gmail.com> wrote: >>>> I wonder why setup_env_path() ends up calling the kernel's snprintf(), >>>> I thought that it would be using the glibc snprintf() at this point? >>> >>> That early you cannot use current() nor any other core kernel stuff >>> since the kernel has not started so far. >>> So, the current thread info struct points to garbage. >> >> Yes, I know. I think setup_env_path() should call the libc snprintf >> rather than the kernel one, can you explain how to do that properly? > > Currently UML sets up nasty maps for known namespaces clashes. > i.e. > KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) -D__arch_um__ \ > $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \ > -Din6addr_loopback=kernel_in6addr_loopback \ > -Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr
I see... nice and hacky ;-) I'll try the same for snprintf and see if that works around my bug. > A much better approach would be having a real linker scope. > Some time ago I posted some thoughts on that: > https://lkml.org/lkml/2015/11/19/758 > > Due to -ENOTIME this never materialized, though. ;-( Cool, objcopy -G/--keep-global-symbol(s) seems like a good solution. Doesn't look like it should be too difficult. I might give it a try. Thanks! Vegard ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel