[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: SNDCTL_TMR_TIMEBASE or TCGETS



On Wed, Jun 18, 2008 at 09:49:16AM -0500, Stephen Olander-Waters wrote:
> On Wed, 2008-06-18 at 10:37 -0400, Lennart Sorensen wrote:
> > On Tue, Jun 17, 2008 at 09:30:49PM +0200, Gudjon I. Gudjonsson wrote:
> > > Hi
> > >    I am fighting to get some code written 13 years ago in several
> > > languages to run decently on my amd64. Making it run in 64 bit mode is
> > > a far future dream but I'm hoping to fix a chroot. Currently I get most
> > > success with an etch chroot.
> > >    The program compiles and runs in 64 bit mode but without any sensible
> > > output but when I run it in the chroot, I get the following output to
> > > strace several times and then a segmentation fault.
> > > 
> > > ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, 0xffdb6f38) = -1 ENOTTY
> > > (Inappropriate ioctl for device)
> > > 
> > > Since it runs in 64 bit mode I guess it has something to do with the chroot.
> > > Has anyone seen anything similar?
> > 
> > Make sure /dev is bind mounted in your chroot, as well as proc and such.
> 
> Is this some sort of OSS vs ALSA problem? I guess make sure the ALSA OSS
> compatibility module is loaded and make sure the /dev stuff is correct,
> per Lennart.

The error is from an ioctl, which requires access to device nodes.  You
chroot doesn't have any unless you bind mounted /dev to the chroot's
/dev.

The other posibility is that you are trying to use an ioctl that isn't
legal on a 64bit kernel (some ioctl's are not compatible between 32 and
64bit unfortunately although most are).

Of course segfault means bug in the code.  All segfaults mean you failed
to handle a possibly valid situation (like malloc failure or similar),
so it's a bug worth fixing.  Spitting out an error and exiting is much
nicer than simply crashing with no useful information after all.

-- 
Len Sorensen


Reply to: