On Sun, May 22, 2016 at 5:39 PM, Vegard Nossum <vegard.nos...@gmail.com> wrote:
> On 21 May 2016 at 20:18, Thomas Meyer <tho...@m3y3r.de> wrote:
>> Am 21.05.2016 um 15:51 schrieb Vegard Nossum <vegard.nos...@gmail.com>:
>>> I'm having some trouble with using current_thread_info() during UML
>>> early boot. Sometimes it works just fine, but often I get segfaults
>>> because current_thread_info() is returning an invalid pointer. It
>>> looks random: 0x202118, 0x1003e0003, 0xd33b90b3, 0x6db043, etc.
>>
>> Mhh. Strange. Do you have a stack trace to call to current thread info which 
>> ends up with a wrong value. I wonder from were it originates.
>
> One such trace would be:
>
> #2  0x000000006026652c in snprintf (buf=<optimized out>,
> size=<optimized out>, fmt=<optimized out>) at lib/vsprintf.c:2181
> #3  0x00000000600046f8 in setup_env_path () at arch/um/os-Linux/main.c:109
> #4  main (argc=3, argv=0x7ffc3d8c23e8, envp=<optimized out>) at
> arch/um/os-Linux/main.c:125
>
> 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.

-- 
Thanks,
//richard

------------------------------------------------------------------------------
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

Reply via email to