cygwin build_alias issue (and a possible workaround...)

Bogdan Vacaliuc bvacaliuc at ngit.com
Fri Sep 3 22:15:17 UTC 2004


Hi Scott,

> >Sigh.  I'm tired of this thing.
> 
> Already?  And I was thinking that we were just getting started...

In for a penny, in for a pound; isn't that what they say?  Onward then...


> -----Original Message-----
> From: Scott Newell [mailto:newell at cei.net] 
> Sent: Friday, September 03, 2004 4:39 PM
> To: rtems-users at rtems.com
> Subject: RE: cygwin build_alias issue (and a possible workaround...)
> 
> 
> At 03:05 PM 9/3/2004 , Bogdan Vacaliuc wrote:
> >
> >Lets recap what we know.
> >
> >4) If strace is used on the configure/build, the failure 
> never occurs.
> 
> I was able to strace the failing expr call.  (But not the 
> entire configure/build).

I've found that when using strace, the return value of the expr is always 0,
which is not always right.  In the case of the expr we are tracking, the
correct return value is '1'.

I've noticed some differences between your strace_03.log and one I did
manually on the same expr command, which may have some bearing on why you
are getting the fork() failure below:

-- from newell's strace_03.log --
  194   45718 [main] expr 1840 dll_crt0_1: user_data->main 0x401AE0
  132   45850 [main] expr 1840 wait_for_sigthread: wait_sig_inited 0x314
 1796   47646 [main] expr 1840 fhandler_base::fstat_by_handle: 0 =
GetFileInformationByHandle (d:\Device\Null, 468)
  123   47769 [main] expr 1840 get_file_attribute: file: d:\Device\Null
  265   48034 [main] expr 1840 cygpsid::debug_print: get_sids_info: owner
SID = S-1-5-32-544
  125   48159 [main] expr 1840 cygpsid::debug_print: get_sids_info: group
SID = S-1-5-18
  121   48280 [main] expr 1840 get_info_from_sd: ACL = 1FF, uid 544, gid 18
  215   48495 [main] expr 1840 fhandler_base::fstat_helper: 0 = fstat (,
0x22EE70) st_atime=0 st_size=0, st_mode=0x81FF, st_ino=886905255, sizeof=96
  115   48610 [main] expr 1840 fstat64: 0 = fstat (1, 0x22EE70)
  424   49034 [main] expr 1840 writev: writev (1, 0x22EEA0, 1)
  113   49147 [main] expr 1840 fhandler_base::write: binary write
  119   49266 [main] expr 1840 fhandler_base::write: 2 = write (0x100116E8,
2)
  116   49382 [main] expr 1840 writev: 2 = write (1, 0x22EEA0, 1), errno 0
  111   49493 [main] expr 1840 close: close (1)
   97   49590 [main] expr 1840 fhandler_base::close: closing
'/cygdrive/d/Device/Null' handle 0x1D4
  124   49714 [main] expr 1840 close: 0 = close (1)
  550   50264 [main] expr 1840 do_exit: do_exit (1), exit_state 0
  110   50374 [main] expr 1840 void: 0x0 = signal (20, 0x1)
  109   50483 [main] expr 1840 void: 0x0 = signal (1, 0x1)
  124   50607 [main] expr 1840 void: 0x0 = signal (2, 0x1)
  120   50727 [main] expr 1840 void: 0x0 = signal (3, 0x1)
  153   50880 [main] expr 1840 fhandler_console::close: decremented
open_fhs, now 0
  118   50998 [main] expr 1840 sigproc_terminate: entering
  131   51129 [sig] expr 1840 wait_sig: done
    1   51130 [main] expr 1840 proc_terminate: nchildren 0, nzombies 0
  221   51351 [main] expr 1840 proc_terminate: leaving
    1   51352 [sig] expr 1840 _cygtls::remove: wait 0x0
  479   51831 [main] expr 1840 __to_clock_t: dwHighDateTime 0, dwLowDateTime
312500
  106   51937 [main] expr 1840 __to_clock_t: total 00000000 0000001F
  127   52064 [main] expr 1840 __to_clock_t: dwHighDateTime 0, dwLowDateTime
468750
  134   52198 [main] expr 1840 __to_clock_t: total 00000000 0000002E
  874   53072 [main] expr 1840 _pinfo::exit: Calling ExitProcess 1

-- from bvacaliuc's strace.log --
  138   28216 [main] expr 1088 dll_crt0_1: user_data->main 0x401AE0
   75   28291 [main] expr 1088 wait_for_sigthread: wait_sig_inited 0x320
 1055   29346 [main] expr 1088 fhandler_base::fstat: here
   86   29432 [main] expr 1088 fstat64: 0 = fstat (1, 0x22EE70)
  140   29572 [main] expr 1088 isatty: 1 = isatty (1)
  146   29718 [main] expr 1088 writev: writev (1, 0x22EE70, 1)
   78   29796 [main] expr 1088 fhandler_console::write: 100117A0, 2
   75   29871 [main] expr 1088 fhandler_console::write: at 48(0) state is 0
  208   30079 [main] expr 1088 fhandler_console::write: 2 = write_console
(,..2)
   91   30170 [main] expr 1088 writev: 2 = write (1, 0x22EE70, 1), errno 0
  283   30453 [main] expr 1088 do_exit: do_exit (1), exit_state 0
   77   30530 [main] expr 1088 void: 0x0 = signal (20, 0x1)
   74   30604 [main] expr 1088 void: 0x0 = signal (1, 0x1)
   73   30677 [main] expr 1088 void: 0x0 = signal (2, 0x1)
   74   30751 [main] expr 1088 void: 0x0 = signal (3, 0x1)
   95   30846 [main] expr 1088 fhandler_console::close: decremented
open_fhs, now 2
   95   30941 [main] expr 1088 fhandler_console::close: decremented
open_fhs, now 1
   92   31033 [main] expr 1088 fhandler_console::close: decremented
open_fhs, now 0
   75   31108 [main] expr 1088 sigproc_terminate: entering
   99   31207 [sig] expr 1088 wait_sig: done
   72   31279 [sig] expr 1088 _cygtls::remove: wait 0x0
  179   31458 [main] expr 1088 proc_terminate: nchildren 0, nzombies 0
   81   31539 [main] expr 1088 proc_terminate: leaving
  146   31685 [main] expr 1088 __to_clock_t: dwHighDateTime 0, dwLowDateTime
156250
   74   31759 [main] expr 1088 __to_clock_t: total 00000000 0000000F
   72   31831 [main] expr 1088 __to_clock_t: dwHighDateTime 0, dwLowDateTime
312500
   71   31902 [main] expr 1088 __to_clock_t: total 00000000 0000001F
 1111   33013 [main] expr 1088 _pinfo::exit: Calling ExitProcess 1


> >#!/bin/sh
> >if result=`/usr/bin/expr "$@"` ; then
> >    echo "expr $@ result $result status 0" >> ${HOME}/expr.log
> >    echo $result
> >    exit 0;
> >else
> >    echo "expr $@ result $result status !0" >> ${HOME}/expr.log
> >    echo $result
> >    exit 1;
> >fi
> 
> I tried this script (in /opt/rtems-4.6/bin, which is the 
> first entry in my path).  I observed no log file created in 
> my home directory, and the output of my configure and make 
> commands was not visible in the console window. (I usually

Interesting...

Question: do you get the ~/expr.log if you just type this in on the command
line (with the script in place):

$ expr "xbuild_alias" :
".*[^_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]"

And what is its contents?

> It does not work for me, yet.  Maybe I've mis-applied the 
> script?  Here's the tail end of my configure/make logfile:
> 
> ../rtems-4.6.1/configure --target=m68k-rtems --disable-posix 
> --disable-networking --disable-cxx --enable-rtemsbsp=efi332 
> 2>&1 | tee -a log.txt
>       5 [main] sh 3476 sync_with_child: child 3596(0x68) died 
> before initialization with status code 0x80
>     141 [main] sh 3476 sync_with_child: *** child state 
> waiting for longjmp
> ./configure.lineno: Cannot fork: Resource temporarily 
> unavailable gmake RTEMS_BSP=efi332 2>&1 | tee -a log.txt
> gmake: *** No targets specified and no makefile found.  Stop.

Hmm.  Now that is a resource problem.  Scott, what *are* the values for the
SharedSection= of your "HKLM\SYSTEM\CurrentControlSet\Control\Session
Manager\SubSystems\Windows" key?  Mine are (currently):

SharedSection=1024,3072,128,128

> >Can it be possible that the issue resides in (v)fork(), 
> exec*, spawn() 
> >called from bash?  As Ralf and Chris have suggested that somehow the
> 
> >arguments are not making it to expr correctly?  This is difficult to 
> >know,
> 
> The strace of the failing expr shows:
>   596   26387 [main] expr 3764 build_argv: argv[0] = 'expr'
>   121   26508 [main] expr 3764 build_argv: argv[1] = 'xbuild_alias'
>   101   26609 [main] expr 3764 build_argv: argv[2] = ':'
> and a little later:
>   330   30918 [main] expr 3764 globify: argv[3] =
> '.*[^_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]'
>   193   31111 [main] expr 3764 build_argv: argc 4

Oh, ok, right.  They were making it to expr ok, but expr wasn't doing the
right thing...


Its going to be a long weekend...

Hope its good for everyone.

-bogdan




More information about the users mailing list