On Fri, Jan 31, 2014 at 1:35 PM, Kyotaro HORIGUCHI <horiguchi.kyot...@lab.ntt.co.jp> wrote: > Hello, I've managed to reconstruct windows build environment and > tried to run the previous patch. Thanks. > > > I will apologize in advance for probably silly questions but I > have two problems.
I think both the problems are related and the reason is that dsm_demo.dll is not built properly. Let us first try to solve your second problem, because I think if that is solved, you will not face problem-1. > ==== > Server was crashed by dsm_demo_read on my test environment but > unfortunately the cause is still uncertain for me. > > | LOG: server process (PID 19440) was terminated by exception 0xC0000005 > | DETAIL: Failed process was running: select dsm_demo_read(4294967297); > | HINT: See C include file "ntstatus.h" for a description of the hexadecimal > value. > | LOG: terminating any other active server processes > > 0xC0000005 is ACCESS_VIOLATION. The crash occurred at aset.c:853 > > | /* Try to allocate it */ > | block = (AllocBlock) malloc(blksize); > > Where blksize is 55011304... It's sasier to investigate still > more if I could step into functions in the dynamic loaded module, > but VC2008 IDE skips over the function body:-( Do you have any > idea how I can step into there? It is because dsm_demo.dll is not built properly. My environment is VC2008 Express/ > Win7-64. Step-into bounces back at the line where function > definition. > > | PG_FUNCTION_INFO_V1(dsm_demo_create); > > > In contrast, dsm_demo_create doesn't crash and seems to return > sane vaule. > > | =# select dsm_demo_create('hoge', 100); > | dsm_demo_create > | ----------------- > | 4294967297 It should not be success, because valid value for second argument is 0 or 1, but you have passed 100. Again here the reason could be dsm_demo.dll is not built properly. > === > And the another problem is perhaps not the issue of this module > but it happened for me. > > | =# create extension dsm_demo; > | ERROR: could not find function "dsm_demo_create" in file > "c:/pgsql/lib/dsm_demo.dll" > > I've found that generated dll file exports the function with the > names following after some investigation. > > | ...\Debug>dumpbin /EXPORTS dsm_demo.dll > | Microsoft (R) COFF/PE Dumper Version 9.00.21022.08 > | Copyright (C) Microsoft Corporation. All rights reserved. > (snipped) > | 1 0 0001100A Pg_magic_func = @ILT+5(_Pg_magic_func) > | 2 1 00011118 pg_finfo_dsm_demo_create = > @ILT+275(_pg_finfo_dsm_demo > | _create) > | 3 2 000110AF pg_finfo_dsm_demo_read = > @ILT+170(_pg_finfo_dsm_demo_r When I did dumpbin, I get following: ordinal hint RVA name 1 0 00001000 Pg_magic_func = Pg_magic_func 2 1 00001030 dsm_demo_create = dsm_demo_create 3 2 00001230 dsm_demo_read = dsm_demo_read 4 3 00001010 pg_finfo_dsm_demo_create = pg_finfo_dsm_demo_create 5 4 00001020 pg_finfo_dsm_demo_read = pg_finfo_dsm_demo_read There is a dsm_demo.def file which has below symbols EXPORTS Pg_magic_func dsm_demo_create dsm_demo_read pg_finfo_dsm_demo_create pg_finfo_dsm_demo_read Could you please once check if you have same exports in your dsm_demo.def Unless the above 2 things are not same in your env., it can fail in multiple ways. Let us first try to see why you are not getting above symbols. One more thing, can you please once check if Debug\Postgres\postgres.def contains symbol dsm_keep_segment. It might be the case that build of postgres in your m/c doesn't have dsm_keep_segment and then dsm_demo built based on such postgres will not be proper. Let me know your finding about this? > Then explicitly designating the function name in 'CREATE > FUNCTION' in dsm_demo--1.0.sql stops the complaint. You should not do that, certainly there is problem in you build > Do you have any idea for this? I use Visual studio to build in my environment. How you are setting up? Can you once do clean build after applying both(dsm_keep_segment and dsm_demo) the patches. With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com -- Sent via pgsql-hackers mailing list (email@example.com) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers