Ticket #375 (closed bug: wontfix)

Opened 13 years ago

Last modified 12 years ago

FREEZE_ASCII doesn't work

Reported by: cotto Owned by: rurban
Priority: minor Milestone: 2.6
Component: none Version:
Severity: low Keywords: 64bit
Cc: Language:
Patch status: Platform:

Description

In src/pmc_freeze.c, there's a friendly-looking macro called "FREEZE_ASCII". Presumably the intent was that when FREEZE_ASCII was defined as 1, PMCs would be frozen into a nice ascii format. The code changed by the macro looks simple enough (using a different set of function pointers), but setting FREEZE_ASCII to 1 breaks the build.

Someone should investigate how hard it would be to fix this and whether it's worthwhile.

Attachments

const-freeze.patch Download (4.7 KB) - added by rurban 13 years ago.
at first freeze could use some consting

Change History

Changed 13 years ago by rurban

  • status changed from new to assigned
  • owner set to rurban
  • milestone set to 2.6
  • severity changed from medium to low
  • priority changed from normal to minor
./parrot.exe -o runtime/parrot/include/parrotlib.pbc runtime/parrot/library/parrotlib.pir
src/io/api.c:231: failed assertion 'pmc'
$ gdb --args ./parrot -o xx.pbc runtime/parrot/library/parrotlib.pir
GNU gdb 6.8.0.20080328-cvs (cygwin-special)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) b src/io/api.c:231
No source file named src/io/api.c.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (src/io/api.c:231) pending.
(gdb) run
Starting program: /usr/src/perl/parrot/parrot-svn/parrot.exe -o xx.pbc runtime/parrot/library/parrotlib.pir
[New thread 4176.0x1188]
[New thread 4176.0x10e0]

Breakpoint 1, Parrot_io_flush (interp=0x1ef25a0, pmc=0x0) at src/io/api.c:231
231         ASSERT_ARGS(Parrot_io_flush)
(gdb) bt
#0  Parrot_io_flush (interp=0x1ef25a0, pmc=0x0) at src/io/api.c:231
#1  0x69ce89a6 in die_from_exception (interp=0x1ef25a0, exception=0x1fabd20) at src/exceptions.c:115
#2  0x69ce8bc6 in Parrot_ex_throw_from_c (interp=0x1ef25a0, exception=0x1fabd20) at src/exceptions.c:308
#3  0x69ce927a in Parrot_ex_throw_from_c_args (interp=0x1ef25a0, ret_addr_unused=0x0, exitcode=1,
    format=0x69fc7cca "Unknown PMC type to thaw %d") at src/exceptions.c:409
#4  0x69d42d63 in thaw_pmc (interp=0x1ef25a0, info=0xc3cad0, id=0xc3c988, type=0xc3c984)
    at src/pmc_freeze.c:1239
#5  0x69d42fde in do_thaw (interp=0x1ef25a0, pmc=0x0, info=0xc3cad0) at src/pmc_freeze.c:1337
#6  0x69d43a78 in visit_todo_list_thaw (interp=0x1ef25a0, old=0x0, info=0xc3cad0) at src/pmc_freeze.c:1659
#7  0x69cf9de2 in hash_thaw (interp=0x1ef25a0, hash=0x1fcd908, info=0xc3cad0) at src/hash.c:586
#8  0x69cf9ef0 in parrot_hash_visit (interp=0x1ef25a0, hash=0x1fcd908, pinfo=0xc3cad0) at src/hash.c:680
#9  0x69ea985a in Parrot_Hash_visit (interp=0x1ef25a0, pmc=0x1fac4b8, info=0xc3cad0)
    at ./src/pmc/hash.pmc:1034
#10 0x69d43d0f in visit_loop_todo_list (interp=0x1ef25a0, current=0x1fac4b8, info=0xc3cad0)
    at src/pmc_freeze.c:1732
#11 0x69d44078 in run_thaw (interp=0x1ef25a0, image=0x1fc1ac8, what=VISIT_THAW_NORMAL)
    at src/pmc_freeze.c:1856
#12 0x69d44369 in Parrot_thaw (interp=0x1ef25a0, image=0x1fc1ac8) at src/pmc_freeze.c:1980
#13 0x69cf8a8b in parrot_set_config_hash_interpreter (interp=0x1ef25a0) at src/global_setup.c:98
#14 0x69cf8bc9 in init_world (interp=0x1ef25a0) at src/global_setup.c:177
#15 0x69cf8cb4 in init_world_once (interp=0x1ef25a0) at src/global_setup.c:130
#16 0x69d025d2 in make_interpreter (parent=0x0, flags=0) at src/inter_create.c:192
#17 0x69ce47e9 in Parrot_new (parent=0x0) at src/embed.c:105
#18 0x004010ab in main (argc=4, argv=0x1ef2390) at src/main.c:52

So it dies in an exception with "Unknown PMC type to thaw 0"

The pmc stream pointer in run_thaw is at a wrong index, at "asjit ..."

(gdb) up
#11 0x69d44078 in run_thaw (interp=0x1ef25a0, image=0x1fc1ac8, what=VISIT_THAW_NORMAL)
    at src/pmc_freeze.c:1856
1856        visit_loop_todo_list(interp, NULL, &info);
(gdb) p *image
$4 = {cache = {_b = {_bufstart = 0x402020, _buflen = 13362}, _ptrs = {_struct_val = 0x402020,
      _pmc_val = 0x3432}, _i = {_int_val = 4202528, _int_val2 = 13362},
    _num_val = 2.8354109835202679e-310, _string_val = 0x402020}, flags = 405760,
  strstart = 0x402781 
  "asjit 0x146  -DHAS_JIT -DI386 cc_inc 0x14a -I./include cc_ldflags 0x14e  cc_o_out 0x152 -o  cc_shared 0x156   ccflags 0x15a -U__STRICT_ANSI__  -pipe -I/usr/local/include -DHASATTRIBUTE_CONST  -DHASATT"..., 
  bufused = 11473, strlen = 13362, hashval = 0, encoding = 0x1f33340, charset = 0x1f334d0}

Changed 13 years ago by rurban

at first freeze could use some consting

Changed 13 years ago by rurban

  • keywords 64bit added

Changed 12 years ago by bacek

  • status changed from assigned to closed
  • resolution set to wontfix

FREEZE_ASCII was ripped-off at r41178

Note: See TracTickets for help on using tickets.