[Bug 200617] exec silently fails if text_size > maxtsiz

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Jun 3 16:22:51 UTC 2015


            Bug ID: 200617
           Summary: exec silently fails if text_size > maxtsiz
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: emaste at freebsd.org

I tried to run a debug build of Chrome:

feynman% ./chrome
zsh: abort      ./chrome

There's no log message on the console or in /var/log/messages.

LLDB is no help:

feynman% lldb ./chrome
Current executable set to './chrome' (x86_64).
(lldb) run
Process 25332 launching
failed to fetch ps_strings: No such process
Process 25332 stopped
(lldb) error: initial process state wasn't stopped: exited

GDB is no help:

feynman% gdb79 ./chrome 
GNU gdb (GDB) 7.9 [GDB v7.9 for FreeBSD]
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd10.1".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./chrome...(no debugging symbols found)...done.
(gdb) run
Starting program: /tank/emaste/src/ports/www/chromium/chrome 
During startup program terminated with signal SIGABRT, Aborted.

If one knows what to look for dtrace is helpful:

dtrace: description 'fbt:kernel:exec_elf64_imgact:return ' matched 1 probe
CPU     ID                    FUNCTION:NAME
  4  13890         exec_elf64_imgact:return error=12

That's ENOMEM. From imgact_elf.c:

        if (data_size > lim_cur(imgp->proc, RLIMIT_DATA) ||
            text_size > maxtsiz ||
            total_size > lim_cur(imgp->proc, RLIMIT_VMEM) ||
            racct_set(imgp->proc, RACCT_DATA, data_size) != 0 ||
            racct_set(imgp->proc, RACCT_VMEM, total_size) != 0) {
                return (ENOMEM);

This case should produce some sort of user-facing log message (likely from
kern_execve, not imgact_elf).

         *      Loop through the list of image activators, calling each one.   
         *      An activator returns -1 if there is no match, 0 on success,    
         *      and an error otherwise.
        for (i = 0; error == -1 && execsw[i]; ++i) {
                if (execsw[i]->ex_imgact == NULL ||
                    execsw[i]->ex_imgact == img_first) {
                error = (*execsw[i]->ex_imgact)(imgp);

        if (error) {
                if (error == -1) {
                        if (textset == 0)
                        error = ENOEXEC;
                goto exec_fail_dealloc;

You are receiving this mail because:
You are the assignee for the bug.

More information about the freebsd-bugs mailing list