On Saturday, 7 October 2006 22:16, Stefan Seyfried wrote:
> On Sat, Oct 07, 2006 at 08:16:56PM +0200, Rafael J. Wysocki wrote:
>
> > > usually it segfaults somewhere around here. Or more exactly, since i
> > > tried reordering the stuff, it segfaults in the first glibc function
> > > used. Not always, but every second or third suspend.
> >
> > Hm, actually I'd prefer if it segfaulted every time. ;-)
>
> It only segfaults when the machine is low on memory.
> I tried it on a 256mb tecra8200:
> t8200:~ # /home/tux/cvs/suspend-orig/s2ram
> Switching from vt7 to vt1
> frozen: 1
> calling suspend_to_ram ioctl
> Segmentation fault
> t8200:~ # free
> total used free shared buffers cached
> Mem: 255600 250088 5512 0 51264 77540
> -/+ buffers/cache: 121284 134316
> Swap: 771080 130404 640676
> t8200:~ #
>
> once i stop some of the more memory-consuming tasks (beagled, some of the
> KDE stuff), it works.
> It does not matter if i use the old vt.c code (that's what i used above) or
> the new console.c.
>
> And now the "good" news: i found a "workaround":
>
> int s2ram_do(int frozen, int snapshot_fd)
> {
> int ret = 0;
> if (frozen) {
> printf("calling suspend_to_ram ioctl\n");
> ret = suspend_to_ram(snapshot_fd);
> printf("after suspend_to_ram ioctl\n");
> goto out;
> }
>
> ------
> the additional printf() after the suspend_to_ram() seems to "fix" it. At
> least it did not crash on me for ~30 suspend cycles now.
> However, i'd rather like to understand what the real problem is instead
> of engaging in such cargo cult programming ;-)
It evidently adds some tiny delay here ...
> > Anyway, have you tried to replace suspend_to_ram(snapshot_fd) in s2ram_do
> > with a noop and see what happens?
>
> Then it does not segfault.
Hm, I'm still wondering if s2both has the same problem ...
--
You never change things by fighting the existing reality.
R. Buckminster Fuller
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Suspend-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/suspend-devel