[haiku-development] Re: weird segfault in malloc internals when trying to call fdopen()

  • From: Alexander Botero-Lowry <alex.boterolowry@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 17 Oct 2009 23:23:28 -0700

I didn't see Francois (sorry about the lacking cedilla, but I don't want
to dig around in the emacs unicode map ;) email for some reason, so I will
reply to both at once.

> FWIW I got emacs to compile and run (in terminal mode).  I disabled
> dumping because I didn't know enough about haiku to make it work.
> 
I'm actually having issues getting it to run in terminal mode. I'm
getting an infinite select loop on keyboard input when I run temacs (the
undumped emacs). Otherwise it kind of vaguely works. I was actually going
to cheat and start working on the GUI mode, though I know nothing about how
to do that or really BeAPI.. :) I like shooting blind I guess.

> If you're interested I can send you my s/haiku.h - basically I kept
> turning stuff off/mucking about till I got it to work, but it was
> mostly random with no prior knowledge so it is unlikely to be
> particularly well done.
> 
Yes, I'd love to see your work. I am going to work to get these changes
into upstream gnu emacs as soon as I get something that resembles working
order. I was actually about to write an email to emacs-devel@ about it.

I think a GUI mode is extremely important, indeed I don't find emacs that
enjoyable without it. This is compounded by the fact that the Terminal app
is kind of buggy. For example, it handles scrolling in emacs over ssh pretty
poorly.  One thing I am interested in looking at is porting FreeBSD's
libteken to Haiku and rewriting Terminal to use it for the handling of xterm
instructions. libteken is, for those that don't know, an implementation of the
xterm control characters as a library that will be used for the FreeBSD console
in 8. It handles all the nuances of the drawing logic, so that all the terminal
code has to do is draw it to the termview.

> 2009/10/17 Fran=E7ois Revol <revol@xxxxxxx>:
> >> #define SYSTEM_MALLOC
> >>
> >> \o/ \o/ \o/
> >
> > Great.
> >
> > I probably had to force something alike in XEmacs as well though I
> > don't recall it.
> >
I didn't see anything like that in your patches. I have xemacs-dump-test.zip
of yours from somewhere. It was defintly indespensible in my doing this. My
first approximation at PENDING_FILE was actually wrong for example.

> >> trying to unexec the bootstrapped temacs also fails with:
> >>
> >> emacs: .bss shrank when undumping???
> >
> > Maybe some missing sections.
> >
> > Doesn't Emacs have a portable dumper like XEmacs ?
> >
> > IIRC you must force it somewhere.
> >
It looks to me like they're all custom for the binary format. a.out, elf,
solaris, coff, and Mach-O all seem to have their own dumpers.

> > I'll track the last one I made and upload it.
>
That'd be great.

> >> which is probably just some nuance of Haiku's ELF implementation I
> >> need to try and account for. I'll get to that once I figure out
> >> what's
> >> up with the terminal.
> >
> > I really didn't even try to do it, I didn't want to learn about ELF at
> > the time ;)
>
I've been poking a bit, but really don't know anything about ELF, so I'm
basically just looking around for interesting defines, etc. :)

Thanks,
Alex

Other related posts: