#5278: On modern fedora 64 installs, sage exists frequently when omalloc thinks
there is no memory left
---------------------+------------------------------------------------------
 Reporter:  was      |        Owner:  cwitty  
     Type:  defect   |       Status:  new     
 Priority:  blocker  |    Milestone:  sage-3.3
Component:  misc     |   Resolution:          
 Keywords:           |  
---------------------+------------------------------------------------------
Comment (by GeorgSWeber):

 Hi all,

 I currently do not have access to Fedora or any Linux system at the
 moment, let alone a 64-bit system. But I do have seen some odd queer
 things in my past "low level C years" on embedded systems with all sort of
 crap architectures and compilers.

 My proposals here would be to poke around along the lines of:

 - Is "NULL" really what you think here?

 - Do we compare against what we want to compare against?

 Given a box, I would test certain code alternatives to "if (ptr == NULL)"
 as:
 {{{
 if (ptr == (void *)NULL)
 }}}
 {{{
 if (ptr == (void *)0x0)
 }}}
 {{{
 if ((void* )ptr == (void*)0x0)
 }}}

 I have seen environments where exactly one version was the one to be
 taken. And sometimes one has to read the assembler code to see what a
 compiler can wreak havoc to 100% correct ANSI C code ... but I have never
 read the GNU assembler language docs.

 As far as "hackish" concerns, I think I can do worse than the above code:
 {{{
 do {;} while(NULL == (ptr = OM_MALLOC_FROM_SYSTEM(size)));
 }}}

 But seriously, from what I see perhaps all we need is to start some sort
 of timer in the "OM_MEMORY_LOW_HOOK();" to let the system recover from a
 situation where it couldn't give us the needed free memory on our first
 request. Or some other system-related magic that ensures that --- provided
 the memory is avaible at all :-) --- makes sure that the following call
 will be successful.
 This C code does not seem to me so very hackish, after all, but even
 nicely customizable by the obvious hooks and macros.

 Yeah, probably it's a good idea to check what the OM_MEMORY_LOW_HOOK()
 macro does do right now.

 Cheers,gsw

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5278#comment:4>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to