Definitely nobody should use mkstemp anyway, but it's worth noting why the
segfault happens, because it's tricky: the code calls basename but forgets
to include the right header file -- this being C, the compiler just assumes
its return type is int. However int is on x64 a 32 bit integer, so the
pointer gets trashed (with a cltq instruction that gcc inserts to "extend"
int's sign bit).

These implicit definitions are probably the main issue with 64-bit right
now (guessing). They can be caught by -Wall though. My next email will
include a patch for some of these fixes, enough to get into a (severely
broken) CDE instance.

On Tue, Aug 7, 2012 at 6:58 PM, Jon Trulson <j...@radscan.com> wrote:

> On Tue, 7 Aug 2012, Aaron W. Hsu wrote:
>
> >> From 1cad37216d4046f8d345dd34f6c40906b169577a Mon Sep 17 00:00:00 2001
> > From: "Aaron W. Hsu" <arcf...@sacrideo.us>
> > Date: Mon, 6 Aug 2012 18:01:19 -0400
> > Subject: [PATCH 1/2] Use mkstemp() instead of tmpnam() to avoid bad
> > interactions
> >
>
> Applied (though I had to remove some extraneous whitespace - blank
> lines that started with spaces).  'git diff' will usually show these
> before commit.
>
> Thanks!
>
> [...]
>
> --
> Jon Trulson
>
> "If the Martian rope-a-dope don't get him, he'll get himself, he'll
>   come in too fast and punch himself out."
>               - one of my brothers, referring to the Curiosity landing.
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> cdesktopenv-devel mailing list
> cdesktopenv-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to