Samba 2.2.8 not starting

John Santos john.santos at
Mon May 12 21:49:07 GMT 2003

At 03:00 PM 5/12/2003 +0200, COLLOT Jean-Yves wrote:
>About the " Error: can't write to file /samba_root/var/locks/ bad
>file number" issue when NMBD starts, I really don't know what happens. I
>have the feeling that this specific problem appears only on the VAX version
>of VMS/Samba (both messages are on VAX) , but I am not sure.
>The most amazing thing, in my opinion, is that the problem disappears when
>the "-i" option is selected for nmbd, because as far as I know, there is
>very little differences when this option is selected for that program.
>Anyway, I have just one VAX platform (VMS 7.1, TCPIP 5.0A ECO1) and I can't
>reproduce that problem on it, so I have no idea how I could fix that.
>If anyone can try to reproduce the problem and get more information (may be
>by increasing the debug level of nmbd) it could be a great help.

I'm getting the same behavior with VAX VMS V7.3, TCPWARE V5.6, DEC C 6.4-005.

It looks like something must be stomping memory in PIDFILE.C, in 
between when it opens the file and when it does the write.  (There is just 
a memset
and an slprintf between them.)  I added a whole bunch of DEBUG statements,
broke apart compound statements (using temp variables to hold intermediate
results), etc. until I finally got it to work by inserting:

     DEBUG(0,("TRACE: open fd = %d\n", fd));

immediately after the open.  Then I took out all my changes except this and it
breaks again :-(

My guess is by adding temp variables and shuffling code slightly, I made
it stomp on some other part of the stack or something.  I guess the next
step is to compile/link /debug, and see what is changing on the stack
between the open and the write.  Of course, if it is a C optimizer bug,
the problem could go away when compiled/debug/nooptimize.  I'm
certainly not ready to say that it is a C bug yet, though.

[I am using this as an exercise to hone my fairly minimal C skills.  As best
I can tell, the memset and slprintf look fine.]

I was also digging down to see just what DEBUG actually does, but haven't got
there yet.  The people who know this stuff probably know without even 
looking if
DEBUG does anything different in interactive mode?  (I ask because
others have reported "-i" makes it work...)

John Santos

More information about the samba-vms mailing list