Re: [PATCH] libgst: Add built-in for Behavior>>#new and >>#new:

Holger Hans Peter Freyther <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.gnu.general
Message-ID <[email protected]>
On Sat, Aug 02, 2014 at 09:01:36PM +0200, Holger Hans Peter Freyther wrote:
> On Sat, Aug 02, 2014 at 08:42:45PM +0200, Holger Hans Peter Freyther wrote:

Dear Paolo,

> This does break the jit in the processor scheduler.
> 
> Program received signal SIGSEGV, Segmentation fault.
> next_scheduled_process () at interp.c:1972
> 1972	  if (is_process_ready (get_scheduled_process ()))
> (gdb) bt
> #0  next_scheduled_process () at interp.c:1972
> #1  0xb7f69025 in suspend_process (processOOP=0xb3bb2800) at interp.c:1456
> #2  0xb7f69e0f in _gst_terminate_process (processOOP=<optimized out>) at interp.c:1466
> #3  _gst_interpret (processOOP=0xb3c16f28) at interp-jit.inl:405
> #4  0xb7f6b121 in _gst_nvmsg_send (receiver=0xb3bb2800, sendSelector=0xb3c16f00, args=0x0, 
>     sendArgs=0) at interp.c:2318
> #5  0xb7f14952 in _gst_execute_statements (receiverOOP=0xb3bb2800, method=0xb3c16f00, 
>     undeclared=true, quiet=true) at comp.c:586
> #6  0xb7f06140 in execute_doit (p=0xbffff574, temps=0x0, stmts=0x81a883c, 
>     receiverOOP=0xb3bb2800, undeclared=true, quiet=false) at gst-parse.c:592
> #7  0xb7f07234 in parse_eval_definition (p=0xb3bb2800) at gst-parse.c:756
> #8  0xb7f086f7 in parse_scoped_definition (first_stmt=<optimized out>, p=<optimized out>)
>     at gst-parse.c:668
> #9  parse_doit (p=0xbffff574, fail_at_eof=(true | unknown: 3086476424)) at gst-parse.c:624
> #10 0xb7f08d8c in parse_chunks (p=p@entry=0xbffff574) at gst-parse.c:475
> #11 0xb7f091af in _gst_parse_chunks (currentNamespace=0x0) at gst-parse.c:449
> #12 0xb7f0ad92 in _gst_parse_stream (currentNamespace=0x0) at lex.c:1209
> #13 0xb7f35b2e in _gst_process_file (
>     fileName=0xb7f7e01d <standard_files+1053> "ObjMemory.st", dir=GST_DIR_KERNEL)
>     at input.c:855

Okay, before things go wrong Behavior_newInitialize is called while the
processor scheduler is being created.

Created... 
(ip 16)ProcessorScheduler>>#initialize
(ip 52)ObjectMemory class>>#initialize
(ip 6)UndefinedObject>>#executeStatements
(ip 0)<bottom>
Created... 
(ip 22)ProcessorScheduler>>#initialize
(ip 52)ObjectMemory class>>#initialize
(ip 6)UndefinedObject>>#executeStatements
(ip 0)<bottom>
Created... 
(ip 4)Process class>>#on:at:suspend:
(ip 16)BlockClosure>>#forkAt:
(ip 42)ProcessorScheduler>>#initialize
(ip 52)ObjectMemory class>>#initialize
(ip 6)UndefinedObject>>#executeStatements
(ip 0)<bottom>
Created... 
(ip 4)Semaphore class>>#forMutualExclusion
(ip 8)[] in Object class>>#finalSemaphore
(ip 8)[] in BlockClosure>>#valueWithoutPreemption
(ip 6)<unwind> BlockClosure>>#ensure:
(ip 10)BlockClosure>>#valueWithoutPreemption
(ip 14)Process class(Object class)>>#finalSemaphore
(ip 8)Process(Object)>>#addToBeFinalized
(ip 34)Process>>#onBlock:at:suspend:
(ip 12)Process class>>#on:at:suspend:
(ip 16)BlockClosure>>#forkAt:
(ip 42)ProcessorScheduler>>#initialize
(ip 52)ObjectMemory class>>#initialize
(ip 6)UndefinedObject>>#executeStatements
(ip 0)<bottom>
No runnable processNo more native? CallinProcess new "<-0x4c3e8d50>" 0
No more native? nil 0

Program received signal SIGSEGV, Segmentation fault.
next_scheduled_process () at interp.c:1980
1980	  if (is_process_ready (get_scheduled_process ()))



        if (!native_ip)
          {
            OOP activeProcessOOP = get_scheduled_process ();
            printf("No more native? %O %d\n",
                        activeProcessOOP, is_process_terminating(processOOP));
            gst_callin_process process = (gst_callin_process) OOP_TO_OBJ (activeProcessOOP);
            process->returnedValue = POP_OOP ();
            _gst_terminate_process (activeProcessOOP);
          }


So it appears that get_scheduled_process is NIL as the callin
process we execute is not known. I just don't understand how this
is different to the code that executes basicNew/initialize from
Smalltalk..

So is the issue with native_ip being 0 here or that we are using
the get_scheduled_process.

holger
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.